A clean starter template for Kotlin Multiplatform (KMP) applications targeting Android and Desktop.
The project uses a decoupled multi-module architecture with independent feature
modules and centralized Gradle convention plugins in build-logic.
- Multiplatform Support: Shared business logic and Compose UI entry points for:
- Android application (
androidApp) - Desktop application with Compose for Desktop (
desktopApp)
- Android application (
- Architecture: Clean, decoupled design using Feature modules (with API and Implementation separation).
- Linter & Code Formatting:
- Detekt: For static analysis and identifying code smells.
- Spotless (with KtLint): For automated code formatting and style checking.
- Convention Plugins: Centralized build configuration located in the
build-logiccomposite build. - CI/CD Ready: Pre-configured GitHub Actions workflow for style checking, linting, and running unit tests.
- Interactive Bootstrapper: A shell script to rename packages, files, and project properties automatically.
- Roadmap: Web/Wasm and iOS targets are tracked in ROADMAP.md and kept out of the default build until stable.
Click the "Use this template" button on the kmp-modular-template GitHub repository to create a new repository from this project, then clone it to your local machine.
To customize the template for your new app (renaming packages, namespaces, and project slug), run the root setup script:
chmod +x setup.sh
./setup.shThe script will prompt you for:
- New Project Name (e.g.,
My App) - New Package Namespace (e.g.,
com.company.myapp)
Note: The script automatically renames package declarations, file directories, update references, resets git (optional), and deletes itself once finished.
├── androidApp/ # Android client application entry point
├── desktopApp/ # Desktop client application entry point (JVM)
├── shared/ # Core shared business logic & common UI
├── feature/ # Modular feature modules
│ └── home/
│ ├── api/ # Home feature interfaces and API
│ └── impl/ # Home feature implementation
├── build-logic/ # Custom convention plugins (composite build)
├── config/detekt/ # Detekt code quality rule configuration
└── ROADMAP.md # Planned Web/Wasm and iOS targets
This project maintains code quality using automated checks.
To check code formatting:
./gradlew spotlessCheckTo automatically apply formatting and fix KtLint issues:
./gradlew spotlessApplyTo run Detekt static analysis:
./gradlew detektTo execute all JVM unit tests:
./gradlew testTo run the same broad verification expected from the template:
./gradlew buildA GitHub Actions workflow is located in .github/workflows/ci.yml. It runs automatically on every push or pull request to the main or master branches, performing the following checks:
- Spotless Check: Formats verification.
- Detekt Static Analysis: Code health and design check.
- Unit Tests: Executes JVM test suites across all modules.
- Full Build: Builds Android/Desktop modules and runs Gradle checks.
This project is licensed under the MIT License - see the LICENSE file for details.