How dragoner91/go_dely_front_verde works
Key Layers and Components
• Presentation Layer:
– Contains Flutter UI elements (screens, widgets, routes) organized in “lib/presentation”
– Screens such as home, login, register, product details, cart, order history, etc.
– Navigation and UI components (custom app bars, side menus, list views) that render data.
• Application Layer:
– Located under “lib/aplication”, it includes providers (state management), DTOs, use cases, and business logic handlers.
– This layer acts as a mediator between the UI and the domain layer, handling the interaction logic.
• Domain Layer:
– Found in “lib/domain”; it defines business entities (e.g., user, product, order, category, combo, discount) and abstraction interfaces for repositories.
– Its purpose is to represent the core business rules independently of any framework.
• Infrastructure Layer:
– Under “lib/infraestructure”, this layer contains concrete implementations of data sources and repository interfaces.
– It also manages external integrations such as Firebase services, notifications, and network petitions.
– Additional elements are data mappers and local models that convert between raw data and domain objects.
• Core Layer:
– Contains common utilities, error handling (“exception.dart”), use-case foundations, and result wrappers in “lib/core”.
• Configuration/DI Layer:
– Located in “lib/config”, including DI container setup, constants (environment, ubication), routing configuration, and custom theming.
Flow of Data and Interactions
• Infrastructure layer as the concrete implementation of repository and data-source interfaces, which interact with external services (like Firebase and notification services).
• Core and Config layers as cross-cutting concerns used by the other layers.
• Dependency inversion principle: the Domain layer defines repository contracts while the Infrastructure layer implements those contracts.
Architectural Patterns
• Separation of concerns: UI (Presentation) is decoupled from business rules (Domain), which in turn is decoupled from how data is retrieved (Infrastructure).
• That the dependency direction is inward – External frameworks like Flutter and Firebase interface at the outer layers, while the core business logic remains agnostic.