How minhphan46/nha_gia_re_mobile works
Main Components
• Frontend (UI/Presentation): Represented by the Flutter codebase. The “lib/features/presentation” directory is organized by modules (e.g., account, chat, home, search, etc.) and includes both global widgets and feature-specific screens along with controllers and bindings using GetX.
• Domain Layer: Shown in the “lib/features/domain” directory—it contains entities, usecases, enums, and repository interfaces defining the business logic.
• Data Layer: In “lib/features/data” you have data sources (both local and remote), models, and repository implementations that deal with data persistence, API calls, and local databases.
• Core & Config: Common helpers and configurations such as error handling, network utilities, theming, route settings, and language translations are under “lib/core” and “lib/config”.
• Dependency Injection: Represented by “injection_container.dart”, indicating how different layers are connected.
Relationships and Interactions
• Data layer is linked to:
– Remote Data Sources (via REST API calls to the NodeJS backend)
– Local Data Sources (e.g., local databases or JSON data used for caching, as seen in assets and database helper files).
• The external backend and database are separate external components that the app calls into from the Data layer.
• Global services (e.g., network info, device-specific services) in “lib/core/service” also interact across multiple layers.
Architectural Patterns and Design Principles
• Clean Architecture: Clearly distinguish between presentation, domain, and data layers. Represent the dependency rule (outer layers depend on inner ones but not vice versa).
• Use of GetX for state management and dependency injection.
• Separation of configuration values (theme, languages, routes) supports modularity.
• Multi-platform support is evident from dedicated directories (android, ios, linux, macos, windows, web).
Relevant Technologies/Frameworks
• Flutter & Dart for the UI and application code.
• GetX for state management and dependency injection.
• Clean Architecture - organizing code into data (infrastructure), domain (business logic), and presentation (UI) layers.
• External API and PostgreSQL for backend services (provided via a NodeJS API).