How deroldan26/orangeteam-deliverybackend works
This project is a backend service for the GoDely delivery application built using NestJS. The README and file tree clearly indicate that the project is designed following the principles of Hexagonal Architecture (Ports and Adapters), Domain-Driven Design (DDD), and Aspect-Oriented Programming (AOP). The repository is structured into multiple bounded contexts or modules (such as audit, auth, category, combo, cupon, discount, order, product, and user) that encapsulate their own domain logic and infrastructure concerns.
Main Components to Highlight
a. Domain Core:
b. Application Layer:
• Surrounding the core, the application services and use-case logic such as command handlers, queries, and DTOs, which orchestrate and mediate interactions between the domain and the external layers. They are organized under src/*/application.
c. Infrastructure Layer:
• This layer contains the adapters that interact with external systems (e.g., repositories with Postgres entities, controllers for HTTP endpoints, authentication with JWT, event messaging via RabbitMQ, cloud storage via Cloudinary, email services, etc.). They are under directories like src/*/infrastructure.
d. Cross-Cutting Concerns:
• AOP elements such as decorators for logging, auditing, exception handling, and performance measurement are located in src/core/application/aspects.
e. External Services:
• External integrations such as:
• Database providers (e.g., PostgreSQL and MongoDB as seen in src/core/infrastructure/database).
• Messaging Services (RabbitMQ components).
• Cloud services (Cloudinary for image handling) and Email Sender.
• Authentication (using JWT and related guard modules).
Relationships and Interactions
• How the application layer interacts with the domain layer by invoking domain logic and emitting domain events.
• Adapters connecting the domain and application layers to infrastructure components (e.g., repositories that persist entities, mappers translating between domain objects and persistence models, DTO transformations, etc.).
• Cross-cutting concerns where decorators wrap service calls or controller methods.
Architectural Patterns and Design Principles
• Hexagonal Architecture by showing the domain core at the center with “ports” (interfaces in the domain) that are implemented by “adapters” (infrastructure repositories, controllers, etc.).
• Demonstrate the DDD approach by grouping modules (product, order, etc.) into their own bounded contexts.