/nest-microservice-example

This is an app that demonstrates how to use Nest.js to create a RESTful API microservice

Primary LanguageTypeScript

Logo

A Node.js Swagger API Microservice example

Description

This is an app that demonstrates how to use Nest.js to create a RESTful API microservice

Patterns

  • Event-sourcing
  • CQRS
  • Saga
  • ...

Installation

$ npm
$ docker-compose

Running the app

# development

## docker-compose => redis, mongodb, rabbit containers
$ docker-compose up -d

## apps
$ npm install --global cross-env
$ cd /services/service_name
$ npm install
$ npm run start

Relateds Links

Swagger Explorer URL: http://localhost:3000/api

Simple functions

Orders Application

  • Create/Cancel/Read an order
  • Auto deliver orders after X secords

Payments Application

  • pub/sub events by Order App

TBC

  • write Event store and restore Read storage
  • Handling concurrent updates using optimistic locking
  • Using snapshots to improve performance
  • ...