Skip to content

Ivy-Apps/kmp-template

Repository files navigation

Kotlin Multiplatform (KMP) template

An opinionated and pragmatic Kotlin Multiplatform template for building scalable modern apps with minimal effort. Inspired by https://github.com/android/nowinandroid.

Project Setup

  1. Install SDKMAN
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
  1. Install Java 21
sdk install java 21.0.4-tem

Frontend

  1. Nothing atm.

Backend

  1. Install Docker (https://www.docker.com/). Download for your machine and follow the recommended setup.
  2. Launch the Docker app from the MacOS UI.

Bitwarden Secrets Manager (required for production deploys)

  1. Create a Bitwarden account
  2. Setup Bitwarden Secrets Manager in the Bitwarden UI
  3. Get a Bitwarden Secrets Machine access token
  4. Securely save the token to your Keychain: Run the command below. It will prompt you to paste the token hiddenly (so it doesn't get saved in your shell history).
make add-bws-token
  1. Install bws (Bitwarden Secrets cli) using
curl https://bws.bitwarden.com/install | sh
  1. Verify Secrets installation
make check-secrets

Usage

Just make it:

make help

Tech stack

Common (shared)

  • Kotlin
    • Serialization Json
    • Coroutines
    • Ktor client
  • Build logic
    • Kotlin Gradle DSL (.kts)
    • Gradle Convention plugins
    • Version Catalog
    • Modularized
  • ArrowKt for FP primitives
  • Unit testing
    • Strikt for assertions
    • Mockk
    • Google TestParameterInjector
    • Turbine for testing Kotlin Flows

Frontend

  • UI
    • Compose Multiplatform
    • Material 3
    • Screenshot tests
  • Navigation
    • Compose Navigation 2
    • Will be replaced by Navigation3 when it supports WasmJs
  • Compile-time DI using Metro
  • Unit testing
    • ComposeViewModel test ext with Molecule

Backend

  • Ktor Server
  • Infrastructure
    • Docker Compose
    • GNU Make
    • Targets ARM64 VPS
    • Caddy reverse-proxy for SSL and routing
    • make deploy-be and done.
    • Infrastructure e2e security tests
  • Monitoring
    • Grafana for Metrics UI
    • Prometheus for metrics DB
    • Micrometer for JVM stats GET /metrics endpoint
    • Dozzle for Logs UI
  • Persistence
    • PostgreSQL for DB
    • JetBrains Exposed ORM
    • DB backups
    • Security
  • Authentication
    • Sign in with Google
    • Token-based with stateful bearer token
  • Payments
    • Stripe
  • Email Sender
    • Resend?

About

An opinionated and pragmatic Kotlin Multiplatform template for building modern apps with minimal effort.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors