AWS re:Invent 2016: Workshop: Deploy a Swift Web Application on Amazon ECS (CON315)
FrenchKit: End to End Application Development with Swift
-
Upload
chris-bailey -
Category
Software
-
view
265 -
download
1
Transcript of FrenchKit: End to End Application Development with Swift
![Page 1: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/1.jpg)
Swift @ IBM Engineering TeamChris Bailey(@Chris__Bailey)
September 23rd, 2016
End to End Application Development
Swift @ IBM
![Page 2: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/2.jpg)
User-facing Client Apps
Modern Application Design
App Services
3rd Party Services
On Prem Services
End Users
Swift @ IBM
![Page 3: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/3.jpg)
Modern Application Design
End Users User-facing Client Apps
App Services
On Prem Services
3rd Party Services
Swift @ IBM
![Page 4: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/4.jpg)
Modern Application Design
End Users User-facing Client Apps
App Services
On Prem Services
3rd Party Services
Developer ExperienceIntegrated
Swift @ IBM
![Page 5: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/5.jpg)
Why Swift on the Server?
Swift @ IBM
![Page 6: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/6.jpg)
4.0
0.0
20.0
40.0
60.0
80.0
100.0
120.0
Performant Applications
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Dur
atio
n (s
) (lo
wer
is b
ette
r)
Swift @ IBM
![Page 7: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/7.jpg)
4.0 4.3
0.0
20.0
40.0
60.0
80.0
100.0
120.0
Performant Applications
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Dur
atio
n (s
) (lo
wer
is b
ette
r)
Swift @ IBM
![Page 8: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/8.jpg)
4.0 4.315.8
0.0
20.0
40.0
60.0
80.0
100.0
120.0
Performant Applications
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Dur
atio
n (s
) (lo
wer
is b
ette
r)
Swift @ IBM
![Page 9: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/9.jpg)
Performant Applications
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
4.0 4.315.8
134.2
0.0
20.0
40.0
60.0
80.0
100.0
120.0
Dur
atio
n (s
) (lo
wer
is b
ette
r)
Swift @ IBM
![Page 10: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/10.jpg)
15.0
0.0
10.0
20.0
30.0
40.0
50.0
60.0
Low Memory
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Mem
ory
Usa
ge (M
B)
(low
er is
bet
ter)
Swift @ IBM
![Page 11: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/11.jpg)
15.0
32.2
0.0
10.0
20.0
30.0
40.0
50.0
60.0
Low Memory
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Mem
ory
Usa
ge (M
B)
(low
er is
bet
ter)
Swift @ IBM
![Page 12: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/12.jpg)
15.0
32.2
25.3
0.0
10.0
20.0
30.0
40.0
50.0
60.0
Low Memory
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Mem
ory
Usa
ge (M
B)
(low
er is
bet
ter)
Swift @ IBM
![Page 13: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/13.jpg)
15.0
32.2
25.3
54.6
0.0
10.0
20.0
30.0
40.0
50.0
60.0
Low Memory
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
Mem
ory
Usa
ge (M
B)
(low
er is
bet
ter)
Swift @ IBM
![Page 14: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/14.jpg)
Swift is ideal for Cloud
Swift @ IBM
![Page 15: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/15.jpg)
Isomorphic Development
Swift @ IBM
Create Swift Project
![Page 16: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/16.jpg)
Isomorphic Development
Swift @ IBM
Create Swift Project
Deploy Deploy
![Page 17: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/17.jpg)
Isomorphic Development
Swift @ IBM
Create Swift Project
Deploy DeployGenerate
Swagger APISpecification
• Program in Swift on client and server
• Share code on both sides
• Automatically created Swagger APIs
![Page 18: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/18.jpg)
Sharing tools and technologies
Swift @ IBM
![Page 19: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/19.jpg)
How does this happen?
Swift @ IBM
![Page 20: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/20.jpg)
Extend Swift to the server
Swift on the Server can attract Swift-based Developers
Swift @ IBM
![Page 21: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/21.jpg)
December 3rd, 2015
Apache 2.0 Software Licence
Open Source Swift
![Page 22: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/22.jpg)
Linux Platforms Darwin Platforms
Swift on Linux
Swift @ IBM
Swift
StandardLibrary Foundation Dispatch
Swift
StandardLibrary Foundation Dispatch
Consistent Runtime across Platforms
![Page 23: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/23.jpg)
Add a Web Framework
![Page 25: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/25.jpg)
Server / Cloud Deployment Server / Cloud Deployment Apple Client Deployment
Client Facing App Client-Specific
Libraries
Kitura Web Framework
Swift @ IBM
Swift
StandardLibrary Foundation Dispatch
Swift
StandardLibrary Foundation Dispatch
Net
wor
king
Sec
urity
HTT
P P
arsi
ng
Application Libraries
Application Specific Cloud Services
Server-Specific Libraries
Consistent Runtime across Clients/Servers
Kitura-based Server !Built with Dispatch & Foundation
Application Libraries
![Page 26: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/26.jpg)
Server / Cloud Deployment Server / Cloud Deployment Apple Client Deployment
Client Facing App Client-Specific
Libraries
Kitura Web Framework
Swift @ IBM
Swift
StandardLibrary Foundation Dispatch
Swift
StandardLibrary Foundation Dispatch
Net
wor
king
Sec
urity
HTT
P P
arsi
ng
Application Libraries
Application Specific Cloud Services
Server-Specific Libraries
Consistent Runtime across Clients/Servers
Kitura-based Server !Built with Dispatch & Foundation
Swift
“Server” APIs
Application Libraries
![Page 27: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/27.jpg)
Swift on the Server is Real
Swift 3.0 + Kitura 1.0
Swift @ IBM
![Page 28: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/28.jpg)
Let’s take a tour…
Swift @ IBM
![Page 29: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/29.jpg)
Architecture
Web Framework Source
Swift Binary
Dispatch Foundation Package Manager
Swift Libraries
SwiftyJSON SwiftMongoDB
C Helpers & Interfaces
C Libraries
HttpParser HiRedis CURL PCRE2
Pluggable Components
![Page 30: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/30.jpg)
Architecture
Web Framework Source
Swift Binary
Dispatch Foundation Package Manager
Swift Libraries
SwiftyJSON SwiftMongoDB
C Helpers & Interfaces
C Libraries
HttpParser HiRedis CURL PCRE2
Pluggable Components
Swift Libraries
Server APIs
![Page 31: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/31.jpg)
Create an ApplicationFirst, create a new project directory
Next, create a new Swift project using the Swift Package Manager.
In Package.swift, add Kitura as a dependency for your project.
![Page 32: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/32.jpg)
Create an ApplicationIn Sources/main.swift, add the following code.
![Page 33: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/33.jpg)
Deploy an Application
Open your browser at http://localhost:8090
Compile and run your application:
![Page 34: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/34.jpg)
Use Services
![Page 35: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/35.jpg)
Deploy to Cloud
$ docker pull ibmcom/kitura-ubuntu:latest $ git clone https://github.com/IBM-Swift/Kitura-Starter-Bluemix
![Page 36: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/36.jpg)
Using Cloud Tools
http://cloudtools.bluemix.net
• Deployment made easy
• Clone, code, push
• Demo projects to try
![Page 37: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/37.jpg)
http://www.kitura.io/en/resources/tutorials.html
Tutorials• Creating a Todo-List Backend• Adding Authentication with Kitura-Credentials• Adding Sessions with Kitura-Session• Using Templating Engines with Kitura• Enabling SSL/TLS on Kitura• Using FastCGI with Kitura• Special Types of Response Handlers• Parsing Requests
![Page 38: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/38.jpg)
Examples
Blitter Social Networkhttps://github.com/ibm-swift/blitter
BluePic Applicationhttps://github.com/ibm-swift/bluepic
![Page 39: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/39.jpg)
Discover Try
Build
IBM Cloud Tools
Package Catalog Swift Sandbox
Kitura + Packages
DeploySwift @ IBM
Swift @ IBM
https://developer.ibm.com/swift/
![Page 40: FrenchKit: End to End Application Development with Swift](https://reader031.fdocuments.in/reader031/viewer/2022030305/5871236b1a28abe4448b5951/html5/thumbnails/40.jpg)
Thank you!
Swift @ IBM