KMP Tutorial #16: Building the Shared Data Layer — Offline-First with Ktor and SQLDelight

In the previous tutorial, we set up the Notes app architecture with a local database and shared ViewModels. Everything works offline. But real apps need to sync with a server. In this tutorial, we build the shared data layer — adding a Ktor API client, Data Transfer Objects (DTOs), an offline-first sync pattern, and a database migration. All of this code lives in commonMain and runs on both Android and iOS. ...

April 6, 2026 · 8 min