This project demonstrates a microservices architecture using Go, gRPC, Redis, and Docker. It consists of three main services:
- Auth Service (gRPC)
- Order Service (Redis)
- Product Service (HTTP)
- Handles user authentication and authorization
- Implements gRPC for communication
- Port: 8000
- Manages order processing and storage
- Uses Redis for data persistence
- Port: 8081
- Provides product information and handles product-related operations
- Acts as an API gateway, communicating with both Auth and Order services
- Port: 8082
- Docker
- Docker Compose
- Go 1.21 or later (for local development)
-
Clone the repository:
git clone https://github.com/caiotheodoro/microservices-project.git cd microservices-project
-
Build and run the services using Docker Compose:
docker-compose up --build
-
The services will be available at:
- Auth Service: localhost:8000 (gRPC)
- Order Service: http://localhost:8081
- Product Service: http://localhost:8082
GET /products
: Retrieve a list of productsPOST /order
: Create a new orderGET /health
: Check the health of the service
To run the services locally for development:
-
Install dependencies for each service:
cd auth-grpc-microservice && go mod download cd ../order-redis-microservice && go mod download cd ../product-service && go mod download
-
Run each service individually:
cd auth-grpc-microservice && go run cmd/main.go cd ../order-redis-microservice && go run main.go cd ../product-service && go run cmd/main.go