A practical example of NodeJS Microservices Architecture.
it is a simple eCommerce Application using Microservices Architecture without impact frontend. So each individual services will work independently to server the purpose and business logic.
- ./app: a simple frontend App
- ./customer: customer micro-services
- ./products: products micro-services
- ./shopping: shopping micro-services
- ./proxy: nginx files
- Visual Studio Code
- nvm / nodejs / npm / npx
- Javascript (React & Testing)
- Express
- MongoDb
- Studio 3T
- reactjs, Redux
- micro-services
- nginx
- docker, docker-compose
- jest-js
- cloudamqp
- Install NodeJS
- Install mongoDb
- Register and get a free Queue in cloudamqp or use a local Queue (more details here)
$ git clone repo_url
$ npm install
(in each folder: app, customer, shopping, products)
- Create .env.dev file in each folder (app, customer, shopping, products).
- Set the value of the variables based on the example file sample_env.
$ docker-compose -f docker-compose.yml up
-
dev:
$ npm run start
Important note: Take care that the app has setted only one url base + port to all services in code, assuming services are started with a reverse proxy (nginx). So, if you start each service in separate url and port, the app will not work for you.
$ npm run test
See postman json file in ./.doc/pstman
- EXDkgjU8DDU