Includes free updates for new Swift versions – click to read my update policy

Building web apps in Swift lets you re-use the skills you've already mastered, while being faster and safer than other languages. This course teaches you everything you need to craft your own server-side APIs and websites, all using Swift.

100% SWIFT 4

Don't waste time with out of date tutorials – here you can learn smart, powerful, and expressive Swift the way it was meant to be written.


You learn Swift while you make real web apps, which means you get to apply your new skills immediately and see them work in context.


Master sessions, databases, logging, templating, user authentication, and more – everything you need to build your own web apps.


I've taught thousands of people to build iOS apps, and I'll help you transfer your skills to the web and unleash Swift on your server.

Available in two editions

There are two popular frameworks for server-side Swift. You can buy them individually or get them both along with more books through my Swift Platform Pack.


Server-Side Swift teaches you Swift and web development through real-world projects. There's a comprehensive Swift introduction for beginners, but the rest of the book is focused on building real web apps and websites using Swift.

The Vapor edition of the book is currently being written, but is available for pre-order so you can start learning as soon as it's released.

The Kitura edition of Server-Side Swift includes 12 projects in total: eight apps, and four technique projects that focus on specific APIs.

Project 1: Million Hairs

Get started coding server-side Swift by learning about the Swift Package Manager, then making your first website using Stencil templates and request routing.

Project 2: CouchDB Poll

Learn how the CouchDB database can help you load and save user data quickly, then use that new-found knowledge to build your own custom voting API using JSON.

Project 3: Routing

Discover how route chaining, codable routing, and regular expressions combine together to let you structure your web code in a clear, expressive way.

Project 4: Swift Fan Club

Build a CouchDB-based messageboard, that uses sessions, encrypted login credentials, Stencil templates, and Boostrap to let users write and reply to forum posts.

Project 5: Meme Machine

See how easy it is to let users upload files to your server by accepting and resizing images, while also learning how to work with your server's filesystem.

Project 6: Templates

Stencil is packed with features, and in this technique project we look at conditions, loops, and comments, as well a how to write your own custom filters and tags.

Project 7: Barkr

Get started with SQL databases by learning about MySQL, then use it to build a microblogging API complete with token-based user authentication.

Project 8: ASCII art

This project introduces asynchronous data transfer using ajax, while building a web front-end that is able to fetch and manipulate remote image data.

Project 9: Databases

Dive deep into advanced SQL techniques and learn how indexing, normalization, referential integrity, and transactions can help you build faster, safer databases.

Project 10: Instant Coder

Learn how to lock off parts of your site based on user authentication, then connect that to GitHub so users can create profiles using third-party authentication.

Project 11: AppleFanatic

Build your own website content management system split into front-end and back-end services, then render articles for end users by transforming Markdown into HTML.

Project 12: XCTest

Learn how Swift's XCTest framework can help validate your back-end APIs work as you intended – writing all your unit tests entirely in Swift, of course.

While building projects, you'll learn all this and more:

  • How to transfer your existing Swift knowledge to the server.
  • Connecting to databases to read and write data, using CouchDB and MySQL.
  • Creating server-side sessions for temporary storage.
  • Building re-usable templates to separate your presentation from your logic.
  • How to design, build, and test web APIs for your Swift apps.
  • Authenticating users to create login screens.
  • You'll also learn some HTML, JavaScript, and SQL along the way, as part of the Swift projects.

Server-Side Swift follows the same approach I used with Hacking with Swift: small, standalone projects that teach individual techniques starting from scratch, so you end up with a huge library of finished projects you can develop further or use as the base for something entirely new.

Now for the answer to a question you've probably been asking: why are there two editions of the book? It's not an accident:

  • Although Vapor and Kitura both deal with server-side Swift, the way they approach the problem is completely different. So, while the books inevitably have many similarities, both books were written to ensure you're using each framework as they were intended.
  • While you can share some of your Swift code, much of each platform is unique – things like Fluent on Vapor and codable routing on Kitura. Keeping them in separate books helps avoid confusion and constant diversions.
  • Both books are included in my Swift Platform Pack, along with Hacking with macOS, Hacking with watchOS, Hacking with tvOS, and Practical iOS 11. So, if you want to learn both and see which works best for you, that's a smart option.

Download full table of contents (Kitura edition)

Download free 24-page sample (Kitura edition)