Basket Scan and Go is a cross-platform shopping application that allows customers to scan products, add them to a virtual basket, and check out without waiting in line. The application is built using Kotlin Multiplatform and Compose Multiplatform, enabling a shared codebase across Android, iOS, Desktop, and Web platforms.
- Product Scanning: Scan product barcodes to add items to your basket
- Basket Management: Create, view, and modify shopping baskets
- User Authentication: Secure login and user management
- Shared Baskets: Option to share baskets with other users
- Cross-Platform: Works on Android, iOS, Desktop, and Web
- ๐งฉ Compose Multiplatform; for shared UI
- ๐ Ktor; for networking
- ๐ฆ Kotlinx Serialization; for content negotiation
- ๐ฐ๏ธ Kotlinx Datetime; for datetime
- ๐งน ktlint; for Kotlin linting and formatting
- ๐ Kotlin Coroutines; for asynchronous programming
- ๐ Koin; for dependency injection
Open Run Config action:
or you can run it from file .fleet/run.json
TBD
| platform | gradle command |
|---|---|
| android | TBD |
| ios | /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project app/ios/ios.xcodeproj -scheme ComposeApp -configuration Debug |
| desktop | ./gradlew :composeApp:desktopRun -DmainClass=com.basket.sample.scango.DesktopAppKt |
| js | ./gradlew :composeApp:jsBrowserDevelopmentRun |
| wasm | ./gradlew :composeApp:wasmJsBrowserDevelopmentRun |
This project uses ktlint for Kotlin code style checking and formatting. ktlint is a linter with built-in formatter that enforces the official Kotlin code style.
./gradlew ktlintCheck- Run ktlint check on all modules./gradlew ktlintFormat- Run ktlint format on all modules to automatically fix style violations./gradlew <module>:ktlintCheck- Run ktlint check on a specific module./gradlew <module>:ktlintFormat- Run ktlint format on a specific module
For IntelliJ IDEA / Android Studio, you can install the ktlint plugin to get real-time linting and formatting.
The application follows Clean Architecture principles with a clear separation of concerns:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PRESENTATION LAYER โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ ViewModels โ โ Screen States โ โ Events โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DOMAIN LAYER โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Use Cases โ โ Domain Models โ โ Repositories โ โ
โ โ Interface โ โ โ โ Interface โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA LAYER โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Repository Impl โ โ Data Sources โ โ DTOs/APIs โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PLATFORM LAYER โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Result โ โ KLogger โ โ KTime โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
composeApp (UI Implementation)
โ
โโโ core/designSystem (UI Components)
โ
โโโ core/di (Dependency Injection)
โ โโโ core/logic/presentation
โ โโโ core/logic/data
โ โโโ platform/ktime
โ
โโโ core/logic/presentation (ViewModels, States)
โ
โโโ core/logic/domain (Use Cases, Models)
โ โ
โ โโโ platform/result
โ โ โ
โ โ โโโ platform/ktime
โ โ
โ โโโ platform/klogger
โ โ
โ โโโ platform/ktime
โ
โโโ core/logic/data (Repositories, Data Sources)
โ โ
โ โโโ core/logic/domain
โ โโโ platform/klogger
โ
โโโ core/designSystem
โ
โโโ platform/klogger
The following diagram shows a more detailed view of module dependencies in the project:
+---------------------+ +---------------------+ +---------------------+
| APPLICATION | | CORE | | LOGIC |
| MODULES | | MODULES | | MODULES |
+---------------------+ +---------------------+ +---------------------+
| :composeApp | | :designSystem | | :presentation |
| (UI Implementation) | | (UI Components) | | (ViewModels, States)|
| | | | | |
| :iosApp | | :di | | :domain |
| (iOS-specific code) | | (Dependency | | (Use Cases, Models) |
| | | Injection) | | |
| :basket-server | | | | :data |
| (Ktor-based backend | | | | (Repositories, |
| server) | | | | |
| | | | | Data Sources) |
+---------------------+ +---------------------+ +---------------------+
| | | | | | |
| | | | | | |
| | | | | | |
| +---------------------->+ | | | |
| | | | | |
| +---------------------->+ | | | |
| | | | | | |
| | | +--------------------->+ | |
| | | | | |
| | +------------------------->+ | |
| | | | |
+--+------------------------------------------------->+ | |
| | | |
| | | |
| v v v
| +---------------------+
| | PLATFORM |
| | MODULES |
| +---------------------+
| | :klogger |
| | (Logging utilities) |
| | |
| | :ktime |
+----------------------------------------->| (Date and time |
| utilities) |
| |
| :result |
| (Result monad for |
| error handling) |
+---------------------+
Dependencies:
- composeApp -> presentation, di
- di -> presentation, data, ktime
- presentation -> domain, data, designSystem, klogger
- domain -> result, klogger
- data -> domain, klogger
- klogger -> ktime
- result -> ktime
This diagram illustrates:
- Application Modules: The main entry points for different platforms
- Core Modules: Shared UI components and dependency injection
- Logic Modules: Business logic implementation following Clean Architecture
- Platform Modules: Utility modules used across the application
The arrows indicate dependencies between modules, showing how they rely on each other.
-
Core Modules:
- designSystem: UI components and styling
- di: Dependency injection setup
- logic: Business logic implementation
- data: Repositories and data sources
- domain: Use cases and domain models
- presentation: ViewModels and UI state management
-
Platform Modules:
- klogger: Logging utilities
- ktime: Date and time utilities
- result: Result monad for error handling
-
Platform-Specific Modules:
- composeApp: Shared UI implementation
- iosApp: iOS-specific code
- server: Ktor-based backend server implementation (documentation)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Commit Frequency โ
โ โ
โ 15 โผ โญโโฎ โ
โ โ โ โ โ
โ 12 โผ โ โ โ
โ โ โ โ โ
โ 9 โผ โญโโโโโฎ โ โ โ
โ โ โ โ โ โ โ
โ 6 โผ โญโโฎ โ โ โ โ โญโโฎ โ
โ โ โ โ โ โ โ โ โ โ โ
โ 3 โผ โญโโฎ โ โ โญโโฎ โ โ โ โ โ โ โญโโฎ โ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ 0 โผโโโโโโโโโดโโดโโโโดโโดโโโโดโโดโโดโโโโโดโโโโดโโดโโโโโดโโดโโโโโดโโดโโโโ
โ Jan Feb Mar Apr May Jun Jul Aug Sep โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The Basket Scan and Go application provides significant benefits to users:
- Time Savings: Users can scan products as they shop and skip checkout lines
- Convenience: Easy basket management and sharing capabilities
- Cross-Platform Access: Use the same application across different devices
- Real-time Updates: Immediate product and price information
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Feature Development Distribution โ
โ โ
โ UI/UX Improvements โโโโโโโโโโโโโโโโโโโโโโโ 35% โ
โ Basket Management โโโโโโโโโโโโโโโโโโ 27% โ
โ Authentication โโโโโโโโโโโ 16% โ
โ Cross-Platform โโโโโโโโ 12% โ
โ Performance โโโโโโ 10% โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Below are screenshots of the Basket Scan and Go application running on different platforms.



