Part 1: Building a Production-Ready Go Microservices Platform
Why I Started This Project
Project Structure
go-reliable/
βββ cmd/
β βββ api-gateway/
β β βββ main.go
β βββ order-service/
β β βββ main.go
β βββ notification-worker/
β β βββ main.go
β βββ ml-gateway/
β βββ main.go
βββ internal/
β βββ gateway/
β β βββ handler.go
β β βββ middleware/
β β β βββ auth.go
β β β βββ ratelimit.go
β β β βββ requestid.go
β β βββ router.go
β βββ order/
β β βββ handler.go
β β βββ repository.go
β β βββ service.go
β βββ notification/
β β βββ consumer.go
β β βββ sender.go
β βββ mlgateway/
β βββ client.go
β βββ handler.go
βββ pkg/
β βββ config/
β β βββ config.go
β βββ database/
β β βββ postgres.go
β βββ health/
β β βββ health.go
β βββ logger/
β β βββ logger.go
β βββ telemetry/
β βββ otel.go
βββ deployments/
β βββ helm/
β βββ argocd/
βββ Makefile
βββ go.mod
βββ go.sumShared Infrastructure (pkg/)
pkg/)Config Loading
Structured Logger
Database Connection
The API Gateway
Router Setup
Request ID Middleware
Rate Limiting Middleware
The Order Service
The Notification Worker
Graceful Shutdown
Multi-Stage Docker Build
The Makefile
What's Not in This Article
Where We Are
PreviousSRE Playbook: Operating Go Microservices in ProductionNextPart 2: Kubernetes Deployment with Helm Charts
Last updated