| name | kmp-modules |
| description | Guidance on where to place different types of code in this Kotlin Multiplatform project. |
Skill: Kotlin Multiplatform Layout
This repository follows standard Kotlin Multiplatform source-set conventions, organized into distinct modules, each serving a specific purpose.
Project Modules
The project is divided into three primary modules. Understanding their responsibilities and dependencies is key to placing code in the correct location.
1. sharedLib (Shared Logic)
This is the core module containing all business logic, data models, state management, and storage mechanisms.
- Purpose: Centralizes the common logic so it can be reused across different user interfaces (CLI and GUI).
- Dependencies: It is completely independent and does not depend on
cliApp or composeApp.
- What goes here:
- OTP generation algorithms (e.g., HOTP, TOTP).
- Data storage operations, database schemas, and repository patterns.
- Core domain models and use cases/interactors.
- Platform-specific implementations for storage or cryptography via
expect/actual declarations.
2. composeApp (GUI Library)
This module contains most of the common Graphical User Interface (GUI) application code, built using Compose Multiplatform.
- Purpose: Provides the visual interface for the application (Desktop, Android library, iOS, Web/Wasm).
- Dependencies: Depends heavily on
sharedLib to fetch data, observe state, and trigger actions.
- What goes here:
- UI components, screens, and visual layouts written in Jetpack/Compose Multiplatform.