This project demonstrates a Go-based microservices architecture using gRPC and REST
├── docs # API Docs
├── init # Init Migration for Database
├── orderservice # Service for handle order
├── productservice # Service for handle product
├── gatewayservice # Service for API Gateway
├── skyrosgrpc # Package for Grpc Library
├── userservice # Service for handle user
├── docker-compose.yml # Docker compose file for all service
├── Dockerfile-orderservice # Docker file for orderservice
├── Dockerfile-productservice # Docker file for productservice
└── Dockerfile-userservice # Docker file for userservice
- gRPC Microservices: Each service is defined using protobuf and communicates via gRPC.
- Modular Structure: Separation of concerns with independent REST and gRPC entry points.
- Custom Middleware: Custom Echo middleware for request handling.
- Unit Testing: Mocks and golden files for testing services and APIs.
- Go
- gRPC
- Echo (HTTP Framework for REST)
- Protobuf (Service Definitions)
- Mockery (Mocks for Unit Testing)
Documentation using swagger
Go to docs
folder, and run this
go run main.go
and open this link to see the api documentation:
Using CLI version of https://github.com/golang-migrate/migrate
Make sure to set the .env file (see: .env.example).
To start and stop the Services, run:
make service-up
make service-down
Run migration.
make migrate-up
User Seller
"email": "user-seller@example.com",
"password": "password"
User Buyer
"email": "user-buyer@example.com",
"password": "password"