Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Server Side Swift with Vapor - An Introduction

Server Side Swift with Vapor - An Introduction

In recent years, thanks to Apple open sourcing of Swift and its ability to run on Linux, it has gained traction outside merely developing UI-apps for Apple platforms. In this talk, you'll learn some of the basics of Vapor - the most popular Swift framework for the server. The live demo covers routing, databases, caching and websockets. It can be accessed at this GitHub repository.

Talk presented at the Monday.com office in Tel Aviv, in our Monday Night iOS event, 16/05/22.

Useful links:

Talk's Sample Project:
https://github.com/natanrolnik/monday-night-16-05-22

Swift Server Work Group Update:
https://swift.org/blog/sswg-update/

Vapor & Docs:
https://vapor.codes
https://docs.vapor.codes

Vapor Discord
https://vapor.team

Vapor Community GitHub Org
https://github.com/vapor-community

Awesome Vapor
https://github.com/Cellane/awesome-vapor

Natan Rolnik

May 17, 2022
Tweet

More Decks by Natan Rolnik

Other Decks in Programming

Transcript

  1. Server Side Swift with Vapor Natan Rolnik You’re also a

    backend developer. (You just don’t know it yet.)
  2. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # iOS @ monday.com " @natanrolnik
  3. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # • iPhone OS 3, Objective C was my 1st language ❤ iOS @ monday.com " @natanrolnik
  4. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # • iPhone OS 3, Objective C was my 1st language ❤ • Passion for beautiful UI and animations iOS @ monday.com " @natanrolnik
  5. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # • iPhone OS 3, Objective C was my 1st language ❤ • Passion for beautiful UI and animations • Basic web development/deployment knowledge iOS @ monday.com " @natanrolnik
  6. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # • iPhone OS 3, Objective C was my 1st language ❤ • Passion for beautiful UI and animations • Basic web development/deployment knowledge • I love coding in Swift iOS @ monday.com " @natanrolnik
  7. Hi, I’m Natan • Born & raised in Brazil, moved

    to Israel in 2011 # • iPhone OS 3, Objective C was my 1st language ❤ • Passion for beautiful UI and animations • Basic web development/deployment knowledge • I love coding in Swift • Author @ RayWenderlich.com (Server Side Swift) iOS @ monday.com " @natanrolnik
  8. A Bit of History Ease of Use Less Flexibility New

    Language/Environment Great Flexibility
  9. async await More Advantages Memory Safety Type Safe Foundation Property

    Wrappers Compilation = Fail Early It’s Swift ❤
  10. async await More Advantages Memory Safety Type Safe Foundation Property

    Wrappers Compilation = Fail Early It’s Swift ❤ Share Code with Packages
  11. async await More Advantages Memory Safety Type Safe Foundation Property

    Wrappers Compilation = Fail Early It’s Swift ❤ Share Code with Packages Use Latest Language Features
  12. async await More Advantages Memory Safety Type Safe Foundation Property

    Wrappers Compilation = Fail Early It’s Swift ❤ Share Code with Packages Use Latest Language Features 5.6
  13. Current Status • Vapor and AWS Smoke: the most popular

    frameworks “Is it ready for Production?”
  14. Current Status • Vapor and AWS Smoke: the most popular

    frameworks • async/await “Is it ready for Production?”
  15. Current Status • Vapor and AWS Smoke: the most popular

    frameworks • async/await • Swift Server Work Group “Is it ready for Production?”
  16. Current Status • Vapor and AWS Smoke: the most popular

    frameworks • async/await • Swift Server Work Group • Docker images - M1 (arm64) support “Is it ready for Production?”
  17. Current Status • Vapor and AWS Smoke: the most popular

    frameworks • async/await • Swift Server Work Group • Docker images - M1 (arm64) support • Of icial AWS Lambda package “Is it ready for Production?”
  18. Current Status • Vapor and AWS Smoke: the most popular

    frameworks • async/await • Swift Server Work Group • Docker images - M1 (arm64) support • Of icial AWS Lambda package • Growing Ecosystem “Is it ready for Production?”
  19. ⚽ Striker App ⚽ Server iOS App Web 1. Create

    user 2. List users 3. Register a goal
  20. ⚽ Striker App ⚽ Server iOS App Web 1. Create

    user 2. List users 3. Register a goal 4. Update iOS app
  21. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend
  22. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend • AWS Lambda - “Serverless”
  23. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend • AWS Lambda - “Serverless” • New Apps
  24. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend • AWS Lambda - “Serverless” • New Apps • Side Projects
  25. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend • AWS Lambda - “Serverless” • New Apps • Side Projects • Internal tools
  26. So When Should I Use Swift on The Server? •

    Microservices • BFF - Backend For Frontend • AWS Lambda - “Serverless” • New Apps • Side Projects • Internal tools • Embed Vapor in your iOS app (
  27. Where To Go From Here? • Install the Vapor toolbox

    and play with it • Learn Vapor & Fluent basics
  28. Where To Go From Here? • Install the Vapor toolbox

    and play with it • Learn Vapor & Fluent basics • Advanced:
  29. Where To Go From Here? • Install the Vapor toolbox

    and play with it • Learn Vapor & Fluent basics • Advanced: • Play with packages such as Queues, Soto for AWS
  30. Where To Go From Here? • Install the Vapor toolbox

    and play with it • Learn Vapor & Fluent basics • Advanced: • Play with packages such as Queues, Soto for AWS • Try to deploy a Vapor app or Lambda
  31. Where To Go From Here? • Install the Vapor toolbox

    and play with it • Learn Vapor & Fluent basics • Advanced: • Play with packages such as Queues, Soto for AWS • Try to deploy a Vapor app or Lambda • Get started with Docker & Docker Compose