Nestjs Microservice boilerplate: apply DDD, CQRS, and Event Sourcing within an event driven architecture
Microservice boilerplate based on NestJS v10, built with TypeScript.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. This project cover both, running on a containerized environment using Docker, or on your local machine.
This section will cover the steps to follow for a containerized version of this project.
(cd scripts/ && sh build.sh)
The build script Will:
credentials:
User | Password |
---|---|
admin | changeit |
Form
Server | User | Password | Database |
---|---|---|---|
sql-db | root | root | demo-db |
sudo docker exec -it devtest bash
Soft clean up
(cd scripts/ && sudo sh cleanup.sh)
The cleanup script soft Will:
Hard clean up
#both commands are equivalent
#option1
(cd scripts/ && sudo sh cleanup.sh -h)
#option2
(cd scripts/ && sudo sh cleanup.sh --hard)
The cleanup script hard Will:
This section will cover the steps to follow for a local version of this project.
PS: in order to start receiving events from the EventStore, you should enable projections. (disabled by default)
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# debug mode
$ npm run start:debug
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Add tests;
You are welcome to contribute to this project, just open a PR.