How albrivas/gasguru works
Main Components
• App Module – This is the entry point of the Android application containing the Application class, MainActivity, and other core UI elements.
• Core Modules – These include multiple sub-components:
• Core/Common: Shared utilities and common functionalities (e.g., Coroutine Dispatchers, common utilities).
• Core/Data: Contains repository implementations, network mappers, and data sources that abstract interaction with remote APIs and other sources.
• Core/Domain: Implements use cases (business logic) and encapsulates the rules and processes of the application (e.g., fuel station queries, location handling, connectivity).
• Core/Database: Handles interactions with the local database schemas, DAOs, and migration logic.
• Core/Model: Defines data models used across the layers (e.g., FuelStation, UserData, Filters).
• Core/Network: Manages network operations, API service definitions, remote data sources, and network models.
• Core/UI and Core/UIKit: Provide theming, reusable UI components (buttons, chips, navigation bars, markers, etc.), and common visual elements.
• Core/Testing: Contains test rules and base test setups for unit and instrumented testing.
• Feature Modules – These modules focus on specific functionalities of the app, such as:
• Detail Station
• Favorite List Station
• Onboarding
• Profile
• Station Map
Each of these is structured in a similar way, containing presentation (UI), navigation, and sometimes domain-specific logic.
Relationships and Interactions
• The App Module initializes and ties together the entire application. It sets up the navigation host and directs the user flow to the appropriate feature module.
• The UI layer (including feature modules and Core/UI/Core/UIKit) interacts with ViewModels which then communicate with the Domain layer (use cases).
• Use Cases in the Domain layer invoke Repository interfaces defined in Core/Data.
• The Data layer abstracts access to two major external data sources:
• Network: The network module (using Retrofit API services and data sources) fetches real-time fuel price information.
• Local Database: The database module (using DAOs and migration scripts) caches or persists data for offline use.
• Common modules facilitate shared logic, while testing modules are used to validate each layer independently.
Architectural Patterns and Design Principles
• Clean Architecture – Clear separation of concerns across UI (presentation), Domain (business logic), and Data (infrastructure).
• MVVM Pattern – The project shows ViewModel classes for each UI screen, which handle state and logic.
• Modularization – The project is structured into separate modules (app, core, feature) to improve maintainability, testability, and independent evolution of features.
• Dependency Injection – Although not explicitly stated, the presence of DI modules (for example in data and network) suggests a DI framework (potentially Hilt/Dagger).
Relevant Technologies & Frameworks
• Android (Kotlin-based) – The core application and feature modules are built using Kotlin.
• Gradle (Kotlin DSL) – The build configuration is managed via Gradle with Kotlin DSL.
• Navigation Components – Used for routing and navigation across screens.
• Retrofit (or similar) in the Network module – For API communication.
• Room (or equivalent) in the Database module – For local data persistence.
• Testing Frameworks – Instrumented tests (Android tests) and unit tests are organized in the testing modules.
• UI Components – Custom UI elements in the Core/UIKit module for a consistent app look and feel.
Detail and Clarity
• The goal is to capture each essential architectural element: from the Android-specific entry point in the App module to the multiple feature-driven and shared modules.
• This design is particularly suited for a full-stack mobile (Android) application where separation of concerns, modularization, and clear data flow are essential.