This document discusses using Swift for server-side development with Docker and Kitura. It provides an agenda that covers a WWDC 2016 Swift session on server-side development, discusses common backend frameworks, and demonstrates setting up a Kitura project in a VirtualBox virtual machine and building and running a Docker container for the project. Code examples are provided for initializing a Swift package, defining routes and starting a Kitura server.
4. Agenda
WWDC 2016 - swift session
Server-Side?
Swift backend framework
VirtualBox, Kitura, Docker
myFirstProject
Demo
Summary
4
5. WWDC 2016 - swift session
Swift
What’s New in Swift : https://developer.apple.com/videos/play/wwdc2016/402/
Client-Side
What’s New in Foundation for Swift : https://developer.apple.com/videos/play/wwdc2016/207/
Getting Started with Swift : https://developer.apple.com/videos/play/wwdc2016/404/
Introducing Swift Playgrounds : https://developer.apple.com/videos/play/wwdc2016/408/
Swift API Design Guidelines : https://developer.apple.com/videos/play/wwdc2016/403/
Understanding Swift Performance : https://developer.apple.com/videos/play/wwdc2016/416/
Concurrent Programming With GCD in Swift 3 : https://developer.apple.com/videos/play/
wwdc2016/720/
Using Store Kit for In-App Purchase wit Swift 3 : https://developer.apple.com/videos/play/
wwdc2016/702/
Server-Side
Going Server-side with Swift Open Source : https://developer.apple.com/videos/play/
wwdc2016/415/
Software Engineer
@red
5
6. Server-Side?
Backend Web Framework
Web Framework?
Ajax asynchronous Javascript and XML
MVC framework Model/View/Controller
i18n Internationalization ( ex:date … )
ORM Object Relational Mapping(RDB)
Testing framework Framework JUnit, Cedar…
Security Framework Spring Security(OAuth)
Template Framework Mustache
Caching Framework redis, Ehcache
6
7. Kitura Perfect
Hosted IBM perfect.org
latest version v0.20.0 v1.0.0
started date Feb 9, 2016 Oct 3, 2015
License Apache 2.0 Apache 2.0
MySQL O O
SQLite O O
Redis O O
HTTP URL routing O O
Parmeter Parsing O O
JSON O O
OAuth Kitura-Credentials -
Package/3rdParty Library Many ?
Swift backend framework
Most popular Swift backend framework : Zewo,Vapor…
23. Dev/Prod Environment
Virtual Box VM - Ubuntu
(Swift - backend)
google container registry
Swift - Client
Google Cloud Platform
swift backend
swift backend
swift backend
MySQL
24. 24
==================================
Description : get a number of vote
Request: Verb: GET URL: http://letswift-api:8090/vote
Response: HTTP code: 200
Body:
{
"objective-c": 100,
"swift": 100
}
==================================
Description : Increase a vote
Request: Verb: PUT URL: http://letswift-api:8090/votes/objectivec_voted
Request: Verb: PUT URL: http://letswift-api:8090/votes/swift_voted
Response: HTTP code: 200