/microservices

Independent microservices (zero framework)

Primary LanguageTypeScriptApache License 2.0Apache-2.0

NodeJS Microservices based on microservice-nodejs-lib

GitHub GitHub package.json dependency version (dev dep on branch) semantic-release

Staging: Build staging
Prod: Build prod

Microservices list:

Use npm run create-microservice name for create new microservice from template.

How to start

Use docker-compose to run all in one command (docker-compose up) or:

  1. Run Inverted Json job server.
docker run -it -p 8001:8001 lega911/ijson --log 47
  1. Run gateway microservice.
docker run -it -p 8001:8001 ghcr.io/lomray-software/microservices/gateway:latest-staging
  1. Run other needed microservices (the same actions as in step 2, just replace docker image).
  2. That is all. Check it:
curl -X POST http://127.0.0.1:3000
   -H 'Content-Type: application/json'
   -d '{"id":"unique-id-1","method":"microservice-name.method","params":{}}'

Chek all available microservices

Microservices also available like npm packages:

npm i --save @lomray/microservice-NAME

# for e.g.
npm i --save @lomray/microservice-configuration

Complete example

Just run:

git clone git@github.com:Lomray-Software/microservices.git
cd example
docker-compose up

see example requests in file requests.http

Integration tests

  1. Run all microservices
  2. Run commands:
cd tests
npm run test

TODO

  • Add api service generator (backend) (generate api service for microservices based on metadata endpoint)
  • Add api service generator (frontend)