NestJS microservices show case
- NestJS
- NATS (Message Broker)
- GraphQL API (CodeFirst)
- Vite+React+TypeScript+Tailwind (Simple Frontend to use API)
- Lerna (Monorepo)
This is a simple show case of NestJS microservices. It has 3 microservices:
- packages\api - GraphQL API microservice
- packages\ai - translation microservice (uses ChatGPT API), event-based communications.
- packages\user - user microservice (create\find and etc), message-based communcations.
It works through event-based communication. All messages are non-blocking and are sent through the NATS message broker. There could be multiple instances of the AI microservice, which will be automatically load balanced by NATS using a queue.
- npm run start:nats-server
- npm run start:dev
- Front end will be available at http://localhost:3001
- GraphqlAPI will be available at http://localhost:3000/graphql