A Go-based gRPC backend service for the EGP (Ebisu-GP - Ebisu Beer Grand Prix) system, built with Clean Architecture principles.
- Model Layer: Database models using GORM with PostgreSQL
- Repository Layer: Data access layer with interfaces
- UseCase Layer: Business logic implementation
- Router Layer: gRPC server with Protocol Buffers
- Go 1.23.4
- PostgreSQL with PostGIS extensions
- GORM v2 ORM
- gRPC with Protocol Buffers
- Docker Compose for development
- Nginx reverse proxy
# Start all services
make up
# Run database migrations
make db-migrate-up
# Test the readAPI
make grpcurl-shopsmake up # Start all services
make down # Stop all services
make logs-api # View API logs
make logs-db # View database logs
make logs-web # View nginx logs# Create new migration
make db-migrate-create name=your_migration_name
# Run migrations
make db-migrate-up
# Rollback migrations
make db-migrate-downmake run # Run the application locally
go run main.go # Alternative way to runThe service implements EgpService with endpoints for:
GetShops- Retrieve shop listingsGetShop- Get individual shop detailsGetShopsTotal- Get total shop countAddStamp- Add user stampDeleteStamp- Remove user stamp
All endpoints require API key authentication via metadata.
Required environment variables (typically in .env file):
DB_USER,DB_PASS,DB_HOST,DB_PORT,DB_NAME,DB_SCHEMAAPI_PORT,API_KEYLOCATION_NAME(timezone)
The database uses PostgreSQL with a schema named egp. Key tables include:
events- Event informationshops- Shop details with location and time datastamps- User stamp collectioncategories- Shop categoriesbeer_types- Beer type classificationsconfig- Application configuration
- gRPC API: 50051
- Nginx reverse proxy: 8080