Server-Side Swift with Vapor

In this course you’ll learn everything you need to get start with Vapor, the Server-Side Swift web framework. You’ll cover the basics of routing and sending and receiving data. Next you’ll learn how to use Fluent to save and retrieve information in a database. You’ll see how to leverage Leaf, Vapor’s templating language, to build a web app. You’ll learn how to add authentication to your routes and protect your app. Finally you’ll see how to integrate the Vapor API with an iOS companion app. By Tim Condon.

5 (2) · 1 Review

Download materials
Save for later
Comments
Share

Who is this for?

Developers comfortable with Swift who want to see how to use Swift on the backend.

Covered concepts

  • Routing
  • Databases
  • Leaf and HTML
  • Authentication

Part 1: Getting Started With Vapor

01
Toggle description

In this episode get a brief introduction to the course and see the different things we’ll learn in the next 6 videos.

Toggle description

In this episode learn how to install the Vapor toolbox to create your first Vapor project! Learn the very basics of routing to see how to create your own routes.

Toggle description

In this episode, learn some of the fundamentals of HTTP that you’ll need to understand for Vapor. We’ll cover requests and responses and look at the different HTTP methods. Finally learn about the different parts of an HTTP message - the head and the body - so we know how to send and receive data.

Toggle description

In this episode, see how to use Codable to send and receive data with Vapor. Learn how to accept incoming data as JSON and return JSON responses.

Toggle description

It’s time to put everything you’ve learned so far into practice and create your own routes as part of a challenge! Create 3 different routes to cover new routes, parameters and sending and receiving JSON.

Conclusion 1:04
Toggle description

In the conclusion for part 1 we’ll review everything we’ve covered so far. Then, we’ll see what’s coming up next in Section 2 - exciting!

Part 2: Creating an API

Toggle description

In this episode get a brief introduction to the section and see the different things we’ll learn to work with Fluent and models.

Async 8:59
Toggle description

In this episode, take a deep dive into asynchronous programming and see how to work with async code in Vapor.

Toggle description

In this episode, learn how to use Fluent to create a model and save it in the database.

Toggle description

In this episode, learn how to write controllers to create routes. You’ll also learn about CRUD and how to set up routes and create and retrieve models.

Toggle description

In this episode, learn how to write the final routes to finish the CRUD operations - getting a single model, updating a model and deleting a model.

Toggle description

It’s time for another challenge! In this episode, put what you’ve learned into practice and create your own models and controlllers.

Toggle description

In this episode, learn how to set up a parent-child relationship between two models and then query the relationship.

Toggle description

In this episode, learn how to set up a sibling relationship between two models using a pivot table. You’ll then see how to query the relationship with a route.

Toggle description

In this episode, learn how to write queries in Fluent to filter on different properties to create a route for searching models.

Conclusion 0:54
Toggle description

In this episode we’ll review everythig you’ve learned in this section. Then, we’ll take a look at what’s coming up in the next section.

Part 3: Templating With Leaf

Toggle description

In this episode, get an introduction to this section and see what you’ll learn with Leaf to create a web application in Swift.

Toggle description

In this episode, integrate Leaf into your application and set up an HTML page you can view in the browser.

Toggle description

In this episode, take your templates to the next level and learn how to dynamically generate HTML to make your web application work with any acronym.

Toggle description

In this episode, learn how to embed templates in other templates to avoid duplicating code across pages.

Toggle description

In this episode, learn how to use Bootstrap to style your application and make it look amazing. You’ll also learn how to serve static files, like images from Vapor.

Toggle description

It’s time for another challenge! In this episode you’ll take what you’ve learned so far to build your own HTML pages for users and categories.

Toggle description

In this episode, learn how to create an HTML form to send data to Vapor and use the data to save a new acronym.

Toggle description

In this episode, learn how to edit and delete acronyms and see the difference between working with an API and HTML pages.

Conclusion 1:13
Toggle description

In this episode we’ll review everythig you’ve learned in this section. Then, we’ll take a look at what’s coming up in the next section.

Part 4: Authentication

Toggle description

In this episode, get an introduction to this section and cover the basics of authentication and using passwords.

Passwords 8:03
Toggle description

In this episode, learn about passwords and how to add them to your user model. You’ll also see how to use Bcrypt to properly protect passwords when saving them in the database.

Toggle description

In this episode, see how to add authentication to the different API routes. You’ll learn how to use middleware to protect routes and how authenticated users work in Vapor.

Toggle description

In this episode, see how to add authentication to the website part of your Vapor app. You’ll learn about sessions and see how authentication is different on the web compared to an API.

Conclusion 0:52
Toggle description

In this episode we’ll review everythig you’ve learned in this section. Then, we’ll take a look at what’s coming up in the next section.

Part 5: The iOS App

Toggle description

In this episode, get an introduction to this section and see what parts of the API the iOS app will use.

Toggle description

In this episode, learn how to get the iOS app to send requests to display the different models stored in the API.

Toggle description

Now that you have added a page in the iOS app to view acronyms, in this episode you’ll learn how to create and delete them. You’ll learn how to add new pages and send requests to the API to perform the actions you want.

Toggle description

In this episode, learn how to set up a relationship between acronyms and categories in an iOS app with a great user experience.

Conclusion 1:24
Toggle description

In this conclusion video, we’ll review what you have learned in both this section and throughout the course.