This project demonstrates Clean Architecture principles in an Android app. The project highlights scalability, maintainability, and testability, making it a strong foundation for building robust Android applications.
- Architecture: Implements MVVM architecture
- UI: Built with Jetpack Compose for UI and Compose Navigation for screen transitions
- Networking: Utilizes Retrofit for API calls to fetch data from the GitHub API
- Dependency Injection: Leverages Dagger Hilt for dependency management
- Testing: Includes unit tests with MockK and Compose UI screenshot tests with Espresso
- Modularization: Follows a modularized approach to separate concerns and improve scalability
The app fetches a list of GitHub repositories from the GitHub API and displays them in a list. When a repository is tapped, the app navigates to a detailed view showing additional information about the selected repository.
- Repository List: Displays a list of repositories with key details like name, description, and star count
- Repository Details: Shows detailed information about a specific repository
- Language: Kotlin
- UI Framework: Jetpack Compose
- Navigation: Compose Navigation
- Networking: Retrofit
- Dependency Injection: Dagger Hilt
- Architecture: MVVM
- Testing: MockK for unit testing, Jetpack Compose for screenshot tests
- Build System: Gradle with Kotlin DSL
- Android Studio Ladybug or newer
- Clone the repository:
git clone https://github.com/lmorda/android-clean-architecture.git
- Open the project in Android Studio
- Sync Gradle
- Run the app on an emulator or a physical device
The project is organized into separate modules to improve code reusability and maintainability:
- App Module: Contains the application, main activity, and navigation host
- Data Module: Handles data fetching and repository implementation
- Domain Module: Contains DTOs and repository interface
- Explore Module: Contains all Explore page UI components built with Jetpack Compose
- Design Module: Home to the project's Compose Theme, Typography, and Colors
- Utils Module: Utility functions to be shared across the app
This project adheres to clean architecture principles to ensure clear separation of concerns. Unlike the domain layer explanation
in the Android Developer documentation, this implementation follows a true clean architecture approach. The data and UI layers are
fully decoupled, with the domain layer serving as the intermediary. The domain layer contains only business logic.
Note: UseCases were not utilized in this project due to its small scope.
Thanks to Agung Rama for the app icon:
https://www.flaticon.com/authors/agung-rama
This project is licensed under the Apache License. See the LICENSE file for details.