🗡️ Starwars is a Kotlin Multiplatform sample that mirrors the architecture of a production-level app!
Click here to download Starwars
-
Minimum SDK level
- Android 21
- iOS 15
-
Language
-
UI Framework
- Android - Jetpack Compose
- IOS - SwiftUI
-
Architecture
- MVI Architecture (Model - View - Intent)
- Repository Pattern
- Clean Code Architecture (Usecase + mappers)
-
Coroutines + Flow for asynchronous.
-
Ktor: HTTP Client Franework for REST Apis.
-
SKIE: SKIE is a tool for Kotlin Multiplatform development that enhances the Swift API published from Kotlin.
-
KMMBridge: KMMBridge is a set of Gradle tooling that facilitates publishing and consuming pre-built KMM Xcode Framework binaries.
-
Kotlinx.serialization: A modern JSON serialization library for Kotlin.
-
Kermit: Multiplatform centralized logging utility.
-
Paging3: Multiplatform Paging Library
-
Koin : A pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
-
Store : A Kotlin Multiplatform library for building network-resilient applications (Build offline first apps)
-
SqlDelight: Multiplatform SQLite Database (Generates typesafe Kotlin APIs from SQL)
- Planet Listing on HomePage
- Planet Detail Page
- Paging Support in planet listing screen using Paging3
- Loading / Error footer support while paging + retry functionlity in listing (supported in both android & ios)
- Offline first (Load from in-memory cache -> disk -> network) using Store
- Multi module support in android & shared modules
- Better support for suspend + flows + sealed classes using SKIE
- Publish IOS Binary as POD framework using KMMBridge
- Dependency injection using Koin
- Database caching using SqlDelight
- Unit tests for the shared code.
Starwars adopted modularization strategies below:
- Reusability: Modulizing reusable codes properly enable opportunities for code sharing and limits code accessibility in other modules at the same time.
- Parallel Building: Each module can be run in parallel and it reduces the build time.
- Strict visibility control: Modules restrict to expose dedicated components and access to other layers, so it prevents they're being used outside the module
- Decentralized focusing: Each developer team can assign their dedicated module and they can focus on their own modules.
NOTE: The same modularization strategies are used for shared module as well
For more information, check out the Guide to app modularization.
- Step 1: Open termianl inside the root folder of the project
- Step 2: Run the following gradle task:
./gradlew linkPodDebugFrameworkIosX64
(It will create the pod framework for the shared code) - Step 3: Navigate to
iosApp/
folder & run the following command:export LOCAL_KOTLIN_PATH=../shared
- Step 4: Run
pod install
- Step 5: Now open xcode & open
ios.xcworkspace
file insideiosApp/
folder. - Step 6: Run the app in simulator
NOTE: Please make sure you have cocoapods installed.
- Shared resource support using moko-resources
- MultiModule structure in iOS project
Designed and developed by 2024 AshuTyagi16 (Ashu Tyagi)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.