Announcing Server-Side Swift with Vapor — Fully Updated for Vapor 4!
We’re beyond excited to announce that our book, Server-Side Swift with Vapor, has been fully updated for Vapor 4 — and includes a completely new chapter! By Chris Belanger.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Announcing Server-Side Swift with Vapor — Fully Updated for Vapor 4!
20 mins
- What is Server-Side Swift with Vapor?
- Who is this Book For?
- What’s Inside Server-Side Swift with Vapor?
- Section I: Creating a Simple Web API
- Section II: Making a Simple Web App
- Section III: Validation, Users & Authentication
- Section IV: Advanced Server-Side Swift
- Section V: Production & External Deployment
- About the Authors
- Where to Go From Here?
Section II: Making a Simple Web App
This section teaches you how to build a front-end web site for your Vapor application. You’ll learn to use Leaf, Vapor’s templating engine, to generate dynamic web pages to display your app’s data. You’ll also learn how to accept data from a browser so that users can create and edit your models. This section will provide you the necessary building blocks to build a full website with Vapor.
- Templating with Leaf: In this chapter, you’ll learn how to use Leaf, Vapor’s templating language, to make simple and dynamic websites using Vapor. Leaf allows you to pass information to a webpage so it can generate the final HTML without knowing everything up front.
- Beautifying Pages: In this chapter, you’ll learn how to use the Bootstrap framework to add styling to your pages. You’ll also learn how to embed templates so you only have to make changes in one place.
- Making a Simple Web App, Part 1: In this chapter, you’ll learn how to create different models and how to edit acronyms.
- Making a Simple Web App, Part 2: In this chapter, you’ll learn how to allow users to add categories to acronyms in a user-friendly way.
Section III: Validation, Users & Authentication
This section shows you how to protect your Vapor application with authentication. You’ll learn how to add password protection to both the API and the website, which lets you require users to log in. You’ll learn about different types of authentication: HTTP Basic authentication and token-based authentication for the API, and cookie- and session-based authentication for the web site.
Finally, you’ll learn how to integrate with Google, Github and Apple’s OAuth providers. This allows you to delegate authentication and allow users to utilize their Google, Github or Apple account credentials to access your site.
These chapters will allow you to secure your important routes and keep only allowed routes as unauthenticated. You’ll also learn how to delegate the authentication duties to third party vendors while still keeping your application secure.
- API Authentication, Part 1: In this chapter, you’ll learn how to protect your API with authentication. You’ll learn how to implement both HTTP basic authentication and token authentication in your API. You’ll also learn best practices for storing passwords and authenticating users.
- API Authentication, Part 2: In this chapter, you’ll update both the Tests and the iOS application to work with the new authenticated APIs.
- Web Authentication, Cookies & Sessions: In this chapter you’ll learn how to implement authentication for the TIL website using Cookies & Sessions.
- Validation: In this chapter, you’ll learn how to use Vapor’s Validation library to verify some of the information users send the application.
- Google Authentication: In this chapter, you’ll learn how to use OAuth 2.0 to delegate authentication to Google, so users can log in with their Google accounts instead.
- GitHub Authentication: In this chapter, you’ll see how to allow users to log in with their GitHub accounts.
- Sign in with Apple Authentication [New!]: Learn how to integrate Sign in with Apple with your Vapor app to use both with iOS and the website.
Section IV: Advanced Server-Side Swift
This section covers a number of different topics you may need to consider when developing server-side applications. These chapters will provide you the necessary building blocks to continue on your Vapor adventure and build even more complex and wonderful applications.
The chapters in this section deal with more advanced topics for Vapor and were written by the Vapor Core Team members. These include the use of Caching, Middleware and how to version your database / api including performing migrations.
- Password Reset & Emails: Learn how to integrate an email service to send emails to users. You’ll also learn how to use emails to reset user passwords.
- Adding Profile Pictures: Learn how to send files in requests and handle that in your Vapor application. Use this knowledge to allow users to upload profile pictures in the web application.
- Database/API Versioning & Migration: In this chapter you’ll learn how to migrate your database without having to delete it. You’ll also learn how to use versioning for your applications API’s.
- Caching: Learn how to make your app feel snappier and more responsive by caching the results of slow processes.
- Middleware: Learn how Middleware integrates into your request and response pipeline to view and if needed mutate incoming requests and outgoing responses.
- WebSockets: Learn how to implement WebSockets for real time communication between clients and servers.
- Advanced Fluent: You’ll lean more advanced features of Fluent such as saving models with enums, using Fluent’s soft delete and timestamp features and learn how to use raw SQL and joins.
Section V: Production & External Deployment
This section shows you how to deploy your Vapor application to external Cloud-based providers to offload the job of hosting your application. You’ll learn how to upload to Heroku, a popular platform for deploying applications as well as deploying to AWS or Docker.
The chapters in this section deal with hosting and production concerns when deploying your Vapor application and how to split your application into multiple services (microservices) to balance the load on your application.
- Deploying with Heroku: Learn how to deploy a Vapor web app utilizing PostgreSQL to Heroku.
- Deploying with Docker: Learn how to deploy with docker using Docker Compose to run containers sharing the same virtual network but isolated from other instances on the same host.
- Deploying with AWS: Learn how to deploy your Vapor app to Amazon Web Services (AWS) using some of the service offerings provided.
- Production Concerns & Redis: Learn the advantages and disadvantages of some common deployment methods for Vapor.
- Microservices, Part 1: Learn how to leverage microservices to split up your code into different applicatons.
- Microservices, Part 2: Learn about API gateways and how to make microservices accessible to clients.