Skip to content

kanmitcode/crimmit

Repository files navigation

Nest Logo

Crimmit-Task: Building a Microservices Architecture with NestJS framework.

NPM Version Package License

Task Description

You are tasked with creating a microservices architecture using NestJS. The architecture will consist of three services: Owner, Products, and Order. Each service will interact with a MongoDB database, and the communication between these services will be handled using two different protocols: RabbitMQ and gRPC. Additionally, the Order service will implement a caching mechanism for product data.

To develop new Project and install dependencies (optional)

# create a nestJS app - crimmit
$ nest new crimmit
# create the microservices
$ cd crimmit

$ nest generate app owner-service

$ nest generate app product-service

$ nest generate app order-service
# install all the necessary dependencies needed for the project
$ npm install @nestjs/mongoose mongoose @golevelup/nestjs-rabbitmq amqplib @nestjs/microservices @grpc/grpc-js @grpc/proto-loader cache-manager cache-manager-redis-store redis

$ npm install class-validator class-transformer 

$ npm install ioredis @nestjs/cache-manager

$ npm install @nestjs/config

$ npm install concurrently --save-dev

Main Project setup

# clone the repository to your local machine
$ git clone https://github.com/kanmitcode/crimmit.git
$ npm install

Compile and run the project using Docker Compose

# build the microservices (owner-service, product-service, order-service)
$ docker-compose up --build

# you can press Ctrl+C to stop the services from running

# remove the microservices
$ docker-compose down

Compile and run the project locally

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run the project

Kindly use the postman collection (Crimmit.postman_collection.json) attached to the project repo

Service Diagram

crimmit-service-diagram

Resources

The technological tools/resources used:

Stay in touch

License

The project is GNU General Public License v3.0.

About

Crimmit project task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors