A minimal but production-minded Go HTTP service starter for backend engineers who want a clean service baseline without adopting a heavyweight framework.
This repo is intentionally small enough to understand in one sitting, but structured enough to feel like the beginning of a real internal service.
- Project page: happysnaker.github.io/go-service-starter
- Proof before payment: support/#proof-before-payment
- 10-second support router: support/#sponsor-router
- Sponsor prospect pipeline: docs/sponsor-prospect-pipeline.md — route Go service starter / backend template customers to the right proof, CTA, support note, and guardrail before paying or asking for review
- Reuse: click Use this template on GitHub to generate your own service baseline faster
Many Go starter repos fall into one of two buckets:
- they are too tiny to reuse outside a tutorial
- they ship so much scaffolding that you are effectively adopting a framework
go-service-starter aims for a middle ground:
- standard-library first
- clear service boundaries
- sane operational defaults
- easy to extend for real backend work
- HTTP server based on
net/http - environment-based configuration loading
- structured JSON logging with
log/slog healthz,readyz, andversionendpoints- graceful shutdown on
SIGINT/SIGTERM - build metadata placeholders for versioned delivery
- lightweight layout for internal APIs and small services
flowchart LR
Env["Environment variables"] --> Config["internal/config"]
Config --> Main["cmd/api/main.go"]
Main --> Server["internal/httpserver"]
Build["internal/buildinfo"] --> Server
Server --> Routes["/, /healthz, /readyz, /version"]
Server --> Logs["structured request logs"]
See also: docs/architecture.md
cmd/api/ service entrypoint
internal/config/ env config loading and defaults
internal/httpserver/ routes, server wiring, request logging
internal/buildinfo/ version / commit / builtAt placeholders
configs/service.env.example example local env file
docs/ architecture and hardening notes
Dockerfile minimal container build
Makefile common local commands
| Endpoint | Purpose |
|---|---|
GET / |
basic service response |
GET /healthz |
liveness signal |
GET /readyz |
readiness signal |
GET /version |
build metadata placeholder |
cp configs/service.env.example .env
set -a && source .env && set +a
go run ./cmd/apiThen hit the service:
curl http://localhost:8080/
curl http://localhost:8080/healthz
curl http://localhost:8080/readyz
curl http://localhost:8080/versiondocker build -t go-service-starter:dev .
docker run --rm -p 8080:8080 --env-file configs/service.env.example go-service-starter:devThis starter is a good fit when you want:
- a clean baseline for a small backend service
- a teaching repo for Go service structure
- a lightweight internal API template
- a foundation you can grow into metrics, tracing, auth, and persistence
It is not trying to be:
- a batteries-included platform framework
- a complete microservice platform
- an opinionated replacement for your whole internal stack
Good next additions for a serious service:
- request IDs and panic recovery middleware
- metrics / tracing / pprof endpoints
- configuration validation and startup checks
- authn / authz middleware
- persistence wiring and dependency boundaries
- background workers and drain handling
- CI, releases, and deployment manifests
See docs/production-hardening.md for a more complete checklist.
If you like this repo, you may also want:
go-http-middleware-kit— reusablenet/httpmiddleware for request IDs, structured logs, panic recovery, and timeoutsbackend-engineer-checklist— a practical roadmap for backend, systems, and distributed-systems fundamentalssystem-design-checklist— a practical framework for interviews, design reviews, and distributed-systems tradeoffs
If this starter saves you time, consider:
- starring the repo
- sharing it with other backend engineers
- supporting ongoing maintenance via the support page: happysnaker.github.io/support
- current cross-project sponsor brief: Sponsor one-pager
- sponsor / paid-support intake replies: share-kit intake replies
- deploy-read sample before paying: happysnaker.github.io/review/deploy-read-sample
- shortest support thread: If go-service-starter helped, here is the shortest support path
- if you want lightweight async feedback on a public GitHub profile, repo README, or portfolio page, details are also available on the support page
If this starter saved you setup time for a new service, small direct support is especially helpful.
Typical thank-you support amounts that fit this repo:
- ¥9.9 — if the README / layout saved you a detour
- ¥19.9 — if it helped you bootstrap a real internal service faster
- best payment note —
go-service-starter - fastest path — tip directly if this starter saved you setup time; use ¥29.9 / ¥99 only if you want feedback back
- ¥99 — if you want compact async feedback on your own public service repo / README
- sponsor prospect pipeline: route Go service starter / backend template customers through the prospect pipeline first so the ask maps to proof, CTA, support note, and guardrail before payment: https://github.com/happysnaker/happysnaker/blob/master/docs/sponsor-prospect-pipeline.md
- sponsor conversion scorecard: classify Hot / Warm / Nurture / No-send before asking for support or paid review: https://github.com/happysnaker/happysnaker/blob/master/docs/sponsor-conversion-scorecard.md
- public issue privacy guardrail: do not paste private logs, credentials, QR codes, payment screenshots, internal URLs, or raw live integration output in public issues; use the intake replies first.
MIT