A modern, scalable Android project template using Jetpack Compose, Multi-Module Architecture, and Clean Architecture principles.
This project is structured following Clean Architecture, emphasizing modularity and maintainability. It separates concerns into three main layers:
- Presentation: UI layer using Jetpack Compose
- Domain: Business logic with UseCases and Entities
- Data: Handles networking and local data access
The project is split into multiple Gradle modules:
:app: Entry point:core: Reusable UI components, theming, and shared utilities:domain: UseCases and core business logic:data: Repositories and data mapping:network: Retrofit, OkHttp, and API services:room: Local Room database setup:local: DataStore and shared preferences:guard: Error and exception management:navigation: Centralized Compose navigation
- Declarative UI with Jetpack Compose
- State hoisting and unidirectional data flow
- Material3 design with custom theming
- Shared composables for common UI elements (buttons, inputs, etc.)
- Retrofit for HTTP communication
- OkHttp Interceptors for logging and headers
- API responses wrapped in sealed classes (
Result,Resource) for consistent error and state handling
- Centralized error management in the
:guardmodule - Custom exception classes and mappers
- Domain-level error handling using
try-catchandsealed classes
- Room for structured local database
- DataStore for preferences and key-value storage
- Repository pattern abstracts access to local/network data
- Unit testing with JUnit and MockK/Mockito
- UI testing using Compose Test APIs
- Testable architecture via DI and use case isolation
- Hilt for dependency injection
- Compose Navigation with modular graph management
- Centralized dependency management using
buildSrcor Kotlin DSL
git clone https://github.com/GradleBuildTech/ComposeBase-Multi-Module.gitflowchart TD
A[APP] --> B[Presentation Layer]
B --> B1[UI Jetpack Compose]
B --> B2[ViewModel]
B --> F[Core Module]
B --> G[Guard Module]
B --> H[Navigation Module]
B --> C[Domain Layer]
C --> C1[UseCases]
C --> C2[Repository Interface]
C --> D[Data Layer]
D --> D1[Repository Impl]
D --> D2[Network]
D --> D3[Local Storage]
D2 --> D2a[Retrofit]
D3 --> D3a[Room]
D3 --> D3b[DataStore]