Required:
- Docker - Container runtime
- Go 1.25.3+ - For code generation
- Make - Build automation (usually pre-installed on Linux/macOS)
Optional (for frontend development):
- Node.js 25+ - For rapid frontend iteration
New to these technologies?
-
Clone the repository
git clone <repository-url> cd <repository-name>
-
Configure environment
cp .env.example .env
Modify as needed for local development.
-
Build and run
make build make run
-
Access the application
- Open
http://localhost:8080in a browser - API available at
http://localhost:8080/api/v1/*
- Open
This project uses Docker for all builds and deployments. The Dockerfile handles:
- Installing Go dependencies
- Building the frontend with Node/Vite
- Copying built frontend to
server/web/ - Compiling the Go binary with embedded frontend
- Creating a minimal runtime image
All commands are defined in the Makefile.
make buildBuilds the Docker image tagged as csh-home. This runs the full build process: frontend compilation, Go code generation, and binary compilation with embedded assets.
make runRuns the containerized application. Loads environment variables from .env file and exposes port 8080.
make generateRuns go generate ./... to regenerate api/gen.go from api/openapi.yaml. Run this after modifying the OpenAPI specification.
make fmtFormats all Go code using go fmt. Run before committing changes.
make lintRuns golangci-lint for Go code and npm run lint for frontend code. Both run in Docker containers.
- Edit
api/openapi.yamlto add/change endpoints - Run
make generateto regenerate Go code - Implement handler methods in
api/server_*.go - Run
make buildto create a new Docker image - Run
make runto test changes
For faster frontend iteration without rebuilding the Docker image:
-
Start the backend container
make run
-
In a new terminal, start the frontend dev server
cd web npm install npm run dev
The Vite dev server runs on http://localhost:5173 (typically) with hot module reloading. All API requests (/api/*) are automatically proxied to the Docker container running the backend at http://localhost:8080. This allows rapid frontend changes without rebuilding the entire application.
When frontend work is complete, run make build to create a production Docker image with the embedded frontend.
- OpenAPI Specification - API spec format
- Gin Framework Guide - HTTP framework documentation
- oapi-codegen Documentation - Code generator
- Go embed Package - File embedding
- Docker Documentation - Container platform
- Vite Guide - Frontend build tool