NYTimes-KMP
A Kotlin Multiplatform sample of the New York Times app with a shared domain (networking, storage, Molecule view models) driving
- Compose Multiplatform UIs for Android, Desktop (Linux, macOS, Windows), and Web (JS + WasmJs)
- Jetpack Compose for Wear OS, consuming the shared domain and view models
- Dual Compose + SwiftUI experience on iOS
- WPF + WinUI 3 + MAUI on native Windows via kotlin-native-nuget.
To build and run you will need an API key from the New York Times.
Libraries used
- 🧩 Compose Multiplatform; for shared UI
- 🌐 Ktor; for networking
- 📦 Kotlinx Serialization; for content negotiation
- 🕰️ Kotlinx Datetime; for datetime
- 🗃️ KStore; for storage
- 🚏 Decompose + Router; for navigation
- 🧪 Molecule; for modeling state
- 🏞️ Compose-imageloader; for loading images
- 🦅 SKIE; Swift-friendly Kotlin APIs (Flows, etc.) on iOS
- 🪟 kotlin-native-nuget; packages Kotlin/Native (MinGW) as NuGet for WPF + WinUI 3
Run instructions
Run configurations available on .idea/runConfigurations for each platform.
| platform | command |
|---|---|
| android | ./gradlew :app:android:assembleDebug |
| wear | ./gradlew :app:wear:assembleDebug |
| ios | xcodebuild -project app/ios/ios.xcodeproj -scheme NYTimes -configuration Debug |
| desktop | ./gradlew :app:desktop:run |
| js | ./gradlew :app:web:jsBrowserDevelopmentRun |
| wasm | ./gradlew :app:web:wasmJsBrowserDevelopmentRun |
| windows (WPF) | dotnet run --project app\windows\WpfApp\WpfApp.csproj |
| windows (WinUI) | dotnet run --project app\windows\WinUiApp\WinUiApp.csproj |
| windows (MAUI) | dotnet run --project app\windows\MauiApp\MauiApp.csproj |
Showcase
Android
https://github.com/xxfast/NYTimes-KMP/assets/13775137/25adabad-400e-4178-8a14-aaca531c8062
WearOs
https://github.com/xxfast/NYTimes-KMP/assets/13775137/e9ce8ab6-6c08-49a5-b80c-123733bf466c
iOS
https://github.com/xxfast/NYTimes-KMP/assets/13775137/43855864-a4e3-4efb-8047-3e80b0594b02
Desktop
https://github.com/xxfast/NYTimes-KMP/assets/13775137/97da961c-ef9a-40d0-9cee-f322ad8aa6ef
Web (Js & WasmJs)
https://github.com/xxfast/NYTimes-KMP/assets/13775137/eb37d767-d241-4aa8-9083-25a4b9ad3dfa
Windows (WinUI3 + WPF + MAUI)
https://github.com/user-attachments/assets/69d19efd-ab31-496f-bbd8-cd677d82b4a2
