Skip to content

morteza-mortezai/nestjs-microservice-clean-architecture

Repository files navigation

Nest Logo

NestJS Microservice Project with RabbitMQ Integration

Description

this project is consist of three microservices ,Gateway ,Users and Mailer

they communicate each other throug rabbitMq .

there is also lib folder that contains common modules .

client request is recived by gateway and after validation, it is sent to related microservice and then result will be sent back .

This project has been designed with scalability in mind, allowing for easy addition of new services and the ability to handle large volumes of traffic. It also offers flexibility in deployment options, with the ability to deploy each service separately or together as a single unit.

If you are looking for a robust, scalable, and flexible microservice architecture for your API service, this project is the perfect solution.

1

architecture

clean architecture is used for this project

it is consist of three main layer ; Domain , Usecase and Infrastucture .

accroding to clean architecture rules domain layer should not depend on any thing .

and also usecase layer can just depend on domain layer

Infrastructure layer is where controller and other services are there .

2

endpoints

post: localhost:3001/api/users

get: localhost:3001/api/user/:id

get : localhost:3000/api/user/:id/avatar

delete : localhost:3000/api/user/:id/avatar

Installation

$ npm install

Running the app

$ npm run start gateway

then in new terminal

$ npm run start users

then in new terminal

$ npm run start mailer

Test

# unit tests
$ npm run test

Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published