Skip to content

Nestjs project with simple customer and order cqrs using Kafka as EventBus

Notifications You must be signed in to change notification settings

Ashniu123/nestjs-customer-order-eventsourcing-cqrs

Repository files navigation

Nest Logo

Description

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.

Installation

$ npm install

Running the app

Prereqs

  • Kafka. Configurable through KAFKA_BROKERS env variable.
  • MongoDB. Configurable through CUSTOMERS_VIEW_SVC_MONGO_URI and ORDERS_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.

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

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.

License

Nest is MIT licensed.

About

Nestjs project with simple customer and order cqrs using Kafka as EventBus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published