Win $20,000. Help build the future of education. Answer the call. Learn more

Archived | Design a step-tracking app with Kitura and Kubernetes

Archived content

Archive date: 2020-01-17

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


Full-stack development can be tough. When you code in different languages and frameworks, things can get messy. When Swift was open-sourced, many things changed, but the biggest change was that Swift allowed iOS developers to fully code their back end with Swift. Kitura is one of the powerful server-side Swift web frameworks that helps developers concentrate and spend more time in the logic of their application. Kitura can also be deployed in Kubernetes and be exposed on a public domain to act as an iOS app’s back-end infrastructure.


In this pattern, we’ll create an iOS step-tracking app by using Swift. The application’s back end will also be written in Swift with the use of Kitura, a server-side web framework for Swift. This pattern is for iOS developers who want to write both their front end and back end in one language. Working in one language helps developers concentrate and spend more time in the logic of their application, rather than learning or dealing with another programming language. The three simple Kitura microservices will be deployed in Kubernetes, a container-orchestration platform. The sample iOS app is a step tracker that rewards users with “fitcoins.”

When you’ve completed this pattern, you will understand how to:

  • Build a server-side Swift application with Kitura.
  • Use Kitura with Swift Kuery to connect to a database.
  • Deploy Kitura microservices in Kubernetes.
  • Integrate an iOS app with the Kitura back end.
  • Make Kubernetes available under a public domain with TLS.



  1. The first time the iOS app opens, it tries to register through the “Users” microservice.
  2. The “Users” microservice communicates with an external service for its avatar assignment to users.
  3. The “Users” microservice then persists all users’ info in the database. The “Users” microservice also updates the steps of the user and awards “fitcoins.”
  4. The “Leaderboard” microservice provides a way to give standings to the users with their steps count, based on the stored data in the database.
  5. The “Shop” microservice gets the products from the database where users can exchange them with their “fitcoins.” This is also where the APIs (for creating the transactions) update users’ fitcoins.”


Ready to put this pattern to use? Complete details on how to get started running and using this application are in the README.