How victoriaparraf/go_dely_back_verde works
Project Type and Purpose
• This is a backend server-side application for an e-commerce or delivery platform (named “GoDely”) with multiple bounded contexts (e.g., Auth, Product, Category, Combo, Coupon, Discount, Notification, Order, Payment Method, User, and Address).
• The README highlights several key modules (Auth, Product, Category, etc.) and external technology integrations (PostgreSQL, RabbitMQ, Cloudinary). Patterns of DDD and Hexagonal Architecture are explicitly mentioned.
File Structure
• The source code is organized in a “src” directory with multiple subdirectories corresponding to the bounded contexts.
• Each module (for example, src/auth, src/product, src/category) follows a layered structure with folders like application (commands, queries, DTOs), domain (entities, aggregates, value objects, events, exceptions), and infrastructure (controllers, repositories, mapping, TypeORM integrations).
• There is a “common” module that centralizes shared abstractions and integrations (e.g., Cloudinary, Email, Firebase, RabbitMQ).
• Configuration files (e.g., docker-compose.yml, .env.template) and Nest CLI settings indicate containerization and environment-based configuration.
Core Components to Highlight
• Auth Module (handles authentication and JWT services)
• User Module (user registration, profile, and user entity management)
• Product Module (CRUD operations related to products and catalog management)
• Category Module (managing product categories and hierarchy)
• Combo Module (bundling products together)
• Coupon Module (managing discount coupons)
• Discount Module (discount definitions and application logic)
• Order Module (managing orders, statuses, and order items)
• Payment Method Module (handling payment method details and integrations)
• Notification Module (for sending notifications)
• Address Module (user address management, although integrated within the User context if not separate)
b. Layers / Architectural Structure within Each Module:
• Application Layer: Contains DTOs, command and query services which orchestrate business logic.
• Domain Layer: Contains aggregates, entities, value objects, domain events, and exceptions that encapsulate business logic.
• Infrastructure Layer: Responsible for interacting with external systems (e.g., controllers for REST APIs, TypeORM repositories, external services integration such as RabbitMQ, Cloudinary, email, Firebase).
c. External Services & Technologies:
• PostgreSQL for persistent data (as hinted by the use of TypeORM configurations)
• RabbitMQ for messaging and asynchronous communications
• Cloudinary for image storage/processing
• External authentication using JWTs
Relationships and Interactions
• Controllers receive API calls, then forward applications commands/queries to services.
• Application layer services interact with the domain layer (aggregates, entities) and, if necessary, publish events for coordination (e.g., notification service or order status updates).
• Infrastructure layer’s repositories (e.g., TypeORM based) bridge the domain objects with the database.
• Shared/common services (in the “common” folder) interact with external systems like Cloudinary, RabbitMQ, and email gateways.
• Inter-module communications (e.g., Order module might need data from Product, Discount, and User modules) should be depicted by clearly showing the API or event-driven integration lines between these contexts.
Architectural Patterns and Design Principles
• Domain-Driven Design by grouping modules as bounded contexts with clear separation of concerns.
• Hexagonal architecture (ports and adapters): Display the domain core in the center with application ports (e.g., services, interfaces) and adapters such as controllers, repositories, and external service integrations surrounding them.
• Clean separation between the domain, application, and infrastructure layers to reflect the maintainability and scalability principles.
Final Elements
• Each major module (e.g., Auth, Product, Order, etc.) with its internal sublayers.
• External communication channels (API gateway, external integrations like Cloudinary, RabbitMQ, PostgreSQL).
• Green for application layer elements.