API Gateway with nodejs and microservices in gRPC with nodejs, python and golang. Examples for study purposes.
- Install docker
- Install docker-compose
- Install Makefile
-
Copy file
docker-compose.override.dist.yml
with namedocker-compose.override.yml
- Configure the environments:
API_KEY
is optional to monitor with amplify nginx
- Configure the environments:
-
To create proto interfaces in the project gRPC microservices in nodejs and python, use the script
script/protoc.sh
-
To start project using docker use the commands
COMMAND DESCRIPTION make dev Execute all application in mode development make dev-grpc-customers Execute grpc-customers application in mode development make dev-grpc-users Execute grpc-users application in mode development make dev-grpc-products Execute grpc-products application in mode development make dev-grpc-orders Execute grpc-orders application in mode development make dev-api-gateway-grcp Execute api-gateway-grcp application in mode development make prod-api-gateway-grcp Execute api-gateway-grcp application in mode production make lint-fix-api-gateway Execute command yarn lint:fix
in api gatewaymake protoc-grpc-customers Execute command yarn protoc
to app-customersmake protoc-grpc-users Execute command yarn protoc
to app-usersmake protoc-grpc-products Execute command script/protoc.sh
to app-productsmake nginx-start HOST_NAME=NGINX-01 Execute nginx-grpc application using hostname -
note: if start project nodejs in mode
production
change the scriptdocker/nodejs/entrypoint-server.sh
from
yarn dev
toyarn build && yarn start
-
Access api gateway in
http://localhost:3005
METHOD SERVICES GET /customers GET /customers/12385 POST /customers PUT /customers DELETE /customers/12385 GET /users GET /users/47 POST /users PUT /users DELETE /users/6 POST /users/login GET /products GET /products/3 POST /products PUT /products DELETE /products/5 GET /orders POST /orders
- To install BloomRPC access the guide
- Access Microservice Customers gRPC in
127.0.0.1:50051
- Access Microservice Users gRPC in
127.0.0.1:50052
- Access Microservice Products gRPC in
127.0.0.1:50053
- Access Microservice Orders gRPC in
127.0.0.1:50054