A microservices-based trading system with separate services for user management/order placement and order matching/execution.
The project is organized into two independent microservices:
- User-Order Service (Port 8000): HTTP REST API for user authentication and order management
- Engine Service: Queue-based order matching and execution engine
For detailed architecture documentation, see MICROSERVICES_STRUCTURE.md.
- Go 1.21+
- Docker & Docker Compose
- PostgreSQL 13+
- Redis 7+
# Build user-order-service
go build ./cmd/user-order-service
# Build engine-service
go build ./cmd/engine-servicedocker-compose -f docker-compose.yml up --buildServices will be available at:
- User-Order Service:
http://localhost:8000 - PostgreSQL:
localhost:5432 - Redis:
localhost:6379
├── cmd/ Service entry points
├── services/ Service implementations
├── internal/ Shared packages
├── docker-compose.yml Docker orchestration
└── go.mod Go module file
- MICROSERVICES_STRUCTURE.md - Complete architecture and design
- RESTRUCTURE_CHECKLIST.md - Implementation checklist
Copy .env.example to .env and configure:
cp .env.example .envUpdate with your database and Redis credentials.
POST /register- Register new userPOST /login- Login user
POST /order/create- Place new orderGET /order- Get all ordersPOST /order/sort- Get orders with filters
All endpoints except register/login require JWT authentication.
The codebase follows the standard Go project layout:
- Business logic in
services/*/directories - Shared utilities in
internal/directory - Entry points in
cmd/directory
See MICROSERVICES_STRUCTURE.md for detailed information.