A template repository for starting a new Go service.
Business logic code is separated from infrastructure, making the system easier to test and change if needed. It also includes common boilerplate files you will likely need.
Inspired by Clean Architecture and golang-standards/project-layout.
See go-project-structure.
The .claude/ directory in this repo is the author's centralized agent setup
(rules, skills, session analysis).
- Mindset and guidelines for using AI effectively
- Agent workflow and basic concepts
- Tool-specific settings: rules, skills, MCP
- Copy this directory, rename it to your new project name,
then remove the
.gitfolder. - In
.claude/, keep onlyCLAUDE.md(project rules) andsettings.json(deny reading secrets). Remove everything else (skills, scripts, and shell helpers are for the author's personal workflow). - Update the module path in
go.modand all import statements (use Replace in All Files or a similar IDE feature). - Rename
cmd/mainto something meaningful (e.g.cmd/shop-assistant) and update the Dockerfile build path and any scripts that reference it. - If you use Docker or config, update project-specific names (e.g. database name, container names).
Environment variables are loaded from config/.env or config/.env.example.
See config/.env.example for configuration details.
Run all services except the main application with docker compose, then run the application directly with Go (or debug mode in your IDE).
# Start all services except the main application
docker compose up -d --scale application=0
# Run the application locally
go run ./cmd/mainTo start fresh and remove all existing persistent data:
docker compose down -v
# then compose upBuild and run all services including the main application.
The application will be available at http://host:20808.
For production, use a secret management solution (e.g. Bitwarden Secrets Manager).