main.go,routes.go,handlers.go,template.go,utils.goare the core Go entrypoints, routing, handlers, and helpers.templates/holds HTML templates;static/contains CSS, images, and other assets.data/stores markdown content, manifests, and data files used by the site.scripts/contains Python utilities for content/image processing and data automation.- Tests live alongside source in
*_test.gofiles (e.g.,handlers_test.go).
go run .runs the site locally athttp://localhost:8080.make testrunsgo test -vfor all packages.make lintrunsgolangci-lintchecks;make formatauto-fixes lint issues.make webpconverts images to WebP;make blog-imagesprocesses images for a new blog post.make deployruns the fullallpipeline and deploys to Google App Engine (app.yaml).
- Go formatting follows
gofmtconventions viagolangci-lint run --fix. - Use Go naming:
CamelCasefor exported identifiers,camelCasefor unexported. - Keep files grouped by feature; tests mirror file names (e.g.,
routes.go→routes_test.go).
- Primary framework is Go’s built-in
testingpackage. - Name tests
TestXxxin*_test.go. - Run the full suite with
make testbefore submitting changes.
- Commit messages are short, imperative, and descriptive (e.g., “Update stats data”, “Fix border on light mode”).
- PRs should include a clear description, relevant links to issues, and screenshots for UI/template changes.
- Note any data or content updates (e.g.,
data/orstatic/additions) in the PR description.
- Deployment requires Google Cloud SDK auth (
make auth) andgcloudsetup. - Strava-related scripts may use
STRAVA_ACCESS_TOKEN; don’t commit secrets or tokens. - Python scripts assume Python 3 and may need extra packages (see script headers or README).