How myofficework000/jetmvi-template works
Project type and purpose
• This is a native Android application (“GitHubCompose”) built as a production-grade reference app to showcase Jetpack Compose, MVI, Clean Architecture, Coroutine/Flow, Koin DI, Retrofit networking, Coil image loading, and TDD.
• It follows a single-activity MVI pattern with clearly separated View, Presentation (ViewModel), and Model (Repository) layers.
File structure
• Top-level “app” module contains everything Android: source, resources, manifest, Gradle config.
• Under app/src/main/java/com/…/githubcompose/ you find packages:
• data – Retrofit API interface, endpoints constants, repository interface & implementation, data models
• di – Koin modules (AppModule, RepositoryModule, ViewModelModule)
• ui – Composable screens grouped by feature (users, repos, main), base classes, common widgets, theme, navigation
• common – extensions and utility classes
• Tests mirror the same packages under app/src/test and androidTest.
• buildSrc holds centralized versions and dependencies.
README for additional insights
• Confirms MVI: each screen defines a State, Events, Effects contract.
• Single-activity navigation via Jetpack Navigation component.
• Uses Kotlin coroutines & Flow for async, Koin for DI, Retrofit for networking.
Main system components and their relationships
a. Components
• Android Host: GithubApplication + MainActivity + NavController
• UI Layer: Composable screens (UsersScreen, ReposScreen, etc.)
• Presentation Layer: Screen-scoped ViewModels managing State, receiving Events, emitting Effects
• Domain/Data Layer: GithubRepository interface and GithubRepositoryImpl
• Networking: Retrofit service (GithubApi), Endpoints
• Dependency Injection: Koin modules wiring ViewModels → Repositories → API
• External Service: GitHub REST API
• Utilities: Coil loader, Intent extensions, themes
b. Interactions/data flow
1. User interaction in a Composable UI emits an Event
2. Event is sent into its ViewModel’s Event Flow
3. ViewModel updates State (StateFlow / Compose MutableState) and/or triggers Effects (ChannelFlow)
4. On data requests, ViewModel calls a method on GithubRepository
5. GithubRepositoryImpl uses GithubApi (Retrofit) to fetch JSON, maps to domain models, returns Flow
6. ViewModel collects the Flow, updates State → UI
c. Architectural patterns
• Unidirectional data flow (MVI)
• Single‐Activity Navigation
• Clean Architecture layering: UI → ViewModel → Repository → RemoteDataSource
• DI inversion via Koin
d. Key technologies/frameworks
• Jetpack Compose, Navigation, ViewModel
• Kotlin Coroutines & Flow
• Retrofit + OkHttp
• Coil (image loading)
• Koin (DI)
• JUnit + MockWebServer for TDD