I use Microservice approach for this project
for this reason, implement 4 section
- api-gateway: communication with RestAPI
- files-microservice: manage and work with files and storage
- mailer-microservice: send mail
- users-microservie: manage users; I tried to use DDD in this module
These services are connected to each other using RabbitMQ
It receives a POST request with JSON data type, and if the user's email is not duplicated, it stores the information in the database and call event and sends a email.
-
"name": "hamid", "familyName": "aboutalebi", "emailAddress": "hamid@test3.com", "password": "{VALID_PASSWORD}"
Getting a user's ID and retrieving its information from the reqres.in site
Save the avatar file of the specified user (userId) on the disk, and file info to database.
Display the desired user's avatar file
Delete the desired user's avatar file from the disk and its information from the database.
$ npm install
- Change .env file with valid mongodb and rabbitmq info
Please Start All Services
-
nest start api-gateway
-
nest start files-microservice
-
nest start files-microservice
-
nest start users-microservice
$ npm run test