Devposts is a sample application that displays a brief selection of the hottest articles from Dev.to, showcasing featured content for developers.
Articles Screen | Article Details Screen |
---|---|
![]() ![]() |
![]() ![]() |
In this project, I aimed to design and implement a scalable, maintainable, reusable, and testable architecture based on Clean Architecture and modular design, in a way that is simple and easy for others to understand.
Before introducing that, let me say that Clean Architecture is not a template, trend, or some boilerplate. In fact, this architecture comes from following some principles like SOLID Principles. These principles are conceptual guidelines that prioritize the separation of concerns, making your software independent of frameworks, UI, and databases.
If we want to implement a well-modularized project, we have to follow something like SOLID principles (Which are applied at the class and interface level), but at the component (Module) level. These principles are Component Principles. These principles govern the dependencies between modules and ensure that the overall architecture remains flexible.
By combining Clean Architecture with a modular design, we can establishes a strong foundation for building large-scale Android applications that are easy to extend, maintain, and test.
Modules depend only on more stable modules, minimizing the ripple effect of changes. Each module is highly cohesive and loosely coupled, providing clear separation of concerns and easier testing.
The project employs the Model-View-Intent (MVI) pattern in its presentation modules, a unidirectional data flow pattern that improves state management and UI predictability.
Additionally, the project leverages Convention Plugins for streamlined Gradle configuration, keeping build logic clean and reusable across modules.
:app
Acts as the application entry point.:build-logic
Project-specific convention plugins:data
Handles all data-related concerns and consists of::datasources
Handles where data comes from (network APIs, local DB). Implements an offline-first strategy by keeping the local Room database as the single source of truth.:repository
Provides a layer that encapsulates and exposes data operations, abstracting underlying data sources.
:domain
Encapsulates business logic and use cases, the core rules and operations of the app, independent of UI or data source implementation:feature
Includes UI logic (feature modules)::articles
Handles the list of articles UI (Articles Screen) logic and presentation.:article-details
Handles the UI logic for showing details of a selected article (Article Details Screen).
:libraries
Reusable libraries::base-domain
Contains logic that can be reused by other domain modules (if they exist).:base-feature
Contains logic that can be reused by other feature modules, (e.g ui components).:design-system
Contains theme and typography-specific logic.:common
All utilities that can be reused in all project modules.:navigation
Includes navigation-related logic/tools.test
A shared library for test utilities.
- Kotlin A modern, concise, and safe programming language.
- Kotlin Coroutines a way to write asynchronous code in a sequential manner.
- Kotlin Flow wich is built on top of coroutines to handle asynchronous data streams in a simple, safe, and reactive way.
- Jetpack Compose Androidโs modern UI toolkit for building declarative and reactive UIs.
- Room An ORM for SQLite, providing a clean API for local data persistence.
- Ktor An asynchronous framework for building connected applications, used here as the HTTP client.
- Hilt A dependency injection library built on top of Dagger for Android.
- Paging 3 A library for loading and displaying large datasets efficiently.
- Coil An image loading library for Android backed by Kotlin Coroutines, optimized for Jetpack Compose.
- Ktlint for Kotlin code style checks
- detekt for static code analysis, ensuring consistent code quality
- Convention Plugins Gradle plugins that centralize and reuse build configuration across multiple modules.
- Testing: The project relies on the following tools to ensure maintainable tests
This project integrates with the Dev.to API (also known as the Forem API), enabling seamless access to published articles and content directly from the Dev.to platform.
Planned additions:
- Unit tests (current focus)
- Integration tests
- UI tests
Give it a star to support the project and stay notified about future updates!
This project is a work in progress and may include technical debt. Contributions are welcome to help refine and enhance it, with the goal of delivering a robust and scalable architecture.