Go Web Project Scaffold
Scaffold a new Go web project following a proven single-binary architecture with vendored assets, templ templates, and htmx.
Scaffolding Process
- •Ask the user for: project name, Go module path, and a brief description of what the app will do
- •Run the scaffold script to generate the project skeleton
- •Customize the generated code for the user's specific needs
- •Run
./build.sh --generate --buildto verify the scaffold compiles
bash
python3 scripts/scaffold.py <project-name> --module <module-path> --dir <output-directory>
Architecture Reference
See references/architecture.md for the complete conventions: directory layout, build.sh structure, config pattern, route wiring, template structure, asset embedding, and CSS design tokens.
After Scaffolding
The generated project is a working baseline. Customize by:
- •Adding routes in
cmd/app/main.go - •Adding handlers in
internal/web/handlers/ - •Adding templ pages in
internal/web/pages/ - •Adding domain logic under
internal/ - •Extending settings structs for new config fields (gen-config picks them up automatically)
- •Running
./build.sh --generateafter editing.templfiles