Skip to content

Example for dockerized two microservices, two mongo databases, one redis instance and nats for communication between services. NodeJS + NestJS

Notifications You must be signed in to change notification settings

mac-lisowski/flip-shop-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flip-shop-task

stack: nodejs, nestjs, nats, mongodb, redis

Dockerized two microservices, two mongo databases, one redis instance and nats for communication between services.

cron-service

Here is part responsible for scraping API once a minute and sending events to transport layer. This service is not exposing any ports.

cd ./cron-service && npm run install --force && npm run test

ep-service

Service responsible for consuming events emitted by cron-service and processing them accordingly.

cd ./ep-service && npm run install --force && npm run test

This instance is exposing port 3000 and three endpoints, which should be available via localhost:

  • GET /top10-sales-value
  • GET /top10-orders-count
  • GET /top10-most-bought

Once GET request is received endpoints will return data stored in Redis.

Note regarding /top10-most-bought Current implementations would allow to make easily extension of this method and it could be returning top 10 for any given date.

Installation

To run it you need to have Docker, node v14.18.3.

Run environment:

docker-compose up

About

Example for dockerized two microservices, two mongo databases, one redis instance and nats for communication between services. NodeJS + NestJS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published