How willpasco/meli-test works
Major Components
• App Module: This is the main Android application (located in the “app” folder) that contains the entry point (e.g., MainActivity) and references to global configurations (like the AndroidManifest.xml) along with resources.
• Core Modules: These provide shared functionalities such as:
– Logger (core/logger): Handles log collection and Crashlytics integration.
– Navigation (core/navigation): Divided into API and implementation, providing an abstraction over screen navigation.
– Network (core/network): Also split into API and implementation. Notable here is the native component (cpp code) responsible for managing the NetworkSecurity (access token) integration.
– Style (core/style): Defines design themes, UI components (buttons, headers, etc.) and consistency across the UI.
• Feature Modules: There are at least two major features:
– Details: Contains both an API and its implementation with clear separation between data (remote data sources, repositories), domain (use cases, models, exceptions), and presentation (composable components, viewmodels). It also manages its own navigation within the “details” package.
– Listing: Similar structure to “Details”, with API and implementation layers, managing data sources, repositories, mapping functions, pagination logic, and composable UI components for listing products.
Interactions and Relationships
• The App Module serves as the application shell and ties everything together:
– It initializes the application (via AppApplication and MainActivity) and sets up navigation using the core navigation components.
– It integrates with Google services (Crashlytics) using the google-services.json file.
• Core modules are independent libraries that are consumed by both the App Module and feature modules:
– The Core Logger collects and sends logs, which are used by all modules.
– The Core Network layer provides network communication and security (access token management via the C++/JNI native code). The README explains that the NetworkSecurity.cpp file is generated (or provided) via a shell script.
– The Core Navigation layer defines the common navigation contracts (APIs and their implementations) used by feature modules (like Details and Listing) to handle screen transitions.
– The Core Style module ensures UI consistency and component reusability.
• The Feature Modules (Details and Listing) implement their own functional flows while consuming the services of the core modules:
– They have dedicated packages for data, domain, and presentation (following a variant of Clean Architecture) and use dependency injection (“di”) to wire up internal components.
– Their navigation flows integrate with the app-level navigation infrastructure.
• External Services:
– The Firebase Crashlytics integration is used by the Logger.
– There is also an external API integration with Mercado Livre’s services, as indicated by the README, which involves the network access facilitated by the Core Network.
Architectural Patterns and Design Principles
• The project leverages modularization to enforce separation of concerns (each module has a clear responsibility).
• Clean architecture is apparent in the way that feature modules (Details and Listing) separate data, domain, and presentation layers.
• Dependency Injection is used for wiring dependencies (the “di” directories in several modules).
• Separation of platform-specific (Android) and cross-cutting infrastructure (core components) is maintained.
• Abstraction layers (APIs vs. Implementations) are used in Core Navigation and Core Network modules, which is beneficial for testing as well as swapping implementations if needed.