This project is an example of a NestJS application that implements the DDD (Domain Driven Design) and Vertical Slicing architecture. The application allows users to register, authenticate and manage tasks. Tasks can have reference images, and both user profile images and task images are stored in Amazon S3.
Domain Driven Design (DDD) is a software design approach that focuses on modeling a complex business domain and communication between team members. In this application, we separate business logic, application logic and infrastructure logic into different layers, following DDD principles.
Vertical Slicing is an architectural approach that organizes code into independent, self-contained "slices" or "modules" that represent different functionalities of the application. In this project, we separate the functionality into three main modules: Auth, Task and User. Each module contains its own application, domain, infrastructure and interface layers, which facilitates maintainability and scalability of the code.
CQRS is an architectural pattern that separates query and command operations into different models and objects. In this project, we use the CQRS pattern to handle read and write operations related to tasks and users.
Event Sourcing is an architectural pattern in which changes in application state are stored as a sequence of events. Although not directly implemented in this example, Event Sourcing can be useful in combination with CQRS to handle domain events and maintain an audit trail of system changes.
- Clone the repository and navigate to the project directory.
- Install the dependencies with
npm install
. - Configure the required environment variables (e.g. AWS S3 and MongoDB credentials).
- Run the application with
npm run start
.