A beautiful, modern E-Commerce application built with Compose Multiplatform featuring MVI architecture, type-safe navigation, and dynamic theming. Explore products, manage favorites/wishlist, add items to cart, and enjoy a seamless experience across Android, Desktop, and iOS platforms powered by DummyJSON API.
- π± Multiplatform: Android, Desktop, and iOS support with shared business logic and UI
- ποΈ MVI Architecture: Clean, unidirectional data flow (Intent/Event -> ViewModel -> State & Effect)
- π§ Type-Safe Navigation: Kotlin Serialization-based routing with adaptive navigation (Bottom Bar & Navigation Rail)
- π¨ Material 3 Design: Modern UI with dynamic theming and Material You integration
- π Theme Management: Dark / Light / System default modes + Android Dynamic Colors persisted via DataStore
- πΎ Offline Support: Room Multiplatform database with SQLite for persistent favorites and shopping cart
- π Reactive UI: StateFlow and SharedFlow for real-time, responsive UI updates
- ποΈ MultiPreview Support: Comprehensive
@ComponentPreviews,@AllAdaptivePreviews, and@PhonePreviewannotations with customMyThemeWrapper
- π Product Catalog: Browse products with infinite scroll pagination and pull-to-refresh
- π Instant Search & Filters: 350ms debounced live search, horizontal category pill filter, and dynamic sorting by Price (Low/High) & Rating
- π Shopping Cart System: Room DB persisted cart with real-time bottom nav badge, quantity controls, discount calculations, item deletion, and checkout simulation
- π€ User Authentication & Profile: JWT token persistence via DataStore, 1-click demo login (
emilys), detailed user profile view, and logout support - β€οΈ Favorites / Wishlist: Add/remove products from favorites with swipe-to-delete gesture
- π Rich Detailed View: Image carousel, price, discount tags, ratings, stock status, specs, customer reviews, and direct "Add to Cart" action
- β¨ Shimmer Loading: Polished shimmer placeholder animations for smooth loading states
- π Smooth Animations: Animated transitions, bottom sheet modals, and micro-interactions
- π± Adaptive UI: Responsive layouts scaling seamlessly from phones to tablets and desktop screens
- π Swipe Actions: Swipe-to-delete favorites with background reveal
- π Dynamic Colors: Android 12+ Material You dynamic color extraction
- β‘ Performance: Optimized with Coil3 image caching, Room query flows, and lazy composables
- 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.
- Build configuration with BuildConfig (via BuildKonfig):
Create or update your
local.propertiesfile in the project root:(Note: The app is powered by the public DummyJSON API β no external API key is required!)Is_Debug_Build=true
- Android: Run the
androidAppmodule by selecting theapprun configuration in Android Studio. - iOS: Run the
iosAppscheme in Xcode or via Android Studio's Kotlin Multiplatform plugin. - Desktop: Run the Gradle task:
./gradlew :desktopApp:run
π Dark Mode (12 Screens β Click to collapse)
βοΈ Light Mode (12 Screens β Click to expand)
π Dark Mode (12 Screens β Click to collapse)
βοΈ Light Mode (12 Screens β Click to expand)
π Dark Mode (7 Screens β Click to collapse)
01. Products Catalog![]() |
02. Product Details![]() |
03. Shopping Cart Summary![]() |
04. Favorites Wishlist![]() |
05. User Profile![]() |
06. Settings Screen![]() |
07. Theme Selection Dialog![]() |
|
βοΈ Light Mode (7 Screens β Click to expand)
01. Products Catalog![]() |
02. Product Details![]() |
03. Shopping Cart Summary![]() |
04. Favorites Wishlist![]() |
05. User Profile![]() |
06. Settings Screen![]() |
07. Theme Selection Dialog![]() |
|
π Dark Mode (7 Screens β Click to collapse)
01. Products Catalog![]() |
02. Product Details![]() |
03. Shopping Cart Summary![]() |
04. Favorites Wishlist![]() |
05. User Profile![]() |
06. Settings Screen![]() |
07. Theme Selection Dialog![]() |
|
βοΈ Light Mode (7 Screens β Click to expand)
01. Products Catalog![]() |
02. Product Details![]() |
03. Shopping Cart Summary![]() |
04. Favorites Wishlist![]() |
05. User Profile![]() |
06. Settings Screen![]() |
07. Theme Selection Dialog![]() |
|
π± Presentation Layer (UI)
βββ π Compose Screens (Declarative UI)
βββ π§ ViewModels (MVI State & Effect Emitters)
βββ π State Management (StateFlow & SharedFlow)
πΌ Domain Layer (Business Logic)
βββ π Use Cases (Single-responsibility business rules)
βββ πͺ Repository Interfaces (Domain contracts)
βββ π¦ Domain Models (Pure Kotlin entities)
πΎ Data Layer (Data Sources)
βββ π Remote (Ktor + DummyJSON API)
βββ πΏ Local (Room Database + Preferences DataStore)
βββ π Repository Implementation (Data orchestration & mapping)
- π― UI: Compose Multiplatform + Material 3 + Adaptive Layouts
- ποΈ Architecture: MVI (Model-View-Intent) + Clean Architecture + Domain Use Cases
- π§ Navigation: Jetpack Compose Navigation + Type-safe Serialization Routes
- π Networking: Ktor Client (CIO / Darwin / OkHttp) + kotlinx.serialization
- πΎ Database: Room Multiplatform + SQLite Bundled Driver
- π¨ Theming & Preferences: androidx.datastore (Preferences DataStore)
- π§ Dependency Injection: Koin Multiplatform
- πΌοΈ Image Loading: Coil3 (Async Image Loading & Memory Caching)
CMP-MVI-Template/
βββ shared/ # β
KMP library β shared code for all platforms
β βββ build.gradle.kts # β Gradle config (com.android.kotlin.multiplatform.library)
β βββ setting.preferences_pb # π¦ Proto DataStore schema for user settings
β β
β βββ src/
β βββ androidMain/ # π€ Android-specific implementations (Toast, SQLite Driver, Engine)
β βββ iosMain/ # π iOS-specific code (Darwin HTTP Engine, MainViewController)
β βββ desktopMain/ # π₯ Desktop-specific implementations (JVM Engine, Toast)
β β
β βββ commonMain/ # π Shared code between all platforms
β β βββ composeResources/ # π¨ Compose Multiplatform resources (drawables, strings)
β β βββ kotlin/com/example/cmp_mvi_template/
β β βββ app/ # π Root app navigation, AppScaffold, AppViewModel
β β βββ di/ # π§© Dependency Injection modules (AppModule, CoreModule, initKoin)
β β βββ core/ # π Core reusable utilities, domain errors, networking, local DB
β β β βββ data/ # ποΈ Local database, DataStore, Ktor client factory
β β β βββ domain/ # π¦ Base models, ResultWrapper, DataError, Paginator
β β β βββ platform/ # π Expect/actual platform bridges (Database, Toast, DataStore)
β β β βββ utility/ # π§ WindowSize, AppLogger, UiText, StateController
β β βββ ui/ # π§± Reusable UI components, themes, and dialogs
β β β βββ component/ # π§© 15+ Material3 custom components (Buttons, TopAppBar, etc.)
β β β βββ dialog/ # π¬ ToastPopup, LoadingDialog
β β β βββ layout/ # π ErrorMessageLayout
β β β βββ navigation/ # π§ AdaptiveNavigation, BottomNavigationBar, Destinations
β β β βββ theme/ # π¨ Material3 Theme, Dimens, and MultiPreview Annotations
β β βββ feature/ # π Feature modules (Clean Architecture + MVI per feature)
β β βββ product/ # ποΈ Catalog, Search, Categories, Sort, Details, Favorites
β β βββ cart/ # π Room-backed Shopping Cart & Checkout
β β βββ auth/ # π€ User Authentication & Profile (DataStore JWT token)
β β βββ onboarding/ # π First-launch Onboarding Pager
β β βββ splash/ # β³ App Splash Flow & Initial Route Resolution
β β βββ setting/ # βοΈ Theme Selection & Dynamic Colors
β β βββ sample_example/ # π§ͺ Reference MVI feature template
β β
β βββ commonTest/ # π§ͺ Shared unit tests
β
βββ androidApp/ # π€ Android entry point module
β βββ build.gradle.kts # β Gradle config (com.android.application)
β βββ src/main/kotlin/ # π MainActivity & MyApplication (Koin setup)
β
βββ desktopApp/ # π₯ Desktop entry point module
β βββ build.gradle.kts # β Gradle config (Compose Desktop application)
β βββ src/desktopMain/kotlin/ # π» Desktop launcher (main.kt)
β
βββ iosApp/ # π iOS Xcode project entry point
βββ CMP-MVI-Template/
βββ androidApp/
β βββ build.gradle.kts
β βββ src/main/
β βββ AndroidManifest.xml
β βββ kotlin/com/example/cmp_mvi_template/
β βββ MyApplication.kt
β βββ MainActivity.kt
βββ desktopApp/
β βββ build.gradle.kts
β βββ src/desktopMain/kotlin/com/example/cmp_mvi_template/
β βββ main.kt
βββ shared/
β βββ build.gradle.kts
β βββ src/
β βββ androidMain/kotlin/com/example/cmp_mvi_template/core/platform/
β β βββ theme/PlatformTheme.android.kt
β β βββ datastore/createDataStore.android.kt
β β βββ toast/AndroidToastManager.kt
β β βββ http_engine/GetHttpClientEngine.android.kt
β β βββ database/getDatabaseBuilder.android.kt
β βββ commonMain/
β β βββ composeResources/
β β β βββ drawable/
β β β βββ values/strings.xml
β β βββ kotlin/com/example/cmp_mvi_template/
β β βββ app/
β β β βββ presentation/
β β β β βββ App.kt
β β β β βββ AppThemeState.kt
β β β β βββ AppViewModel.kt
β β β βββ di/AppModule.kt
β β βββ di/
β β β βββ initKoin.kt
β β β βββ CoreModule.kt
β β βββ core/
β β β βββ data/
β β β β βββ datastore/
β β β β β βββ ThemeMode.kt
β β β β β βββ ThemePreferences.kt
β β β β β βββ onboarding/OnboardingPreferences.kt
β β β β βββ local/
β β β β β βββ AppDatabase.kt
β β β β β βββ AppDatabaseConstructor.kt
β β β β β βββ dao/
β β β β β βββ ProductDao.kt
β β β β β βββ CartDao.kt
β β β β βββ network/
β β β β βββ HttpClientFactory.kt
β β β β βββ NetworkExtensions.kt
β β β βββ domain/
β β β β βββ DataError.kt
β β β β βββ DataErrorToUiTextExtension.kt
β β β β βββ Error.kt
β β β β βββ Paginator.kt
β β β β βββ ResultWrapper.kt
β β β βββ platform/
β β β β βββ database/getDatabaseBuilder.kt
β β β β βββ datastore/AppSettings.kt
β β β β βββ datastore/createDataStore.kt
β β β β βββ http_engine/GetHttpClientEngine.kt
β β β β βββ theme/PlatformTheme.kt
β β β β βββ toast/
β β β β βββ ToastDuration.kt
β β β β βββ ToastManager.kt
β β β β βββ ToastManagerFactory.kt
β β β βββ utility/
β β β βββ AppLogger.kt
β β β βββ ComposableExtensions.kt
β β β βββ IconResource.kt
β β β βββ StateController.kt
β β β βββ UiText.kt
β β β βββ WindowSize.kt
β β βββ ui/
β β β βββ component/
β β β β βββ badges/Badges.kt
β β β β βββ bottom_app_bar/BottomAppBar.kt
β β β β βββ button/Button.kt
β β β β βββ checkbox/Checkbox.kt
β β β β βββ divider/Divider.kt
β β β β βββ fab/Fab.kt
β β β β βββ icon_button/IconButton.kt
β β β β βββ navigation_bar/NavigationBar.kt
β β β β βββ progress_indicator/ProgressIndicators.kt
β β β β βββ radio_button/RadioButton.kt
β β β β βββ segmented_button/SegmentedButton.kt
β β β β βββ slider/Slider.kt
β β β β βββ switch_custom/Switch.kt
β β β β βββ text/Text.kt
β β β β βββ top_app_bar/TopAppBar.kt
β β β βββ dialog/
β β β β βββ LoadingDialog.kt
β β β β βββ ToastPopup.kt
β β β βββ layout/ErrorMessageLayout.kt
β β β βββ navigation/
β β β β βββ AdaptiveNavigation.kt
β β β β βββ AppDestination.kt
β β β β βββ NavigationExtensions.kt
β β β β βββ bottom_navigation_bar/
β β β β βββ BottomNavigationBar.kt
β β β β βββ NavigationItem.kt
β β β βββ theme/
β β β βββ AnnotationPreview.kt
β β β βββ Color.kt
β β β βββ Dimens.kt
β β β βββ Theme.kt
β β β βββ Type.kt
β β βββ feature/
β β βββ product/
β β β βββ di/ProductModule.kt
β β β βββ data/
β β β β βββ mapper/toDomain.kt
β β β β βββ remote/
β β β β β βββ api/
β β β β β β βββ ProductApiService.kt
β β β β β β βββ ProductApiServiceImpl.kt
β β β β β βββ dto/ProductDto.kt
β β β β βββ repository/ProductRepositoryImpl.kt
β β β βββ domain/
β β β β βββ entity/
β β β β β βββ Product.kt
β β β β β βββ ProductEntity.kt
β β β β βββ repository/ProductRepository.kt
β β β β βββ usecase/
β β β β βββ CheckIfProductFavoriteUseCase.kt
β β β β βββ GetCategoriesUseCase.kt
β β β β βββ GetFavoriteProductsUseCase.kt
β β β β βββ GetProductDetailsUseCase.kt
β β β β βββ GetProductListUseCase.kt
β β β β βββ ToggleFavoriteProductUseCase.kt
β β β βββ presentation/
β β β βββ component/
β β β β βββ ProductCard.kt
β β β β βββ ShimmerEffect.kt
β β β βββ product_list/
β β β β βββ component/
β β β β β βββ CategoryChipsRow.kt
β β β β β βββ ProductListContent.kt
β β β β β βββ SortBottomSheet.kt
β β β β βββ screen/
β β β β βββ ProductListEffect.kt
β β β β βββ ProductListEvent.kt
β β β β βββ ProductListScreen.kt
β β β β βββ ProductListState.kt
β β β β βββ ProductListViewModel.kt
β β β βββ product_details/
β β β β βββ component/
β β β β β βββ ProductDetailsContent.kt
β β β β β βββ ProductImageCarousel.kt
β β β β β βββ ProductInfoSection.kt
β β β β β βββ ProductReviewsSection.kt
β β β β β βββ ProductSpecsSection.kt
β β β β βββ screen/
β β β β βββ ProductDetailsEffect.kt
β β β β βββ ProductDetailsEvent.kt
β β β β βββ ProductDetailsScreen.kt
β β β β βββ ProductDetailsState.kt
β β β β βββ ProductDetailsViewModel.kt
β β β βββ favorites/
β β β βββ component/
β β β β βββ EmptyFavoritesScreen.kt
β β β β βββ FavoritesListContent.kt
β β β β βββ SwipeToDeleteProductCard.kt
β β β βββ screen/
β β β βββ FavoritesEffect.kt
β β β βββ FavoritesEvent.kt
β β β βββ FavoritesScreen.kt
β β β βββ FavoritesState.kt
β β β βββ FavoritesViewModel.kt
β β βββ cart/
β β β βββ di/CartModule.kt
β β β βββ data/
β β β β βββ mapper/toDomain.kt
β β β β βββ repository/CartRepositoryImpl.kt
β β β βββ domain/
β β β β βββ entity/
β β β β β βββ CartItem.kt
β β β β β βββ CartItemEntity.kt
β β β β βββ repository/CartRepository.kt
β β β β βββ usecase/
β β β β βββ AddToCartUseCase.kt
β β β β βββ ClearCartUseCase.kt
β β β β βββ GetCartCountUseCase.kt
β β β β βββ GetCartItemsUseCase.kt
β β β β βββ RemoveFromCartUseCase.kt
β β β β βββ UpdateCartQuantityUseCase.kt
β β β βββ presentation/
β β β βββ component/
β β β β βββ CartItemCard.kt
β β β β βββ CartSummaryCard.kt
β β β β βββ CheckoutSuccessDialog.kt
β β β β βββ EmptyCartScreen.kt
β β β βββ screen/
β β β βββ CartEffect.kt
β β β βββ CartEvent.kt
β β β βββ CartScreen.kt
β β β βββ CartState.kt
β β β βββ CartViewModel.kt
β β βββ auth/
β β β βββ di/AuthModule.kt
β β β βββ data/
β β β β βββ datastore/AuthPreferences.kt
β β β β βββ mapper/toDomain.kt
β β β β βββ remote/
β β β β β βββ api/
β β β β β β βββ AuthApiService.kt
β β β β β β βββ AuthApiServiceImpl.kt
β β β β β βββ dto/AuthDto.kt
β β β β βββ repository/AuthRepositoryImpl.kt
β β β βββ domain/
β β β β βββ entity/AuthUser.kt
β β β β βββ repository/AuthRepository.kt
β β β β βββ usecase/
β β β β βββ GetAuthStateUseCase.kt
β β β β βββ LoginUseCase.kt
β β β β βββ LogoutUseCase.kt
β β β βββ presentation/screen/
β β β βββ AuthEffect.kt
β β β βββ AuthEvent.kt
β β β βββ AuthState.kt
β β β βββ AuthViewModel.kt
β β β βββ ProfileScreen.kt
β β βββ onboarding/
β β β βββ di/OnboardingModule.kt
β β β βββ presentation/
β β β βββ model/OnboardingPage.kt
β β β βββ component/
β β β β βββ OnboardingPageContent.kt
β β β β βββ OnboardingPageIndicator.kt
β β β βββ screen/
β β β βββ OnboardingEffect.kt
β β β βββ OnboardingEvent.kt
β β β βββ OnboardingScreen.kt
β β β βββ OnboardingState.kt
β β β βββ OnboardingViewModel.kt
β β βββ splash/
β β β βββ di/SplashModule.kt
β β β βββ presentation/screen/
β β β βββ SplashEffect.kt
β β β βββ SplashScreen.kt
β β β βββ SplashViewModel.kt
β β βββ setting/
β β β βββ di/SettingModule.kt
β β β βββ presentation/
β β β βββ component/
β β β β βββ DynamicThemeToggleAndroidOnly.kt
β β β β βββ ThemePreview.kt
β β β β βββ ThemeSelectionDialog.kt
β β β β βββ ThemeSelectionRow.kt
β β β βββ screen/
β β β βββ SettingEffect.kt
β β β βββ SettingEvent.kt
β β β βββ SettingScreen.kt
β β β βββ SettingState.kt
β β β βββ SettingViewModel.kt
β β βββ sample_example/
β β βββ di/SampleExampleModule.kt
β β βββ presentation/screen/
β β βββ SampleEffect.kt
β β βββ SampleEvent.kt
β β βββ SampleExampleScreen.kt
β β βββ SampleExampleViewModel.kt
β β βββ SampleState.kt
β βββ desktopMain/kotlin/com/example/cmp_mvi_template/core/platform/
β β βββ database/getDatabaseBuilder.desktop.kt
β β βββ datastore/createDataStore.desktop.kt
β β βββ http_engine/GetHttpClientEngine.desktop.kt
β β βββ theme/PlatformTheme.desktop.kt
β β βββ toast/
β β βββ DesktopToastManager.kt
β β βββ RoundedPanel.kt
β β βββ ToastManager.desktop.kt
β βββ iosMain/kotlin/com/example/cmp_mvi_template/
β β βββ MainViewController.kt
β β βββ core/platform/
β β βββ database/getDatabaseBuilder.ios.kt
β β βββ datastore/createDataStore.ios.kt
β β βββ http_engine/GetHttpClientEngine.ios.kt
β β βββ theme/PlatformTheme.ios.kt
β β βββ toast/
β β βββ IosToastManager.kt
β β βββ ToastManager.ios.kt
β βββ commonTest/kotlin/com/example/cmp_mvi_template/
β βββ ComposeAppCommonTest.kt
Here are upcoming feature enhancements and engineering improvements planned for the project:
-
π·οΈ Koin Annotations Integration
- Integrate Koin Annotations processing (
@Single,@Factory) to reduce manual DI module boilerplate.
- Integrate Koin Annotations processing (
-
π³ Payment & Checkout Gateway
- Integrate simulated/live payment flows (Stripe / Mock Gateway) into the checkout experience.
-
π Push Notifications
- Multiplatform push notifications for order updates and flash sale alerts.
-
βοΈ Dev Tooling & Automation Scripts
- Create Gradle scripts for automatic feature module scaffolding (generating MVI contracts, ViewModel, and screen templates).
- Package renaming automation scripts.
-
π§ͺ Unit & UI Flow Testing
- Comprehensive unit testing for UseCases, ViewModels, and Room DAOs.
- Integration with Maestro for end-to-end multiplatform UI flow tests.
Feel free to contribute to this project by submitting issues, feature suggestions, or pull requests. Your contributions are always welcome! π
Give a βοΈ if this project helped you!
Your generosity is greatly appreciated! Thank you for supporting this project.
Meet











































































