How brunocarvalhs/paguei works
Project Type & Purpose
• Paguei is an Android application designed to centralize and organize bills and expenses. Users can register/login (via email/password or Google), add expenses/invoices, later share costs with others, and eventually view them by month, category, or payer.
• The multi-module structure and naming conventions (e.g., features, data, domain, commons) indicate a modular, Clean Architecture/MVVM or multi-layered project.
Main Components to Identify
a. Application Layer:
– The “app” module acts as the entry point of the application. It contains the AndroidManifest, application class (PagueiApplication.kt), and overall configuration specific to the Android platform.
b. Domain Layer:
– The “domain” module contains business logic, core entities (CostEntities, GroupEntities, UserEntities), use cases, and repository interfaces. This layer encapsulates the core business rules.
– It also provides interfaces for external services (e.g., Authentication, Analytics, Notification, SessionManager, UpdateVersion) and use cases for each feature (auth, cost, group, report, etc.).
c. Data Layer:
– The “data” module provides the implementation of the repository interfaces declared in the domain layer. It contains DI modules (DataModule, RepositoryModule, ServiceModule, UseCaseModule) and service implementations (AdsServiceImpl, AnalyticsServiceImpl, etc.).
– Data conversion models and integration with potential backend systems (or local storage) are likely performed here.
d. Features:
– Under the “features” directory, each submodule (auth, billet_registration, calculation, check_list, costs, extracts, groups, profile, report, splash) corresponds to a distinct feature.
– Each feature module includes its own presentation layer (fragments, view models, views, UI components, layouts, navigation, etc.) and sometimes its own DI configurations.
– They are designed using MVVM principles (with ViewModel, ViewState, and Fragment/View components).
e. Commons:
– The “commons” module hosts shared components, base activities/fragments, view models, utilities, themes, and components used across multiple features.
f. Build & Configuration:
– Various build configuration files (Gradle scripts at the root, gradle folder, buildSrc, .github workflows) indicate that this project relies on CI, automated tests, and possibly code quality/enforcement via Danger.
– The CI/CD pipelines and versioning (VERSION.md) are also part of the overall ecosystem.
Relationships and Interactions
• The App module serves as a container that ties together the feature modules, commons, domain, and data layers.
• Each feature module handles its own UI and local navigation. They invoke use cases from the domain layer.
• The domain layer coordinates the business logic and makes calls to repository interfaces, which are implemented in the data layer.
• The data layer manages data sources (could be local or remote) and services (e.g., ads, analytics, notifications) and provides dependency injection (using modules found in “data/di”, “buildSrc” or in individual modules).
• Shared utilities and components are centralized in “commons” to reduce duplication.
Important Architectural Patterns & Principles
• Clean Architecture: Separation among Data, Domain, and Presentation (features) layers.
• MVVM (Model–View–ViewModel): Evident in the presence of ViewModel classes, ViewState handling, and Fragment-based UI.
• Dependency Injection: Use of DI modules and separation of interface and implementation in domain and data.
• Modularization: Each feature resides in its own module giving clear boundaries and promoting scalability and isolatability.