A scalable e-commerce platform, and mono-repo microservices example, build using Go and Kratos framework.
This project implements a distributed e-commerce system with the following microservices:
- Shop Interface Service - Main API gateway and user interface layer
- User Service - User management, authentication, and profiles
- Product Service - Product catalog and inventory management
- Order Service - Order processing and management
- Payment Service - Payment processing and transactions
ecommerce-microservices/
├── api/ # Protocol buffer definitions
│ ├── user/service/v1/ # User service API
│ └── ...
├── app/
│ ├── shop/interface/ # Shop interface service
│ │ ├── internal/
│ │ │ ├── biz/ # Business logic layer
│ │ │ ├── data/ # Data access layer
│ │ │ └── service/ # Service layer
│ ├── user/ # User microservice
│ └── ...
└── configs/ # Configuration files
- Go 1.19 or higher
- Protocol Buffers compiler
- Docker (for containerized deployment)
-
Clone the repository
git clone https://github.com/danielmoisa/ecommerce-microservices.git cd ecommerce-microservices
-
Install dependencies
go mod download
-
Dependencies
docker-compose up -d
-
Generate Protocol Buffer files
make api
-
Run the services
# Start User Service
cd app/user
go run main.go
# Start Shop Interface Service
cd app/shop/interface
go run main.go
API documentation is available at:
- Swagger UI:
http://localhost:8000/q/swagger-ui/
This project is licensed under the MIT License - see the LICENSE file for details.