
Learn to build a full stack iOS grocery app with vapor and PostgreSQL, covering routing, controllers, middleware, async/await, jwt authentication, and Heroku deployment.
Explore how the Vapor community supports developers with comprehensive documentation, getting started guides, and fast feedback, revealing Vapor as a robust web framework for APIs and web apps.
Demonstrate strong Swift proficiency with 1–1.5 years of experience; this course does not teach Swift basics, and covers Vapor full-stack development using Swift, Swift Package Manager, MVC, and Heroku.
Download and use the section exercise files, including client, server, and shared swift package, to follow along with the grocery project or its final exercise.
Master full stack iOS development by building client side UI with swiftui and server side APIs with vapor, incrementally implementing login and registration to reveal real-world design decisions.
Define full stack development as creating both front end and back end, with the iOS app as the client facing interface and vapor as the server, highlighting vapor’s async/await.
Explore Vapor as a high-performance Swift web framework for building web apps and APIs, offering routing, middleware, an MVC pattern, databases, authentication, session management, and async/await.
Install vapor on macOS by following Vapor Code's getting started guide, including installing homebrew, then running brew install vapor and checking vapor help to verify the setup.
Learn to scaffold a vapor project with viper toolbox and vapor new, install dependencies in Xcode, run the server on port 3000, configure scheme to run from the project directory.
Learn about Vapor's updated folder structure, where all files live in the app folder, main.swift becomes entry point, and the run folder is removed, simplifying project setup.
Learn to access strongly typed route parameters in Vapor by treating the customer ID as an integer, validating input with guard, and returning a bad request on non numeric values.
Create a post route in Vapor to receive JSON payloads, decode them into a movie model, and return the same movie as JSON.
Decode query strings in Vapor by parsing URL parameters such as sort and search, decode them into a hotel query struct, and handle optional fields for flexible queries.
Use route groups with app.grouped to create prefix-based collections like movies and users, handle route parameters, and build scalable, nested routes for large Vapor apps.
Explore mvc design pattern by examining model, view, and controller; the model defines data shape with properties like name, age, breed, weight, height, and the controller returns data or views.
Create a movies controller that follows MVC and conforms to route collection, boot the root path, and implement index and show functions to handle requests and IDs.
Explore middleware as a logic chain between the client and Vapor route handler, with requests passing through one or more middlewares, including authentication, logging, and compression before reaching the route.
Create a simple log middleware in Vapor using async middleware, log requests to the console, and forward the request with next.respond, registered to run for every route.
Postgres App
Beekeeper Community Edition
2. Create the database:
CREATE DATABASE mydatabase;
CREATE USER myuser WITH PASSWORD 'mypassword';
GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;
Exit the PostgreSQL prompt:
\q
Learn to set up a Postgres database on Elephant SQL and connect it to a Vapor app to return JSON, using the free tiny turtle plan.
define a movie model in vapor with fluent, using id as a uuid primary key and title as a database column, store in a movies table, and add a migration.
Learn to manage database changes with migrations in Fluent, creating a movies table with id and title using an async migration, covering prepare, revert, registration, and running with Vapor migrate.
Fetch all movies with a get route and retrieve a single movie by id using the find function, root parameters, and async/await, with error handling for missing entries.
Delete a movie in vapor using the delete http method at movies/:id. Find the movie by ID, delete it, and return the deleted record, validating with Postman.
Update an existing movie by sending a put request with the updated movie in the body, locating the target by ID, and returning the updated record.
Build a grocery app with registration and login using JWT, a Vapor server on Heroku, and SwiftUI client managing categories and items from Postgres with DTOs via Swift Package Manager.
Create a vapor server folder and a swift application project using a barebones template, name the grocery app server and grocery app, then plan to add fluent and jwt dependencies.
Add required dependencies to the vapor project, including fluent, fluent postgresql driver, and JWT, configure targets, and prepare the project for authentication and a local Postgres database.
Visualize and query relational databases with Beekeeper Studio. Download the community edition for arm64 mac, install via DMG or AppImage, and connect to a local Postgres database.
Connect Beekeeper Studio to your locally running PostgreSQL database by selecting Postgres, entering localhost and port 5432, using Grocery DB, then keep Beekeeper open to verify your tables.
Create a user model to interact with a fluent database, defining id, username, and password, with validations and content decoding for JSON requests.
Develop a user controller under the root collection to handle login and registration, and implement a post route api/register with validation, decoding, and password hashing.
Test user registration with Postman by posting to api/register, using content-type: application/json, sending username and password, and verify hashing, validation, and duplicate username errors.
Generate and return a token by encoding an auth payload with subject, expiration, and user id, using coding keys, while validating non-expired tokens and avoiding sensitive data.
Authenticate the user, then create and sign a jwt from an auth payload and return a login response containing the token and user id.
Test the login route with Postman to verify token authentication in a Vapor app using Postgres. Validate correct and incorrect credentials and outline client-side screens for registration and login.
Become a proficient full stack developer with our comprehensive Udemy course! Learn SwiftUI, Vapor, and Postgres to create robust, scalable, and secure web applications. Dive deep into SwiftUI for beautiful user interfaces, explore Vapor for server-side Swift development, and integrate it with Postgres for efficient data management. Master authentication, authorization, and deployment to the cloud. Gain practical experience through engaging projects and coding exercises. Enroll now to unlock your full stack development potential and join our vibrant learning community. Let's embark on this exciting journey together!
What will students learn in this course?
- Develop proficiency in full stack development using SwiftUI, Vapor, and Postgres.
- Understand the powerful combination of SwiftUI, Vapor, and Postgres for building web applications.
- Learn how to set up a backend server using Vapor and handle routing and HTTP requests.
- Gain knowledge of Vapor's middleware for request processing and data manipulation.
- Explore the integration of Vapor with Postgres for efficient storage and retrieval of data.
- Implement robust authentication and authorization systems using JSON Web Tokens (JWT).
- Securely manage user sessions, handle user registration and login processes.
- Protect web applications from common security vulnerabilities.
- Establish seamless communication between the front-end and back-end.
- Deploy applications to the cloud, making them accessible to users worldwide.
- Solidify understanding through engaging projects and coding exercises.
- Access comprehensive resources, including downloadable project files and code samples.
- Develop the confidence to tackle real-world challenges in full stack development.
Who is this course for?
- Aspiring full stack developers looking to enhance their skills and knowledge.
- Individuals interested in creating robust, scalable, and secure web applications.
- Swift developers seeking to expand their expertise to include server-side development.
- Those interested in learning SwiftUI, Vapor, and Postgres for full stack development.
- Programmers who want to build modern, beautiful user interfaces using SwiftUI.
- Developers who want to explore Vapor as a server-side Swift framework.
- Individuals interested in integrating Vapor with Postgres for efficient data management.
- Those looking to gain hands-on experience in implementing authentication and authorization systems.
- Developers aiming to deploy their applications to the cloud and make them globally accessible.
- Learners who prefer a practical approach with engaging projects and coding exercises.
- Individuals seeking valuable resources and references for future full stack development endeavors.
Join our comprehensive Udemy course today and unlock your potential as a proficient full stack developer! Whether you're eager to create robust, scalable, and secure web applications or expand your Swift expertise, this course is designed to equip you with the necessary skills. Gain in-depth knowledge of SwiftUI, Vapor, and Postgres, and master the art of seamless communication between front-end and back-end. With practical projects, coding exercises, and comprehensive resources, you'll confidently tackle real-world challenges. Enroll now and become part of our vibrant learning community, ready to take your development skills to new heights. Let's embark on this exciting journey together!