How mbakgun/midjourney-images-compose-multiplatform works
Project Type and Core Architecture
This is a Kotlin Multiplatform Mobile (KMM) project using Compose Multiplatform to create a cross-platform image viewing application that runs on multiple platforms (Android, iOS, Web, Wear OS, Android Automotive, Android TV, and Desktop).
Main Components
A. Platform-Specific Apps Layer (Top Level):
• To the shared module
B. Shared Module Layer (Middle Level):
Create distinct sections for:
UI Layer
• MjImagesApp (Composable)
• MjImagesViewModel
• Theme components
Domain Layer
• UseCases (MjImagesUseCase, MjImagesFetchUseCase)
• Models (MjImage, MjImages)
• Mappers (MjImagesMapper)
Data Layer
• Repository (MjImagesRepository)
• Data Sources (Remote/Local)
• API Services (KtorApi, MjImagesService)
C. External Dependencies Layer (Bottom Level):
• Ktor for networking
• Koin for dependency injection
• Kotlinx Serialization
• Coil for image loading
• Multiplatform Settings
┌─────────────────── Platform Apps ───────────────────┐
• ┌─────┐ ┌────┐ ┌───────┐ ┌────┐ ┌────┐ ┌───────┐ │
• Android│ │iOS │ │Desktop│ │Web │ │Wear│ │TV/Auto│ │
• ┬─┘ └──┬─┘ └───┬───┘ └──┬─┘ └──┬─┘ └───┬───┘ │
• ┼──────┼───────┼────────┼─────┼───────┼──────┘
┌──────┼──────┼───────┼────────┼─────┼───────┼──────┐
• Shared Module (Common Code Implementation) │
• ┌─────────────────────────────────────┐ │
• UI Layer │ │
• MjImagesApp │ │
• MjImagesViewModel │ │
• ┘ │
• ┌─────────────────────────────────────┐ │
• Domain Layer │ │
• UseCases │ │
• Models │ │
• Mappers │ │
• ┘ │
• ┌─────────────────────────────────────┐ │
• Data Layer │ │
• Repository │ │
• Remote/Local Data Sources │ │
• API Services │ │
• ┘ │
• ┬───────────────────────────┘
┌──────────────────────┼───────────────────────────┐
• External Dependencies & Libraries │
• Ktor ─ Koin ─ Kotlinx ─ Coil ─ Settings │
• ┘
Important Elements to Highlight
• Platform-specific code (Blue)
• Shared code (Green)
• External dependencies (Gray)