Australia/Melbourne
Projects

Go Microservice Template

Go Microservice Template project preview
October 15, 2026
Go Microservice Template packages a reusable service structure and local infrastructure for event-driven applications. It separates HTTP requests, background work, and scheduled jobs so a new project can start with clear service boundaries. The template is intended for SaaS backends, automation systems, internal tools, and other applications that need an API alongside asynchronous processing.
View repository
  • API provides the HTTP interface, with Chi routing and a transport layer.
  • Worker provides a separate process for background event tasks.
  • Scheduler provides an entry point for timed work.
The repository organizes these entry points under cmd/, with shared application code under internal/. Dedicated packages cover domain logic, events, services, storage, connectors, and platform concerns. NATS JetStream forms the messaging foundation. A generic event abstraction carries an identifier, topic, source, and payload, providing a common shape for messages between services. Postgres and Redis are included in the infrastructure stack, giving new applications a starting point for persistence and caching requirements. Docker Compose configuration is split into layers so projects can choose how much routing infrastructure they need:
  • Base stack runs Postgres, Redis, NATS, and the application services.
  • Nginx layer adds an internal reverse proxy and a shared API entry point.
  • Traefik overlay adds routing configuration for an existing external Traefik network.
Environment variables configure service addresses, database connections, ports, and routing names. This keeps deployment settings separate from application code. After cloning the repository and copying .env.example to .env, the Makefile provides commands for starting the stack and running the API locally:
Bash
make stack
make dev
Additional commands enable the routing layers:
Bash
make nginx
make traefik
The Traefik overlay expects its external Docker network to exist. The repository README documents that setup and the environment settings to change when adapting the template to a new project. The template focuses on service separation, messaging, and composable infrastructure. Observability, authentication middleware, Kubernetes manifests, gRPC, and other extensions are listed as future possibilities in the README. Explore the source and setup guide.