A beautiful, modern Pokemon application built with Compose Multiplatform featuring MVI architecture, type-safe navigation, and dynamic theming. Explore Pokemon, manage favorites, and enjoy a seamless experience across Android, Desktop, and iOS platforms.
π― Core Features
- π± Multiplatform: Android, Desktop, and iOS support
- ποΈ MVI Architecture: Clean, predictable state management
- π§ Type-Safe Navigation: Kotlin Serialization-based routing
- π¨ Material 3 Design: Modern UI with dynamic theming
- π Theme Management: Dark mode + Android Dynamic Colors
- πΎ Offline Support: Room database for favorites
- π Reactive UI: Real-time updates with StateFlow
πΎ Pokemon Features
- π Pokemon List: Browse all Pokemon with infinite scrolling
- β€οΈ Favorites Management: Add/remove Pokemon from favorites
- π Detailed View: Stats, abilities, types, and more
- π¨ Type-based Theming: Colors based on Pokemon types
- β¨ Shimmer Loading: Beautiful loading animations
π UI/UX Features
- π Smooth Animations: Page transitions and micro-interactions
- π± Adaptive UI: Responsive design for all screen sizes
- π Swipe Actions: Swipe-to-delete favorites
- π Dynamic Colors: Android 12+ Material You support
- β‘ Performance: Optimized with lazy loading and caching
- Clone this repository:
git clone https://github.com/Coding-Meet/CMP-MVI-Template.git
- Open in the latest version of Android Studio or intellij idea.
- For Android, run the
composeApp
module by selecting theapp
configuration. If you need help with the configuration, follow this link for android - For iOS, run the
composeApp
module by selecting theiosApp
configuration. If you need help with the configuration, follow this link for Ios - For Desktop, run
./gradlew :composeApp:run
- For Desktop with hot reload, run
./gradlew desktopRun -DmainClass=com.example.cmp_mvi_template.MainKt
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
π± Presentation Layer (UI)
βββ π Compose Screens
βββ π§ ViewModels (MVI)
βββ π State Management
πΌ Domain Layer (Business Logic)
βββ π Use Cases
βββ πͺ Repository Interfaces
βββ π¦ Domain Models
πΎ Data Layer (Data Sources)
βββ π Remote (Ktor + PokΓ©API)
βββ πΏ Local (Room Database)
βββ π Repository Implementation
- π― UI: Compose Multiplatform + Material 3
- ποΈ Architecture: MVI + Clean Architecture + Use Cases
- π§ Navigation: Compose Navigation + Type-safe routes
- π Networking: Ktor Client + JSON Serialization
- πΎ Database: Room + SQLite (multiplatform)
- π¨ Theming: DataStore Preferences + Dynamic Colors
- π§ Dependency Injection: Koin
- πΌοΈ Images: Coil3 (async image loading)
CMP-MVI-Template/
βββ composeApp/ # β
Main Compose Multiplatform app module
β βββ build.gradle.kts # β Gradle config for this module
β βββ setting.preferences_pb # π¦ Proto DataStore schema for user settings (theme, etc.)
β
β βββ src/
β βββ androidMain/ # π€ Android-specific code
β β βββ AndroidManifest.xml # π Manifest file for Android
β β βββ kotlin/
β β βββ com/example/cmp_mvi_template/
β β βββ MainActivity.kt # π Entry point for Android app
β β βββ MyApplication.kt # π Application class for Koin setup
β β βββ core/platform/ # π Android actual implementations for platform interfaces
β
β βββ iosMain/ # π iOS-specific code (uses Kotlin/Native)
β β βββ kotlin/
β β βββ com/example/cmp_mvi_template/
β β βββ MainViewController.kt # π§ iOS screen entry point (UIKit)
β β βββ core/platform/ # π iOS actual implementations for platform interfaces
β
β βββ desktopMain/ # π₯ Desktop-specific entry point
β β βββ kotlin/
β β βββ com/example/cmp_mvi_template/
β β βββ main.kt # π» Desktop launcher with ComposeWindow
β
β βββ commonMain/ # π Shared code between all platforms
β β βββ composeResources/ # π¨ Compose Multiplatform resources (fonts, strings, etc.)
β β βββ kotlin/
β β βββ com/example/cmp_mvi_template/
β β
β β βββ di/ # π§© Dependency Injection modules using Koin
β β β βββ AppModule.kt
β β β βββ PlatformModule.kt
β β
β β βββ app/ # π App-level shared state (theme, scaffold, etc.)
β β β βββ AppViewModel.kt
β β β βββ AppScaffold.kt
β β
β β βββ core/ # π Core layer for base domain, utils, and data sources
β β β βββ utility/ # π§ Utility helpers (formatters, validators, etc.)
β β β βββ domain/ # π¦ Base models like pagination, error handling
β β β βββ data/ # ποΈ Base local + remote source contracts or shared logic
β β β βββ platform/ # π Expect interfaces for platform-specific functionality
β β
β β βββ ui/ # π§± Reusable UI components
β β β βββ Button/
β β β βββ Dialog/
β β β βββ Layout/
β β β βββ Theme/ # π¨ Theme definitions (Typography, Colors, Dimens)
β β
β β βββ feature/ # π Feature modules β each screen or flow has its own folder
β β βββ pokemon/ # π± Pokemon feature (MVI pattern)
β β β βββ domain/ # π Business logic interfaces & models
β β β βββ data/ # πΎ Repository, fake/local/remote data
β β β βββ presentation/ # π UI state, event, screen, and ViewModel
β β β βββ di/ # π§© Feature-specific DI
β β
β β βββ setting/ # βοΈ App settings (e.g., theme selection)
β β β βββ presentation/ # π UI state + screen for settings
β β
β β βββ sample_example/ # π§ͺ Optional example/template feature
β β βββ presentation/
β β βββ domain/
β βββ commonTest/ # π§ͺ Shared unit tests
β β βββ com/example/cmp_mvi_template/
β β βββ ComposeAppCommonTest.kt # β
Sample shared test
βββ CMP-MVI-Template/
βββ composeApp/
β βββ setting.preferences_pb
β βββ build.gradle.kts
β βββ src/
β βββ androidMain/
β β βββ AndroidManifest.xml
β β βββ res/
β β β βββ values/
β β β βββ strings.xml
β β β
β β βββ kotlin/
β β βββ com/
β β βββ example/
β β βββ cmp_mvi_template/
β β βββ MyApplication.kt
β β βββ MainActivity.kt
β β βββ core/
β β βββ platform/
β β βββ theme/
β β β βββ PlatformTheme.android.kt
β β βββ datastore/
β β β βββ createDataStore.android.kt
β β βββ toast/
β β β βββ AndroidToastManager.kt
β β β βββ ToastManager.android.kt
β β βββ http_engine/
β β β βββ GetHttpClientEngine.android.kt
β β βββ database/
β β βββ getDatabaseBuilder.android.kt
β βββ commonMain/
β β βββ composeResources/
β β β βββ values/
β β β β βββ strings.xml
β β β βββ drawable/
β β β βββ compose-multiplatform.xml
β β βββ kotlin/
β β βββ com/
β β βββ example/
β β βββ cmp_mvi_template/
β β βββ di/
β β β βββ initKoin.kt
β β β βββ CoreModule.kt
β β βββ app/
β β β βββ presentation/
β β β β βββ App.kt
β β β β βββ AppThemeState.kt
β β β β βββ AppViewModel.kt
β β β βββ di/
β β β βββ AppModule.kt
β β βββ core/
β β β βββ utility/
β β β β βββ ComposableExtensions.kt
β β β β βββ UiText.kt
β β β β βββ IconResource.kt
β β β β βββ AppLogger.kt
β β β β βββ StateController.kt
β β β βββ domain/
β β β β βββ DataErrorToUiTextExtension.kt
β β β β βββ Paginator.kt
β β β β βββ DataError.kt
β β β β βββ Error.kt
β β β β βββ ResultWrapper.kt
β β β βββ data/
β β β β βββ datastore/
β β β β β βββ ThemeMode.kt
β β β β β βββ ThemePreferences.kt
β β β β βββ local/
β β β β β βββ PokemonDatabase.kt
β β β β β βββ PokemonDatabaseConstructor.kt
β β β β β βββ dao/
β β β β β βββ PokemonDao.kt
β β β β βββ network/
β β β β βββ NetworkExtensions.kt
β β β β βββ HttpClientFactory.kt
β β β βββ platform/
β β β βββ theme/
β β β β βββ PlatformTheme.kt
β β β βββ datastore/
β β β β βββ createDataStore.kt
β β β β βββ AppSettings.kt
β β β βββ toast/
β β β β βββ ToastManager.kt
β β β β βββ ToastManagerFactory.kt
β β β β βββ ToastDuration.kt
β β β βββ http_engine/
β β β β βββ GetHttpClientEngine.kt
β β β βββ database/
β β β βββ getDatabaseBuilder.kt
β β βββ ui/
β β β βββ theme/
β β β β βββ AnnotationPreview.kt
β β β β βββ Color.kt
β β β β βββ Theme.kt
β β β β βββ Type.kt
β β β βββ dialog/
β β β β βββ ToastPopup.kt
β β β β βββ LoadingDialog.kt
β β β βββ navigation/
β β β β βββ AppDestination.kt
β β β β βββ AdaptiveNavigation.kt
β β β β βββ NavigationExtensions.kt
β β β β βββ bottom_navigation_bar/
β β β β βββ NavigationItem.kt
β β β β βββ BottomNavigationBar.kt
β β β βββ layout/
β β β β βββ ErrorMessageLayout.kt
β β β βββ component/
β β β βββ badges/
β β β β βββ Badges.kt
β β β βββ text/
β β β β βββ Text.kt
β β β βββ radio_button/
β β β β βββ RadioButton.kt
β β β βββ divider/
β β β β βββ Divider.kt
β β β βββ navigation_bar/
β β β β βββ NavigationBar.kt
β β β βββ progress_indicator/
β β β β βββ ProgressIndicators.kt
β β β βββ button/
β β β β βββ Button.kt
β β β βββ switch_custom/
β β β β βββ Switch.kt
β β β βββ slider/
β β β β βββ Slider.kt
β β β βββ icon_button/
β β β β βββ IconButton.kt
β β β βββ checkbox/
β β β β βββ Checkbox.kt
β β β βββ fab/
β β β β βββ Fab.kt
β β β βββ segmented_button/
β β β β βββ SegmentedButton.kt
β β β βββ bottom_app_bar/
β β β β βββ BottomAppBar.kt
β β β βββ top_app_bar/
β β β βββ TopAppBar.kt
β β βββ feature/
β β βββ setting/
β β β βββ di/
β β β β βββ SettingModule.kt
β β β βββ presentation/
β β β βββ screen/
β β β β βββ SettingScreen.kt
β β β β βββ SettingEvent.kt
β β β β βββ SettingState.kt
β β β β βββ SettingViewModel.kt
β β β β βββ SettingEffect.kt
β β β βββ component/
β β β βββ DynamicThemeToggleAndroidOnly.kt
β β β βββ ThemeSelectionRow.kt
β β β βββ ThemeSelectionDialog.kt
β β β βββ ThemePreview.kt
β β βββ pokemon/
β β β βββ di/
β β β β βββ PokemonModule.kt
β β β βββ presentation/
β β β β βββ component/
β β β β β βββ PokemonCard.kt
β β β β β βββ ShimmerEffect.kt
β β β β βββ pokemon_details/
β β β β β βββ screen/
β β β β β β βββ PokemonDetailsViewModel.kt
β β β β β β βββ PokemonDetailsEvent.kt
β β β β β β βββ PokemonDetailsScreen.kt
β β β β β β βββ PokemonDetailsEffect.kt
β β β β β β βββ PokemonDetailsState.kt
β β β β β βββ component/
β β β β β βββ PokemonAbilitiesSection.kt
β β β β β βββ PokemonDetailsContent.kt
β β β β β βββ PokemonStatsSection.kt
β β β β β βββ PokemonBasicInfoSection.kt
β β β β β βββ PokemonImageSection.kt
β β β β βββ pokemon_list/
β β β β β βββ screen/
β β β β β βββ PokemonListEvent.kt
β β β β β βββ PokemonListViewModel.kt
β β β β β βββ PokemonListScreen.kt
β β β β β βββ PokemonListEffect.kt
β β β β β βββ PokemonListState.kt
β β β β βββ favorites/
β β β β βββ screen/
β β β β β βββ FavoritesState.kt
β β β β β βββ FavoritesScreen.kt
β β β β β βββ FavoritesEffect.kt
β β β β β βββ FavoritesEvent.kt
β β β β β βββ FavoritesViewModel.kt
β β β β βββ component/
β β β β βββ SwipeToDeletePokemonCard.kt
β β β β βββ FavoritesListContent.kt
β β β β βββ EmptyFavoritesScreen.kt
β β β βββ domain/
β β β β βββ usecase/
β β β β β βββ GetFavoritesPokemonUseCase.kt
β β β β β βββ GetPokemonDetailsUseCase.kt
β β β β β βββ CheckIfFavoriteUseCase.kt
β β β β β βββ GetPokemonListUseCase.kt
β β β β β βββ ToggleFavoriteUseCase.kt
β β β β βββ entity/
β β β β β βββ PokemonEntity.kt
β β β β β βββ Pokemon.kt
β β β β βββ repository/
β β β β βββ PokemonRepository.kt
β β β βββ data/
β β β βββ mapper/
β β β β βββ toDomain.kt
β β β βββ repository/
β β β β βββ PokemonRepositoryImpl.kt
β β β βββ remote/
β β β βββ api/
β β β β βββ PokemonApiServiceImpl.kt
β β β β βββ PokemonApiService.kt
β β β βββ dto/
β β β βββ PokemonListResponseDto.kt
β β βββ sample_example/
β β βββ di/
β β β βββ SampleExampleModule.kt
β β βββ presentation/
β β βββ screen/
β β βββ SampleEffect.kt
β β βββ SampleExampleScreen.kt
β β βββ SampleEvent.kt
β β βββ SampleState.kt
β β βββ SampleExampleViewModel.kt
β βββ desktopMain/
β β βββ kotlin/
β β βββ com/
β β βββ example/
β β βββ .DS_Store
β β βββ cmp_mvi_template/
β β βββ .DS_Store
β β βββ main.kt
β β βββ core/
β β βββ platform/
β β βββ theme/
β β β βββ PlatformTheme.desktop.kt
β β βββ datastore/
β β β βββ createDataStore.desktop.kt
β β βββ toast/
β β β βββ RoundedPanel.kt
β β β βββ ToastManager.desktop.kt
β β β βββ DesktopToastManager.kt
β β βββ http_engine/
β β β βββ GetHttpClientEngine.desktop.kt
β β βββ database/
β β βββ getDatabaseBuilder.desktop.kt
β βββ commonTest/
β β βββ kotlin/
β β βββ com/
β β βββ example/
β β βββ cmp_mvi_template/
β β βββ ComposeAppCommonTest.kt
β βββ iosMain/
β βββ kotlin/
β βββ com/
β βββ example/
β βββ cmp_mvi_template/
β βββ MainViewController.kt
β βββ core/
β βββ platform/
β βββ theme/
β β βββ PlatformTheme.ios.kt
β βββ datastore/
β β βββ createDataStore.ios.kt
β βββ toast/
β β βββ ToastManager.ios.kt
β β βββ IosToastManager.kt
β βββ http_engine/
β β βββ GetHttpClientEngine.ios.kt
β βββ database/
β βββ getDatabaseBuilder.ios.kt
Here are the upcoming tasks and feature enhancements planned for the project:
-
Koin Annotations Integration
- Use Koin Annotation processing (@Single, @Factory, etc.) to simplify and reduce boilerplate for dependency injection.
-
π GraphQL Support for PokΓ©mon API
- Implement a GraphQL version of the PokΓ©mon API using Ktor Client. Will be explored in a separate branch for experimentation.
-
ποΈ SQLDelight Sample Integration
- Integrate SQLDelight only as a working code sample in a separate module/branch.
- Purpose: Keep reusable code ready for future use or cross-platform Kotlin projects.
- β Room will continue as the primary local storage solution for this app.
-
βοΈ Dev Tooling Scripts (Automation)
- Build Gradle or Kotlin-based scripts for:
- π Renaming package names along with folder structure
- π¦ Creating distributable builds per platform
- π Auto-generating feature modules with basic files (UI, ViewModel, State, Events) by providing just a feature name
- Build Gradle or Kotlin-based scripts for:
-
π§© Component Showcase Screen
- All UI components are implemented but not visible inside the app.
- A new Component Explorer Screen will be added where:
- You can view all components (buttons, cards, inputs, etc.)
- Helpful for testing and design consistency on a real device
-
π§ͺ Unit & Instrumented Testing
- Add unit tests for core business logic and ViewModels
- Add instrumented UI tests for critical user flows
- Integrate test coverage tools for quality tracking
-
π± Maestro Integration (UI Flow Testing)
- Set up Maestro to define UI flow test scripts
Feel free to contribute to this project by submitting issues, pull requests, or providing valuable feedback. Your contributions are always welcome! π
Give a βοΈ if this project helped you!
Your generosity is greatly appreciated! Thank you for supporting this project.
Meet