A backend-focused microservices project built with Go and gRPC. The system demonstrates how independent services communicate through strongly typed Protocol Buffers contracts while handling persistence, authentication, failures, and service reliability.
Client
|
v
API Gateway
:8080
|
gRPC
|
+-----v-----+
| Order |
| Service |
+--+-----+--+
| |
gRPC gRPC
| |
+-----v-+ +-v-------+
|Inventory| |Payment |
| Service | |Service |
+----+----+ +---+----+
| |
PostgreSQL PostgreSQL
- Exposes the external HTTP API.
- Converts HTTP requests to gRPC calls.
- Handles request validation and authentication.
- Maps gRPC responses and errors to HTTP responses.
- Creates and retrieves orders.
- Coordinates Inventory and Payment services.
- Manages the order lifecycle.
- Handles failures between dependent services.
- Manages product stock.
- Checks availability.
- Reserves inventory.
- Releases reserved inventory.
- Processes payments.
- Tracks payment status.
- Handles successful and failed transactions.
- Go
- gRPC
- Protocol Buffers
- PostgreSQL
- Docker
- JWT
- Prometheus
Services communicate internally using gRPC.
Gateway → Order Service
Order → Inventory Service
Order → Payment Service
Protocol Buffers define the contracts between services. Generated Go code is used for the gRPC clients and servers.
Create Order
|
v
Check Inventory
|
v
Reserve Stock
|
v
Process Payment
|
+---- Payment Failed ----> Release Stock
|
v
Create Order
This project focuses on:
- gRPC service communication
- Protocol Buffers
- Microservice boundaries
- Database-per-service ownership
- Deadlines and timeouts
- Retry handling
- Idempotency
- Authentication
- gRPC interceptors
- Graceful shutdown
- Health checks
- Structured logging
- Metrics
- Failure handling
- Concurrent request handling
grpc-microservices/
├── proto/
│ ├── order.proto
│ ├── inventory.proto
│ └── payment.proto
│
├── services/
│ ├── order/
│ ├── inventory/
│ └── payment/
│
├── gateway/
├── migrations/
├── docker-compose.yml
├── Makefile
├── go.mod
├── go.sum
└── README.md
- Project foundation
- Protobuf contracts
- Inventory gRPC service
- Payment gRPC service
- Order gRPC service
- Inter-service reliability
- PostgreSQL persistence
- HTTP API Gateway
- Authentication
- gRPC interceptors
- Docker setup
- Testing
- Observability
- Security hardening
- End-to-end validation
- Deployment
The goal is to build a practical Go microservices system that demonstrates real backend engineering concepts rather than simply creating multiple independent APIs.
The project will progressively introduce distributed communication, persistence, failure handling, security, testing, and observability.