Skip to content

mrlem/android-compose-template

Repository files navigation

Compose Sample

Release Build KtLint Detekt

A project template with the following objectives in mind:

  • use modern UI tools
  • use a single source of truth
  • make it painless to write new features
  • optimized for incremental build

Technical stack

  • arch:
    • app: clean architecture with features x layer modularization
    • ui: simplified MVI
  • build: kts gradle build scripts + gradle convention plugins to simplify + version catalog
  • dep injection: hilt + auto-dagger
  • ui: compose + material3 + navigation
  • async: coroutines & flow
  • db: room
  • rest: retrofit
  • annotation processing: ksp only, no kapt

App structure

Modules hierarchy:

  • app
  • core
    • di
    • feature
      • nav
      • ui
    • ui
      • theme
  • features
    • overview
      • nav
      • ui
    • library
      • data
      • domain
      • nav
      • ui
  • gradle-plugins

Feature module plugins:

  • app.feature.data
  • app.feature.domain
  • app.feature.nav
  • app.feature.ui

Each adds all requirements for the module of a given layer, save the android namespace.

Navigation is using dedicated modules for stronger feature isolation.

Future

  • doc:
    • document appInit task
    • document features creation
  • sample:
    • add item removal
  • unit tests
  • room: database in the library module makes sense for this sample app, not for a real app. If you find a multi-module pattern for room, please call me (I'd say this is not possible, by design)
  • room: migration handling
  • di: investigate moving from hilt+autodagger to metro once it gets more mature

Contributors 3

  •  
  •  
  •  

Languages