How kurikomi-labs/komi-store works
Purpose and targets
Komi Store is a Kotlin Multiplatform Compose client for discovering GitHub-hosted open-source releases, browsing repository details, downloading assets, and installing/managing apps. It targets Android and JVM desktop; platform implementations are separated into androidMain and jvmMain. Build composition is rooted in settings.gradle.kts, build.gradle.kts, and composeApp/build.gradle.kts.
Application bootstrap and navigation
Android starts at composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/MainActivity.kt; desktop starts at composeApp/src/jvmMain/kotlin/zed/rainxch/githubstore/DesktopApp.kt. Shared startup/UI state lives in:
• composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/Main.kt
• composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/MainViewModel.kt
• composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt
Koin is initialized through composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/di/initKoin.kt. Navigation graphs compose feature roots, handle adaptive layouts, deep links, auth callbacks, and desktop keyboard behavior.
Layering and feature modules
The repository uses feature-oriented three-layer modules: data implementations, domain contracts/models, and Compose presentation state/ViewModels. Shared cross-feature abstractions reside in core/domain, shared implementations in core/data, and the design system in core/presentation.
Representative vertical slices:
• Discovery/home: feature/home/data/.../HomeRepositoryImpl.kt, feature/home/presentation/.../HomeViewModel.kt
• Search: feature/search/data/.../SearchRepositoryImpl.kt, feature/search/presentation/.../SearchViewModel.kt
• Repository details/install: feature/details/data/.../DetailsRepositoryImpl.kt, feature/details/presentation/.../DetailsViewModel.kt
• Installed app management/import: feature/apps/data/.../AppsRepositoryImpl.kt, feature/apps/presentation/.../AppsViewModel.kt
UI actions flow Root → ViewModel state/events → domain repository/system interface → data implementation; results are mapped back into feature UI state.
Network, identity, and source boundaries
core/data owns HTTP clients and GitHub/Forgejo/backend integration:
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/GitHubClientProvider.kt
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/BackendApiClient.kt
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/ForgejoClientRegistry.kt
It also applies rate-limit/unauthorized handling, backend fallback, proxy configuration, mirrors, and URL rewriting. Authentication supports GitHub device flow, web auth, and PAT validation via feature/auth/data/src/commonMain/kotlin/zed/rainxch/auth/data/repository/AuthenticationRepositoryImpl.kt. Tokens are represented by shared account models and stored through the data-layer token/secure-storage boundary.
Persistence and offline state
Room provides the principal local database for cached repository data, favourites, hidden/seen/starred repositories, installed apps, search history, fingerprints, and update history:
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/InstalledAppDao.kt
• core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt
DataStore-backed settings and announcement state complement Room. Android database migrations are explicit under core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/.
Release acquisition, verification, and installation
The central release pipeline selects compatible assets from domain metadata, downloads via multiple sources/mirrors, tracks progress, verifies digests/signing information where available, then delegates installation to platform implementations:
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/services/DefaultDownloadOrchestrator.kt
• core/data/src/commonMain/kotlin/zed/rainxch/core/data/download/MultiSourceDownloaderImpl.kt
• feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/system/InstallationManagerImpl.kt
Android integrates package monitoring, WorkManager-style update workers, notifications, root/Shizuku/Dhizuku installation paths; desktop supplies separate downloader, installer, package-monitor, and OS trust implementations. These platform capabilities are exposed behind interfaces in core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/system/.
Runtime, distribution, and external infrastructure
Primary runtime is Kotlin/Compose Multiplatform on Android and JVM desktop. External services include GitHub APIs/releases, Forgejo hosts, configurable mirrors/proxies, a project backend, and translation providers implemented under feature/details/data/.../translation/. Android releases and desktop packaging are automated in .github/workflows/build-desktop-platforms.yml; distribution artifacts include Homebrew, Scoop, WinGet, and Flatpak definitions under dist/ and packaging/flatpak/.
Components 20
App Shell
- Shared app root
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/Main.kt - App state
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/MainViewModel.kt - Navigation graph · Composes feature roots, deep links, auth callbacks, and adaptive behavior.
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt - Dependency injection
composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/di/initKoin.kt
Feature Modules
- Feature screens · Home, search, details, apps, and authentication UI state.
- Feature repositories · Feature-specific repository and installation implementations.
- Authentication · Supports device flow, web auth, and PAT validation.
feature/auth/data/src/commonMain/kotlin/zed/rainxch/auth/data/repository/AuthenticationRepositoryImpl.kt - Installation manager · Verifies releases and delegates installation to each platform.
feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/system/InstallationManagerImpl.kt
Shared Core
- Domain contracts · Repository and platform-system boundaries shared across features.
- Network clients · GitHub, Forgejo, backend, proxy, mirror, and fallback handling.
core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/GitHubClientProvider.kt - Backend API
core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/BackendApiClient.kt - Forgejo registry
core/data/src/commonMain/kotlin/zed/rainxch/core/data/network/ForgejoClientRegistry.kt - Local database · Caches repository state, installed apps, history, and fingerprints.
core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt - Settings state · Stores settings and announcement state.
- Release orchestration · Selects compatible assets and coordinates acquisition.
core/data/src/commonMain/kotlin/zed/rainxch/core/data/services/DefaultDownloadOrchestrator.kt - Multi-source download · Downloads through sources and mirrors with progress tracking.
core/data/src/commonMain/kotlin/zed/rainxch/core/data/download/MultiSourceDownloaderImpl.kt
Platform Runtimes
- Android entry
composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/MainActivity.kt - Desktop entry
composeApp/src/jvmMain/kotlin/zed/rainxch/githubstore/DesktopApp.kt - Platform capabilities · Android package/workers/install paths and desktop installer, monitor, and trust services.
External Services
- Release hosts · GitHub releases, Forgejo hosts, mirrors, proxies, and project backend.
Connections 24
- Android entry → Shared app root: starts
- Desktop entry → Shared app root: starts
- Shared app root → App state: binds
- Shared app root → Navigation graph: hosts
- Navigation graph → Feature screens: routes to
- Dependency injection → App state: provides
- Dependency injection → Feature repositories: wires
- Feature screens → Feature repositories: events and state
- Feature repositories → Domain contracts: implements contracts
- Feature repositories → Network clients: fetches metadata
- Feature repositories → Local database: reads and writes
- Feature repositories → Settings state: uses preferences
- Authentication → Domain contracts: uses account models
- Authentication → Network clients: authenticates via
- Network clients → Backend API: uses
- Network clients → Forgejo registry: uses
- Network clients → Release hosts: calls
- Feature repositories → Release orchestration: requests release
- Release orchestration → Multi-source download: coordinates
- Multi-source download → Release hosts: downloads assets
- Release orchestration → Installation manager: hands off verified asset
- Installation manager → Platform capabilities: installs through
- Platform capabilities → Domain contracts: fulfills system interfaces
- Local database → Platform capabilities: platform database setup