SlideShare a Scribd company logo
1 of 33
Download to read offline
SERVERLESS IN SWIFT LIKE A BREEZE
ANDREA SCUDERI
SENIOR IOS ENGINEER @ JUST EAT TAKEAWAY
NSLondon
2023.2
AGENDA
▸ Demo App with Serverless
▸ App & Serverless Architecture
▸ Code Structure
▸ Code Generation
▸ Deployment
▸ Why Serverless, Why Swift? Why Breeze?
FULL STACK SWIFT
DEMO APP
GITHUB.COM/SWIFT-SPRINTER/BREEZEDEMOAPP
▸ SwiftUI
▸ Apple Sign In
▸ Serverless API in Swift
▸ CRUD (Create, Read, Update, Delete)
DEMO APP
DATA MODEL
public struct Form: Codable {
public var key: String
public let name: String
public let fields: [Field]
public var createdAt: String?
public var updatedAt: String?
public init(key: String,
name: String,
fields: [Field],
createdAt: String? = nil,
updatedAt: String? = nil) {
self.key = key
self.name = name
self.fields = fields
self.createdAt = createdAt
self.updatedAt = updatedAt
}
enum CodingKeys: String, CodingKey {
case key = "formKey"
case name
case fields
case createdAt
case updatedAt
}
}
public struct Field: Codable {
public let question: String
public let answer: String?
public let choices: [String]?
public let selected: [String]?
public let type: FieldType
public init(question: String,
answer: String? = nil,
choices: [String]? = nil,
selected: [String]? = nil,
type: FieldType) {
self.question = question
self.answer = answer
self.choices = choices
self.selected = selected
self.type = type
}
}
public enum FieldType: String, Codable {
case text
case option
case multiOption
}
SERVERLESS NO-SQL DB
AWS DYNAMODB
{
"formKey": {
"S": "114800A1-162F-4877-81BC-96E9A42E6559"
},
"createdAt": {
"S": "2023-05-06T08:31:37.866Z"
},
"fields": {
"L": [
{
"M": {
"choices": {
"L": [
{
"S": "Cost savings 💰 "
},
{
"S": "Performance ⚡ "
},
{
"S": "Scalability 🚀 "
},
{
"S": "Infrastructure as a Code 💨 "
}
]
},
"question": {
"S": "What is the main benefit of Serverless computing?"
},
"selected": {
"L": [
{
"S": "Cost savings 💰 "
},
{
"S": "Performance ⚡ "
},
{
"S": "Infrastructure as a Code 💨 "
},
{
"S": "Scalability 🚀 "
}
]
},
"type": {
"S": "multiOption"
}
}
},
{
"M": {
MOBILE & SERVERLESS
ARCHITECTURE
Mobile App API Gateway
HTTP/REST
+ (Bearer Token)
OAUTH 2.0
PROVIDER
JWT Token
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html
Validation
SERVERLESS ARCHITECTURE
MOBILE & SERVERLESS
CODE ARCHITECTURE
BreezeLambdaAPIClient SharedModel
public struct Form: Codable {
public var key: String
public let name: String
public let fields: [Field]
public var createdAt: String?
public var updatedAt: String?
public init(key: String,
name: String,
fields: [Field],
createdAt: String? = nil,
updatedAt: String? = nil) {
self.key = key
self.name = name
self.fields = fields
self.createdAt = createdAt
self.updatedAt = updatedAt
}
enum CodingKeys: String, CodingKey {
case key = "formKey"
case name
case fields
case createdAt
case updatedAt
}
}
iOS - Swift
…
BreezeLambdaAPI BreezeDynamoDBService
SOTO
SHOW ME THE CODE!
APP API SERVICE
SERVICE-BASED BREEZE LAMBDA API CLIENT
struct FormService: FormServing {
private let apiClient: BreezeLambdaAPIClient<FeedbackForm>
private let session: SessionService
private var token: String? {
session.userSession?.jwtToken
}
init(session: SessionService) {
guard var env = try? APIEnvironment.dev() else {
fatalError("Invalid Environment")
}
env.logger = Logger()
self.session = session
self.apiClient = BreezeLambdaAPIClient<FeedbackForm>(env: env, path: "forms", additionalHeaders: [:])
}
func create(form: FeedbackForm) async throws -> FeedbackForm {
try await apiClient.create(token: token, item: form)
}
func read(key: String) async throws -> FeedbackForm {
try await apiClient.read(token: token, key: key)
}
func update(form: FeedbackForm) async throws -> FeedbackForm {
try await apiClient.update(token: token, item: form)
}
Data Model
Environment API PATH
JWT Token
APP API SERVICE
BREEZE LAMBDA API CLIENT
struct Environment {
static func dev() throws -> APIClientEnv {
try APIClientEnv(session: URLSession.shared, baseURL: "<API GATEWAY BASE URL FROM SERVERLESS DEPLOY>")
}
}
extension FeedbackForm: KeyedCodable {}
struct Logger: APIClientLogging {
func log(request: URLRequest) {
print(request)
}
func log(data: Data, for response: URLResponse) {
print(response)
let value = String(data: data, encoding: .utf8) ?? ""
print(value)
}
}
LAMBDA CODE
ONE LINE OF CODE !!!
import Foundation
import BreezeLambdaAPI
import BreezeDynamoDBService
import SharedModel
extension Form: BreezeCodable { }
BreezeLambdaAPI<Form>.main()
public protocol BreezeCodable: Codable {
var key: String { get set }
var createdAt: String? { get set }
var updatedAt: String? { get set }
}
SWIFT !!!
YES, I CAN UNDERSTAND IT!
INFRASTRUCTURE AS A CODE
SERVERLESS.YML
▸ API Gateway v2
▸ Lambda
▸ DynamoDB
▸ IAM
▸ Package
SERVERLESS.YML ?!?
LOOKS QUITE HARD !
HOW DO I START?
▸ A SMALLER YML CONFIG
▸ COMMAND LINE TOOL GENERATES:
▸ PROJECT FOLDER
▸ SWIFT PACKAGE
▸ SERVERLESS.YML
▸ BUILD SCRIPT
▸ DEPLOYMENT SCRIPT
SERVERLESS WITH BREEZE
CODE GENERATION WITH BREEZE
service: swift-breeze-rest-form-api
awsRegion: us-east-1
swiftVersion: 5.7.3
swiftConfiguration: release
packageName: BreezeFormAPI
buildPath: build
cors: false
authorizer: #optional
name: appleJWT
type: JWTAuthorizer
issuerUrl: https://appleid.apple.com
audience:
- com.andrea.DemoApp #APP BUNDLE ID
breezeLambdaAPI:
targetName: FormAPI
itemCodable: Form
itemKey: formKey
httpAPIPath: /forms
dynamoDBTableNamePrefix: forms
CODE GENERATION
BREEZE COMMAND LINE
swift run breeze -c breeze.yml -t .build/temp
CODE GENERATION
BREEZE COMMAND LINE
CODE BUILD
BREEZE BUILD
./build.sh
❌
build
Docker image: swift:5.7-amazonlinux2
CODE BUILD
BREEZE BUILD
./build.sh
SERVERLESS DEPLOY
BREEZE DEPLOY
./deploy.sh
serverless.yml
build Deployment con
fi
guration
CloudFormation AWS Deployment
serverless deploy
SERVERLESS DEPLOY
BREEZE DEPLOY
./deploy.sh
SERVERLESS LIKE A BREEZE!
BREEZE WORKFLOW
STEP BY STEP WORKFLOW
▸ Git Clone https://github.com/swift-sprinter/Breeze
▸ Copy Breeze.yml con
fi
g from the README
▸ Add the Authorizer to the con
fi
g if you want to secure the API!!!
▸ Adjust the con
fi
guration
▸ Generate the code and customise the data model
▸ Build the Lambdas
▸ Deploy the Serverless
▸ Implement your app using the BreezeLambdaAPIClient
WHY SERVERLESS?
WHY SWIFT?
WHY BREEZE?
WHY SERVERLESS? WHY SWIFT? WHY BREEZE?
▸ Scalability
▸ Reduced Operational Overhead
▸ Pay per use
▸ Faster Time to market
▸ Easy Integration
WHY SERVERLESS?
WHY SERVERLESS? WHY SWIFT? WHY BREEZE?
▸ iOS Developers ❤ it!
▸ No need to learn a new language
▸ Modern and performant language
▸ Safe
▸ Expressive
▸ Fast
WHY SWIFT?
▸ Quick Start!
▸ Project setup
▸ Build
▸ Deploy
▸ Full control
▸ Adaptable
▸ Open Source
WHY SERVERLESS? WHY SWIFT? WHY BREEZE?
WHY BREEZE?
GITHUB BREEZE
GITHUB.COM/SWIFT-SPRINTER/BREEZE
THANK YOU!
ANDREA SCUDERI - SENIOR IOS ENGINEER @ JUST EAT TAKEAWAY
STAY IN TOUCH!
▸ Twitter: @andreascuderi13
▸ Linkedin: https://www.linkedin.com/in/andreascuderi/
▸ Medium: https://medium.com/@andreascuderi73

More Related Content

Similar to Serverless in Swift like a Breeze

Similar to Serverless in Swift like a Breeze (20)

Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
 
Application Server-less Web Applications - Serverless Toronto Meetup
Application Server-less Web Applications - Serverless Toronto Meetup Application Server-less Web Applications - Serverless Toronto Meetup
Application Server-less Web Applications - Serverless Toronto Meetup
 
Engineering Efficiency in LINE
Engineering Efficiency in LINEEngineering Efficiency in LINE
Engineering Efficiency in LINE
 
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
 
Firebird 3: provider-based architecture, plugins and OO approach to API
Firebird 3: provider-based architecture, plugins and OO approach to API Firebird 3: provider-based architecture, plugins and OO approach to API
Firebird 3: provider-based architecture, plugins and OO approach to API
 
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud
 
Serverless Spring by Stephane Maldini
Serverless Spring by Stephane MaldiniServerless Spring by Stephane Maldini
Serverless Spring by Stephane Maldini
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
Symfony2 for Midgard Developers
Symfony2 for Midgard DevelopersSymfony2 for Midgard Developers
Symfony2 for Midgard Developers
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Ane for 9ria_cn
Ane for 9ria_cnAne for 9ria_cn
Ane for 9ria_cn
 
Serverless Application Development with SAM
Serverless Application Development with SAMServerless Application Development with SAM
Serverless Application Development with SAM
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019
 
ANZ Dev Lounge Session - Feb 2017
ANZ Dev Lounge Session - Feb 2017ANZ Dev Lounge Session - Feb 2017
ANZ Dev Lounge Session - Feb 2017
 
Automation day red hat ansible
   Automation day red hat ansible    Automation day red hat ansible
Automation day red hat ansible
 

Recently uploaded

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Recently uploaded (20)

Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 

Serverless in Swift like a Breeze

  • 1. SERVERLESS IN SWIFT LIKE A BREEZE ANDREA SCUDERI SENIOR IOS ENGINEER @ JUST EAT TAKEAWAY NSLondon 2023.2
  • 2. AGENDA ▸ Demo App with Serverless ▸ App & Serverless Architecture ▸ Code Structure ▸ Code Generation ▸ Deployment ▸ Why Serverless, Why Swift? Why Breeze?
  • 4. DEMO APP GITHUB.COM/SWIFT-SPRINTER/BREEZEDEMOAPP ▸ SwiftUI ▸ Apple Sign In ▸ Serverless API in Swift ▸ CRUD (Create, Read, Update, Delete)
  • 5. DEMO APP DATA MODEL public struct Form: Codable { public var key: String public let name: String public let fields: [Field] public var createdAt: String? public var updatedAt: String? public init(key: String, name: String, fields: [Field], createdAt: String? = nil, updatedAt: String? = nil) { self.key = key self.name = name self.fields = fields self.createdAt = createdAt self.updatedAt = updatedAt } enum CodingKeys: String, CodingKey { case key = "formKey" case name case fields case createdAt case updatedAt } } public struct Field: Codable { public let question: String public let answer: String? public let choices: [String]? public let selected: [String]? public let type: FieldType public init(question: String, answer: String? = nil, choices: [String]? = nil, selected: [String]? = nil, type: FieldType) { self.question = question self.answer = answer self.choices = choices self.selected = selected self.type = type } } public enum FieldType: String, Codable { case text case option case multiOption }
  • 6. SERVERLESS NO-SQL DB AWS DYNAMODB { "formKey": { "S": "114800A1-162F-4877-81BC-96E9A42E6559" }, "createdAt": { "S": "2023-05-06T08:31:37.866Z" }, "fields": { "L": [ { "M": { "choices": { "L": [ { "S": "Cost savings 💰 " }, { "S": "Performance ⚡ " }, { "S": "Scalability 🚀 " }, { "S": "Infrastructure as a Code 💨 " } ] }, "question": { "S": "What is the main benefit of Serverless computing?" }, "selected": { "L": [ { "S": "Cost savings 💰 " }, { "S": "Performance ⚡ " }, { "S": "Infrastructure as a Code 💨 " }, { "S": "Scalability 🚀 " } ] }, "type": { "S": "multiOption" } } }, { "M": {
  • 7. MOBILE & SERVERLESS ARCHITECTURE Mobile App API Gateway HTTP/REST + (Bearer Token) OAUTH 2.0 PROVIDER JWT Token https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html Validation
  • 9. MOBILE & SERVERLESS CODE ARCHITECTURE BreezeLambdaAPIClient SharedModel public struct Form: Codable { public var key: String public let name: String public let fields: [Field] public var createdAt: String? public var updatedAt: String? public init(key: String, name: String, fields: [Field], createdAt: String? = nil, updatedAt: String? = nil) { self.key = key self.name = name self.fields = fields self.createdAt = createdAt self.updatedAt = updatedAt } enum CodingKeys: String, CodingKey { case key = "formKey" case name case fields case createdAt case updatedAt } } iOS - Swift … BreezeLambdaAPI BreezeDynamoDBService SOTO
  • 10. SHOW ME THE CODE!
  • 11. APP API SERVICE SERVICE-BASED BREEZE LAMBDA API CLIENT struct FormService: FormServing { private let apiClient: BreezeLambdaAPIClient<FeedbackForm> private let session: SessionService private var token: String? { session.userSession?.jwtToken } init(session: SessionService) { guard var env = try? APIEnvironment.dev() else { fatalError("Invalid Environment") } env.logger = Logger() self.session = session self.apiClient = BreezeLambdaAPIClient<FeedbackForm>(env: env, path: "forms", additionalHeaders: [:]) } func create(form: FeedbackForm) async throws -> FeedbackForm { try await apiClient.create(token: token, item: form) } func read(key: String) async throws -> FeedbackForm { try await apiClient.read(token: token, key: key) } func update(form: FeedbackForm) async throws -> FeedbackForm { try await apiClient.update(token: token, item: form) } Data Model Environment API PATH JWT Token
  • 12. APP API SERVICE BREEZE LAMBDA API CLIENT struct Environment { static func dev() throws -> APIClientEnv { try APIClientEnv(session: URLSession.shared, baseURL: "<API GATEWAY BASE URL FROM SERVERLESS DEPLOY>") } } extension FeedbackForm: KeyedCodable {} struct Logger: APIClientLogging { func log(request: URLRequest) { print(request) } func log(data: Data, for response: URLResponse) { print(response) let value = String(data: data, encoding: .utf8) ?? "" print(value) } }
  • 13. LAMBDA CODE ONE LINE OF CODE !!! import Foundation import BreezeLambdaAPI import BreezeDynamoDBService import SharedModel extension Form: BreezeCodable { } BreezeLambdaAPI<Form>.main() public protocol BreezeCodable: Codable { var key: String { get set } var createdAt: String? { get set } var updatedAt: String? { get set } }
  • 14. SWIFT !!! YES, I CAN UNDERSTAND IT!
  • 15. INFRASTRUCTURE AS A CODE SERVERLESS.YML ▸ API Gateway v2 ▸ Lambda ▸ DynamoDB ▸ IAM ▸ Package
  • 17. HOW DO I START?
  • 18. ▸ A SMALLER YML CONFIG ▸ COMMAND LINE TOOL GENERATES: ▸ PROJECT FOLDER ▸ SWIFT PACKAGE ▸ SERVERLESS.YML ▸ BUILD SCRIPT ▸ DEPLOYMENT SCRIPT SERVERLESS WITH BREEZE CODE GENERATION WITH BREEZE service: swift-breeze-rest-form-api awsRegion: us-east-1 swiftVersion: 5.7.3 swiftConfiguration: release packageName: BreezeFormAPI buildPath: build cors: false authorizer: #optional name: appleJWT type: JWTAuthorizer issuerUrl: https://appleid.apple.com audience: - com.andrea.DemoApp #APP BUNDLE ID breezeLambdaAPI: targetName: FormAPI itemCodable: Form itemKey: formKey httpAPIPath: /forms dynamoDBTableNamePrefix: forms
  • 19. CODE GENERATION BREEZE COMMAND LINE swift run breeze -c breeze.yml -t .build/temp
  • 23. SERVERLESS DEPLOY BREEZE DEPLOY ./deploy.sh serverless.yml build Deployment con fi guration CloudFormation AWS Deployment serverless deploy
  • 25. SERVERLESS LIKE A BREEZE!
  • 26. BREEZE WORKFLOW STEP BY STEP WORKFLOW ▸ Git Clone https://github.com/swift-sprinter/Breeze ▸ Copy Breeze.yml con fi g from the README ▸ Add the Authorizer to the con fi g if you want to secure the API!!! ▸ Adjust the con fi guration ▸ Generate the code and customise the data model ▸ Build the Lambdas ▸ Deploy the Serverless ▸ Implement your app using the BreezeLambdaAPIClient
  • 28. WHY SERVERLESS? WHY SWIFT? WHY BREEZE? ▸ Scalability ▸ Reduced Operational Overhead ▸ Pay per use ▸ Faster Time to market ▸ Easy Integration WHY SERVERLESS?
  • 29. WHY SERVERLESS? WHY SWIFT? WHY BREEZE? ▸ iOS Developers ❤ it! ▸ No need to learn a new language ▸ Modern and performant language ▸ Safe ▸ Expressive ▸ Fast WHY SWIFT?
  • 30. ▸ Quick Start! ▸ Project setup ▸ Build ▸ Deploy ▸ Full control ▸ Adaptable ▸ Open Source WHY SERVERLESS? WHY SWIFT? WHY BREEZE? WHY BREEZE?
  • 33. ANDREA SCUDERI - SENIOR IOS ENGINEER @ JUST EAT TAKEAWAY STAY IN TOUCH! ▸ Twitter: @andreascuderi13 ▸ Linkedin: https://www.linkedin.com/in/andreascuderi/ ▸ Medium: https://medium.com/@andreascuderi73