How taratara10/bus_kmp works
Main Components
• Shared Domain & Model Layers:
• “core/domain” and “core/model” modules. These contain the core business logic (use cases like GetBusDepartureTimeUseCase) and data models (e.g., BusRouteName, Timetable, etc.) that are independent of any platform.
• Feature Modules:
• The “feature/clock” module shows how specific app features (such as UI for a clock or timetable display) are implemented, leveraging the shared domain.
• Platform-specific UI/Clients:
• The “app-wasm” module represents the web version, where UI code is written for WASM (with resources such as index.html and styles.css).
• The “app-wearos” module represents the Wear OS application with its Android-specific implementation (including Activities, ViewModels, and resource folders for UI elements).
• The “iosApp” directory represents the iOS application, with configuration files, SwiftUI components (ContentView.swift, iOSApp.swift), and integration with the common Kotlin business logic.
• Build & Configuration Infrastructure:
• “build-logic” provides custom Gradle plugins and DSL (plugins for KMP Android, Wasm, etc.), which shows how the project’s build and dependency management is structured.
• Other configuration files (e.g., gradle.properties, settings.gradle.kts, and .github workflows) help manage continuous integration/deployment.
Relationships and Interactions
• Central Shared Layer:
• Feature Integration:
• Platform-specific UI Layer:
• For each platform (WASM, Wear OS, and iOS), indicate that there is a specific entry point (e.g., a Main.kt for WASM; MainActivity, TimelineViewModel in Wear OS; ContentView and iOSApp.swift for iOS).
• Build and Deployment:
• “build-logic” and CI/CD configuration elements (GitHub Actions under .github/workflows and Gradle build scripts) as supporting infrastructure. Show their role in compiling, packaging, and deploying the application to the web (via the provided URL) and other platforms.
Architectural Patterns and Design Principles
• Separation of Concerns:
• That platform-specific presentation layers are decoupled from the business logic layer (core/domain and core/model). This supports code reusability across multiple targets.
• Modularization:
• Multiplatform Strategy:
• Use of Kotlin Multiplatform design, with commonMain directories shared across platforms (seen in the core and feature modules) and platform-specific extensions in directories such as wasmJsMain (for Web) and iosMain (for iOS, even if only indirectly referenced in the README).