A cross-platform e-commerce application for shopping the latest footwear, built with Kotlin Multiplatform and Compose Multiplatform. This app offers a smooth shopping experience with essential e-commerce functionalities and a modern UI design, tailored to Android and iOS. Here is the Ktor Backend
- Cross-Platform Implementation: Single codebase targeting both iOS and Android platforms
- JWT Authentication: Secure user authentication and session management
- Product Catalog: Browse and search through shoe products
- Shopping Cart: Add/remove items, manage quantities
- Wishlists: Save favorite items for later
- Order Management: Track order status and history
- Reviews & Ratings: View and submit product reviews
- Offline Support: Local data persistence for cart and wishlist
- Kotlin Multiplatform: Framework for cross-platform development
- Compose Multiplatform: UI toolkit for building native applications for Android, iOS, and desktop
- Ktor Client: Multiplatform HTTP client
- OkHttp engine for Android
- Darwin engine for iOS
- KotlinX Serialization: JSON parsing and serialization
- Kamel: Async image loading library for Compose Multiplatform
- Koin: Lightweight dependency injection framework
- Koin Compose for ViewModel injection
- Lifecycle ViewModel: Managing UI-related data in a lifecycle-conscious way
- DataStore Preferences: Key-value storage for user preferences and session management
- Room: Local database for cart and wishlist persistence
- Note: Currently used on Android, with equivalent iOS implementation
- Navigation Compose: Type-safe navigation framework for Compose
- Compass Geolocation: Cross-platform location services
The app follows Clean Architecture principles with feature-based modules:
shared/
├── core/
│ ├── data/ # Core data layer utilities, network client
│ ├── domain/ # Core domain layer utilities, base models
│ └── presentation/ # Core presentation layer utilities, base ViewModels
│
├── feature/
│ ├── profile/
│ │ ├── data/ # User profile, auth repositories
│ │ │ ├── model/ # API DTOs, local entities
│ │ │ ├── remote/ # API services
│ │ │ ├── local/ # Local storage
│ │ │ └── repository/ # Repository implementations
│ │ ├── domain/ # Profile business logic
│ │ │ ├── model/ # Domain models
│ │ │ ├── repository/ # Repository interfaces
│ │ │ └── usecase/ # Profile use cases
│ │ └── presentation/ # Profile UI logic
│ │ ├── model/ # UI models, states
│ │ └── viewmodel/ # Profile ViewModels
│ │
│ └── shop/
│ ├── data/ # Products, cart, orders repositories
│ │ ├── model/ # API DTOs, local entities
│ │ ├── remote/ # API services
│ │ ├── local/ # Local storage
│ │ └── repository/ # Repository implementations
│ ├── domain/ # Shopping business logic
│ │ ├── model/ # Domain models
│ │ ├── repository/ # Repository interfaces
│ │ └── usecase/ # Shopping use cases
│ └── presentation/ # Shop UI logic
│ ├── model/ # UI models, states
│ └── viewmodel/ # Shop ViewModels
│
└── di/ # Dependency injection modules
androidApp/ # Android-specific implementation
├── ui/ # Compose UI components
└── MainActivity # Android entry point
iosApp/ # iOS-specific implementation
├── ui/ # SwiftUI components
└── iOSApp # iOS entry point
- Android Studio Arctic Fox or newer
- Xcode 13 or newer (for iOS development)
- JDK 11 or newer
- Kotlin Multiplatform Mobile plugin
- Clone the repository:
git clone https://github.com/yourusername/kmp-ecommerce.git
-
Open the project in Android Studio
-
Sync Gradle files and build the project
-
Run the desired target platform:
- Android: Run 'androidApp' configuration
- iOS: Run 'iosApp' configuration
Contributions are welcome! Please feel free to submit a Pull Request.