E-commerce platform built with Go microservices.
- Go 1.26.1
- gRPC + Protocol Buffers
- Echo v4 (HTTP Gateway)
- PostgreSQL + GORM
- Redis
- PASETO (token authentication)
toko/
├── packages/ # Shared packages
│ ├── cache/ # Redis wrapper
│ ├── config/ # Viper config
│ ├── database/ # PostgreSQL/GORM
│ └── logger/ # Logrus logger
├── services/ # Microservices
│ ├── auth-service/ # gRPC auth (login/register/token)
│ └── gateway/ # HTTP API Gateway
└── deployments/ # Deployment configs
| Service | Port | Protocol | Description |
|---|---|---|---|
| auth-service | 8080 | gRPC | User authentication |
| gateway | 8080 | HTTP | REST API router |
- Go 1.26.1+
- Docker & Docker Compose (for PostgreSQL & Redis)
- protoc
docker-compose up -dThis starts:
- PostgreSQL on port
5432 - Redis on port
6379
cd services/auth-service
cp config.yml.example config.yml
# Edit config.yml with your DB/Redis credentials
go run main.go servercd services/gateway
cp config.yml.example config.yml
# Edit config.yml
go run main.go server| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/auth/register | No | Register new user |
| POST | /api/v1/auth/login | No | Login user |
| GET | /api/v1/me | Yes | Get current user |
cd services/auth-service
make proto# From project root
go run ./services/auth-service/main.go server
go run ./services/gateway/main.go server