How andrea-acampora/nestjs-ddd-devops works
Main Components
• • Entry Point & Global Configuration: Highlight files such as src/main.ts and the configuration folders (src/config and environment files). This layer sets up the global pipes (validation, versioning) and starts the NestJS application.
• • Modules/Bounded Contexts: Represent each module (auth, communication, health, user) as a separate component. Each module further adheres to layering according to Clean Architecture (Domain, Application/Use Case, Infrastructure).
– Domain Layer: Entities, value objects, domain events, and repository interfaces (for example, in src/modules/user/domain).
– Application/Use-Case Layer: Use cases, command and query handlers, and application services (e.g., src/modules/auth/application, src/modules/user/application).
– Infrastructure Layer: Database mappers, repository implementations, communication gateways (GraphQL resolvers, REST controllers, etc.).
• • Shared/Library Components: Include reusable libraries (src/libs) where you find common constructs like ddd building blocks, API helpers, exceptions, pipes, and decorators. These are integral to multiple modules.
• • Database and Persistence: Include the configuration directories, migration scripts (src/config/database/migrations), and Mikro-ORM settings. Mark PostgreSQL as the underlying persistence engine (paired with Docker and docker-compose).
• • DevOps & CI/CD Tools: Indicate CI/CD pipelines (GitHub workflows in .github/workflows), Dockerfiles, docker-compose.yml, and environment management (env dist/test files).
Relationships and Interactions
• Dependency injection – for instance, each module’s services rely on infrastructure implementations and domain repository interfaces.
• Interaction with external systems such as the PostgreSQL database (via Mikro-ORM) and external DevOps pipelines (CI/CD workflows triggering Docker builds and deployments).
Architectural Patterns and Design Principles
• That the overall architecture is a Modular Monolith with clean boundaries between bounded contexts.
• Use of Domain-Driven Design patterns such as Aggregates, Repositories, Domain Services, and Domain Events.
• Mention that functional programming principles (immutability, pure functions, type safety via TypeScript) are integrated particularly in lower-level (utility/DDD) libraries.
• CI/CD and DevOps practices that automate testing, building, and deployment using Docker and GitHub Actions.