This app is developed using Jetpack Compose, Clean Architecture, and MVVM design pattern. The app includes a login screen and a subsequent screen that displays a list of resources. The services for login and data retrieval are simulated using the "https://reqres.in/" API.
To run the app, you need the following:
- Android device or emulator running Android OS (version 8.0 or above)
- Android Studio Flamingo | 2022.2.1 Patch
- Java version SDK 17
- Internet connection to communicate with the API
The app follows the Clean Architecture principles, which promotes separation of concerns and modularization of components. It consists of the following layers:
-
Presentation Layer: This layer contains the user interface components developed using Jetpack Compose. It interacts with the ViewModel layer to display data and handle user actions.
-
ViewModel Layer: This layer implements the MVVM (Model-View-ViewModel) design pattern. It communicates with the Use Case layer to retrieve data and update the UI. It also handles user actions and triggers appropriate actions in the Use Case layer.
-
Use Case Layer: This layer contains the business logic of the app. It interacts with the Data Layer to retrieve and process data. It provides the necessary data to the ViewModel layer for display.
-
Data Layer: This layer communicates with external data sources, such as APIs or databases. It retrieves and processes data, and provides it to the Use Case layer.
-
Architecture Framework Layer: This layer provides the architectural framework and structure for the app. It includes the base classes and interfaces that define the core architectural components, such as base ViewModel, base Use Case, and base Repository.
- Android Jetpack Compose
- Kotlin
To run the app locally, follow these steps:
- Clone the repository:
git clone <repository-url>
- Open the project in Android Studio.
- Build and run the app on an Android device or emulator.
The project structure follows a modular approach, with the following modules:
- app: Contains the main app module, including the UI and app entry point.
- presentation: Contains the UI components implemented using Jetpack Compose.
- domain: Contains the business logic and use case implementations.
- data: Contains the data layer implementations, including API communication.
The code is organized based on feature modules, following the Clean Architecture principles. Each feature module includes the necessary components for that specific feature, such as UI, ViewModel, and Use Case.
-
Presentation Layer: Contains the UI components implemented using Jetpack Compose. It interacts with the ViewModel layer and displays data to the user.
-
ViewModel Layer: Implements the MVVM design pattern. It communicates with the Use Case layer and provides data to the UI. It also handles user actions and triggers appropriate actions in the Use Case layer.
-
Use Case Layer: Contains the business logic of the app. It interacts with the Data Layer and provides the necessary data to the ViewModel layer. It follows the Clean Architecture principles and separates the business logic from the UI and Data Layer.
-
Data Layer: Communicates with external data sources, such as APIs or databases. It retrieves and processes data, and provides it to the Use Case layer.
-
Architecture Framework Layer: Provides the architectural framework and structure for the app. It includes the base classes and interfaces that define the core architectural components.
The app follows the MVVM (Model-View-ViewModel) design pattern. The ViewModel layer acts as an intermediary between the UI and the Use Case layer. It retrieves data from the Use Case layer and provides it to the UI for display. It also handles user actions and triggers appropriate actions in the Use Case layer.
The app integrates with the "https://reqres.in/" API to simulate login and data retrieval. The API provides endpoints for user authentication and retrieving a list of resources. The data is fetched asynchronously and displayed in the app.
The code is thoroughly documented with comments to improve code readability and understanding. Each class, function, and important code block is documented to provide context and explain its purpose.
The "AwesomeLoginCleanArquitecture" app demonstrates the implementation of Clean Architecture and MVVM design pattern using Jetpack Compose. It showcases the separation of concerns and modularity, making the codebase more maintainable and testable. The use of appropriate technologies and best practices ensures clean and efficient code.