Nest framework TypeScript example for event-sourcing. This is a monorepo.
There are 2 main parts of the application:
- customer: where a person is registered with minimum details and a initial balance amount
- order: where a customerId is used to order items for an amount. If the amount is less than balance then it is ACCEPTED otherwise REJECTED
No authentication, just plain and simple APIs.
$ npm install
- Kafka. Configurable through
KAFKA_BROKERS
env variable. - MongoDB. Configurable through
CUSTOMERS_VIEW_SVC_MONGO_URI
andORDERS_VIEW_SVC_MONGO_URI
env variables.
# development
$ npm run start <service>
# watch mode
$ npm run start:dev <service>
# production mode
$ npm run start:prod <service>
The services are under app/
, each folder is a separate service.
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Nest is MIT licensed.