A modern, high-performance Kotlin Multiplatform (KMP) application for exploring space activities, launches, and celestial events. Built with Compose Multiplatform, targeting Android, iOS, and Desktop (JVM).
- Space Launches: Real-time tracking of upcoming and past missions using The Space Devs API.
- Hero Countdown: Dynamic "Next Launch" hero section on the home screen with direct navigation to details.
- Glassmorphic UI: Immersive, modern space-themed design with grid-based navigation and realistic icons.
- Offline First: Full local persistence using Room Database for seamless usage without internet.
- Unified Logic: Shared networking, database, business logic, and UI code across all platforms.
The project is built using a strict Clean Architecture approach combined with Unidirectional Data Flow (UDF).
- Presentation Layer (
shared/presentation):- Compose Multiplatform: Declarative UI shared across Android, iOS, and Desktop.
- ViewModels: Powered by Koin, managing screen state and processing user actions.
- Domain Layer (
shared/domain):- Models: Platform-agnostic data structures.
- Use Cases: Encapsulated business logic (e.g.,
GetLaunchesUseCase). - Repositories (Interfaces): Defines data contracts for the data layer.
- Data Layer (
shared/data):- Remote: Ktor implementation of network requests.
- Local: Room implementation for local storage.
- Mappers: Logic to convert DTOs (API) and Entities (DB) into Domain models.
Each screen uses a consistent state management pattern:
- State: A single
StateFlow(e.g.,LaunchesUiState) that represents the entire UI state. - Actions: A sealed interface (e.g.,
LaunchesAction) for all user interactions. - Flow: UI sends Actions -> ViewModel updates State -> UI observes and re-renders.
| Feature | Library |
|---|---|
| Language | Kotlin (100%) |
| UI Framework | Compose Multiplatform (Material 3) |
| Navigation | Jetpack Compose Navigation (Type-Safe) |
| Dependency Injection | Koin |
| Networking | Ktor (OkHttp for Android/JVM, Darwin for iOS) |
| Local Database | Room (KMP) |
| Image Loading | Coil 3 (KMP) |
| Serialization | Kotlinx Serialization (JSON) |
| Asynchronous | Coroutines & Flow |
The project utilizes the new Type-Safe Navigation for Compose Multiplatform. Screens are defined as @Serializable objects or data classes.
sealed interface Screen {
@Serializable data object Home : Screen
@Serializable data class LaunchDetail(val id: String) : Screen
// ...
}This ensures compile-time safety when navigating between screens and passing arguments.
Koin is used for dependency injection across all platforms, ensuring a clean and testable codebase.
- Modular Design: Separated modules for
Network,Data,UseCase,ViewModel, andPlatform. - Platform Specifics:
PlatformModulehandles platform-specific implementations likeDatabaseBuilderandHttpClientEngine. - Initialization: Centralized
initKoinfunction called fromMainActivity(Android),MainViewController(iOS), andmain.kt(Desktop).
We use Ktor with a robust safeCall wrapper to handle network requests and errors consistently.
- Centralized Config:
HttpClientis configured inNetworkModule.ktwith Content Negotiation and Logging. - Error Handling: Custom
ResultandNetworkErrorclasses to map HTTP errors (401, 404, 500, etc.) to typed domain errors. - Platform Specifics: Injected
HttpClientEnginevia Koin (OkHttpfor Android/JVM,Darwinfor iOS).
Persistence is handled by Room, which is now available for Kotlin Multiplatform.
- Local Source of Truth: The app follows a "Network Bound Resource" pattern where UI always observes the local database.
- DAO Pattern: Clean interfaces for database operations (
LaunchDao,AgencyDao, etc.). - Platform Builders:
DatabaseBuilderusesexpect/actualto handle file paths differently on Android, iOS, and JVM.
├── androidApp # Android application entry point
├── iosApp # iOS Swift project (Xcode)
├── desktopApp # Desktop JVM entry point
├── gradle # Dependency management (libs.versions.toml)
└── shared # Shared KMP module
├── commonMain # Core shared logic (UI, Domain, Data)
│ ├── kotlin # Shared Kotlin code
│ └── composeRes # Shared resources (SVG icons, Strings)
├── androidMain # Android specific DI and platform logic
├── iosMain # iOS specific DI and MainViewController
└── jvmMain # Desktop specific DI and Database configuration
- Android Studio (Latest version recommended)
- Xcode (For iOS target)
- JDK 17+
- Android: Select
androidAppconfiguration and press Run. - Desktop:
- Standard:
./gradlew :desktopApp:run - Hot Reload:
./gradlew :desktopApp:hotRun --auto
- Standard:
- iOS:
- Open
iosApp/iosApp.xcworkspacein Xcode. - Run the app on a simulator or device.
- Open
- ✅ Added realistic space icons in SVG format to common resources.
- ✅ Fixed Ktor engine implementation errors for Desktop.
- ✅ Implemented dynamic Hero section with direct navigation to launch details.
- ✅ Enhanced UI with modern glassmorphism design.
- Data Source: This project uses The Space Devs API for fetching all space-related data. Special thanks to the TSD team for providing such a comprehensive and free API.
Learn more about Kotlin Multiplatform.















