Prerequisites
Before you begin, ensure you have the following tools installed:- Go 1.26+ - Download Go
- Docker - Get Docker
- goose - Database migration tool
- sqlc - SQL code generator
Initial Setup
Run the setup script
The interactive setup script helps you configure optional features:This script will guide you through enabling or disabling features like PostgreSQL support.
Configure environment variables
Copy the example environment file and customize it:Edit
.env to configure your settings:Available Make Commands
The project includes aMakefile with commonly used development commands:
Development Commands
| Command | Description |
|---|---|
make dev | Run the application locally |
make build | Compile binary to bin/template |
make test | Run tests with race detector |
make lint | Static analysis via go vet |
make fix | Modernize code via go fix |
make format | Format code via go fmt |
make generate | Run code generation (sqlc) |
Quick Examples
Customizing Your Project
After the initial setup, customize the template for your use case:Replace template package
The
pkg/template/ directory contains skeleton service code. Replace this with your own domain logic.Update entrypoint
Modify
cmd/template/main.go to wire up your services and configure application startup.Running the Application
Once setup is complete, start the application:go run ./cmd/template, which:
- Compiles and executes your code
- Loads environment variables from
.env - Starts with hot reload during development
Next Steps
Docker Setup
Run the full stack with Docker Compose
Database Setup
Configure PostgreSQL and run migrations
Testing
Write and run tests
