Hands-On Full-Stack Development with Swift

Build full-stack shopping list applications from scratch for web and mobile platforms using Xcode, Vapor, and Swift
Preview in Mapt

Hands-On Full-Stack Development with Swift

Ankur Patel
New Release!

Build full-stack shopping list applications from scratch for web and mobile platforms using Xcode, Vapor, and Swift
Mapt Subscription
FREE
€29.73/m after trial
eBook
€24.99
RRP €35.68
Save 29%
Print + eBook
€37.99
RRP €37.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
€0.00
€24.99
€37.99
€29.74 p/m after trial
RRP €35.68
RRP €37.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Hands-On Full-Stack Development with Swift Book Cover
Hands-On Full-Stack Development with Swift
€ 35.68
€ 24.99
React 16 Tooling Book Cover
React 16 Tooling
€ 41.63
€ 29.15
Buy 2 for €35.42
Save €35.20
Add to Cart

Book Details

ISBN 139781788625241
Paperback356 pages

Book Description

Making Swift an open-source language enabled it to share code between a native app and a server. Building a scalable and secure server backend opens up new possibilities, such as building an entire application written in one language—Swift.

This book gives you a detailed walk-through of tasks such as developing a native shopping list app with Swift and creating a full-stack backend using Vapor (which serves as an API server for the mobile app). You'll also discover how to build a web server to support dynamic web pages in browsers, thereby creating a rich application experience.

You’ll begin by planning and then building a native iOS app using Swift. Then, you'll get to grips with building web pages and creating web views of your native app using Vapor. To put things into perspective, you'll learn how to build an entire full-stack web application and an API server for your native mobile app, followed by learning how to deploy the app to the cloud, and add registration and authentication to it.

Once you get acquainted with creating applications, you'll build a tvOS version of the shopping list app and explore how easy is it to create an app for a different platform with maximum code shareability. Towards the end, you’ll also learn how to create an entire app for different platforms in Swift, thus enhancing your productivity.

Table of Contents

Chapter 1: Getting Started with Server Swift
Modern app development
Swift's evolution
Benefits of server-side Swift
Getting started with Swift package manager
How do the web servers work?
Building a web server in Swift
Server-side web frameworks
Book roadmap
Summary
Chapter 2: Creating the Native App
Features of our Shopping List app
Creating an app
Blueprinting the Shopping List Item model
Controlling the flow of our application using View Controller
Wiring up the view
Adding items to the list
Editing the list
Loading and auto-saving the Shopping List
Multiple lists
Summary
Chapter 3: Getting Started with Vapor
What is Vapor?
Building servers using Vapor's engine
Building a Vapor application from scratch
Vapor toolbox
Vapor folder structure
Summary
Chapter 4: Configuring Providers, Fluent, and Databases
Shopping List API Vapor app
What are Providers?
Getting started with databases
What are ORM and Fluent?
Connecting with MongoDB
Summary
Chapter 5: Building a REST API using Vapor
Routing in Vapor
Vapor Models
Controllers in Vapor
REST API in action
Exercise
Summary
Chapter 6: Consuming API in App
Xcode Workspace
Making network requests
Fetching data from the server
Debugging the app and server side by side
Adding a Shopping List
Deleting a Shopping List
Adding a Shopping List Item
Deleting an item
Checking and unchecking an item
Summary
Chapter 7: Creating Web Views and Middleware
View rendering in Vapor app
Adding Leaf Provider
Serving JSON and HTML formats
Adding JavaScript
Summary
Chapter 8: Testing and CI
Testing the Vapor application
Testing RESTful routes
Exercise
Automated testing pipeline
Summary
Chapter 9: Deploying the App
Where can we deploy a Vapor App?
Deploying to Heroku
Setting up Continuous Deployment
Exercise
Summary
Chapter 10: Adding Authentication
Creating a User model
User has many Shopping Lists
Adding Registration and Login
Showing user specific Shopping Lists
Adding token-based authentication for app
Adding authentication flow to iOS app
Summary
Chapter 11: Building a tvOS App
Shopping List app on tvOS
Sharing code between iOS and tvOS
Configuring the tvOS storyboard
Summary

What You Will Learn

  • Get accustomed to server-side programming as well as the Vapor framework
  • Learn how to build a RESTful API
  • Make network requests from your app and handle error states when a network request fails
  • Deploy your app to Heroku using the CLI command
  • Write a test for the Vapor backend
  • Create a tvOS version of your shopping list app and explore code-sharing with an iOS platform
  • Add registration and authentication so that users can have their own shopping lists

Authors

Table of Contents

Chapter 1: Getting Started with Server Swift
Modern app development
Swift's evolution
Benefits of server-side Swift
Getting started with Swift package manager
How do the web servers work?
Building a web server in Swift
Server-side web frameworks
Book roadmap
Summary
Chapter 2: Creating the Native App
Features of our Shopping List app
Creating an app
Blueprinting the Shopping List Item model
Controlling the flow of our application using View Controller
Wiring up the view
Adding items to the list
Editing the list
Loading and auto-saving the Shopping List
Multiple lists
Summary
Chapter 3: Getting Started with Vapor
What is Vapor?
Building servers using Vapor's engine
Building a Vapor application from scratch
Vapor toolbox
Vapor folder structure
Summary
Chapter 4: Configuring Providers, Fluent, and Databases
Shopping List API Vapor app
What are Providers?
Getting started with databases
What are ORM and Fluent?
Connecting with MongoDB
Summary
Chapter 5: Building a REST API using Vapor
Routing in Vapor
Vapor Models
Controllers in Vapor
REST API in action
Exercise
Summary
Chapter 6: Consuming API in App
Xcode Workspace
Making network requests
Fetching data from the server
Debugging the app and server side by side
Adding a Shopping List
Deleting a Shopping List
Adding a Shopping List Item
Deleting an item
Checking and unchecking an item
Summary
Chapter 7: Creating Web Views and Middleware
View rendering in Vapor app
Adding Leaf Provider
Serving JSON and HTML formats
Adding JavaScript
Summary
Chapter 8: Testing and CI
Testing the Vapor application
Testing RESTful routes
Exercise
Automated testing pipeline
Summary
Chapter 9: Deploying the App
Where can we deploy a Vapor App?
Deploying to Heroku
Setting up Continuous Deployment
Exercise
Summary
Chapter 10: Adding Authentication
Creating a User model
User has many Shopping Lists
Adding Registration and Login
Showing user specific Shopping Lists
Adding token-based authentication for app
Adding authentication flow to iOS app
Summary
Chapter 11: Building a tvOS App
Shopping List app on tvOS
Sharing code between iOS and tvOS
Configuring the tvOS storyboard
Summary

Book Details

ISBN 139781788625241
Paperback356 pages
Read More

Read More Reviews

Recommended for You

React 16 Tooling Book Cover
React 16 Tooling
€ 41.63
€ 29.15
Internet of Things with Raspberry Pi 3 Book Cover
Internet of Things with Raspberry Pi 3
€ 32.11
€ 22.49
Delphi High Performance Book Cover
Delphi High Performance
€ 35.68
€ 24.99
Kubernetes for Developers Book Cover
Kubernetes for Developers
€ 35.68
€ 24.99
Hands-on Full Stack Development with Angular 5 and Firebase Book Cover
Hands-on Full Stack Development with Angular 5 and Firebase
€ 32.11
€ 22.49
Hands-on Application Development with ASP.NET Core and Angular [Video] Book Cover
Hands-on Application Development with ASP.NET Core and Angular [Video]
€ 124.93
€ 24.99