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.ymlwith namedocker-compose.override.yml- Configure the environments:
API_KEYis 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:fixin api gatewaymake protoc-grpc-customers Execute command yarn protocto app-customersmake protoc-grpc-users Execute command yarn protocto app-usersmake protoc-grpc-products Execute command script/protoc.shto app-productsmake nginx-start HOST_NAME=NGINX-01 Execute nginx-grpc application using hostname -
note: if start project nodejs in mode
productionchange the scriptdocker/nodejs/entrypoint-server.shfrom
yarn devtoyarn build && yarn start
-
Access api gateway in
http://localhost:3005METHOD 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

