How sairyss/domain-driven-hexagon works
Main architectural layers and components
• Interface Adapters (Presentation Layer): Include HTTP Controllers, CLI Controllers, GraphQL Resolvers, and DTOs as the user-facing gateways (found in “src/modules/...controllers” and “src/modules/...dtos”) that translate incoming request DTOs into Commands/Queries, then receive responses.
• Infrastructure Layer: Represented by the “database” (migrations, seeds, and migration tools), “docker” configuration files, and repository implementations (in “src/libs/db” and “src/modules/*/database”). Emphasize adapters that implement the ports for persistence (using Slonik for SQL) and other external resources.
Relationships and data flows between components
• How domain events (e.g., “user-created” events) trigger further actions (like wallet creation) via event handlers in the application layer.
• Dependency inversion where the core business logic never directly depends on external frameworks; only ports (interfaces) are defined in the core, and external adapters (infrastructure layer) implement them.
Architectural patterns and design principles used
• Hexagonal (Ports and Adapters) Architecture: Illustrate the separation between the core domain and external concerns (interfaces vs. adapters) with clearly labeled ports.
• Command–Query Separation (CQS/CQRS): Indicate the separate pathways for commands (state-changing operations) and queries (data retrieval operations) in the application layer.
Technologies and libraries in your labels
• Mention that the project is built using NodeJS, TypeScript, and the NestJS framework.
• Use of Slonik for database access.
• Testing approaches (e.g., e2e tests, behavioral testing with Gherkin) and other supportive tools (e.g., dependency cruiser for validating dependencies).
Important details to capture
• The modular design (vertical slicing): Each module (like “user” and “wallet”) has its own well-defined components (commands, queries, domain logic, controllers, DTOs) encapsulated within its own folder.
• The separation of concerns with distinct configuration files (environment variables, Docker Compose, testing setups) and how these support deployment and testing without interfering with the core business logic.
• The overall layered architecture from external clients (HTTP/GraphQL/CLI) to core domain (business rules) to the infrastructure level (database interactions and external service communications).