├─ cmd/alexandria # Main binary source (main.go, server.go)
├─ alexandria # Core library code and unit tests
├─ web # Templating and static assets (css, fonts)
├─ Dockerfile # Container image definition
├─ manifest/ # Kustomize manifests for prod/staging
├─ package.json # Node tooling for asset pipeline
└─ go.mod / go.sum # Go module definition
- Go source lives under
cmd/for executables and top‑level packages for reusable code. - Tests are co‑located with the package they cover (
*_test.go). - Static web assets are under
web/xess/staticand compiled templates underweb/.
The service is deployed to a Kubernetes cluster. Production manifests are stored
under the manifest/ directory and are applied with Kustomize (e.g.,
kustomize build manifest/prod | kubectl apply -f -). The Docker image built
via docker buildx bake --load is pushed to the container registry and
referenced in the Kubernetes Deployment spec.
| Command | Description |
|---|---|
go build ./cmd/alexandria |
Compiles the server binary. |
go run ./cmd/alexandria |
Runs the server locally (reads env vars). |
npm run test |
Executes all repository tests (via npm script). |
npm install && npm run build |
Installs Node dependencies and builds web assets. |
docker buildx bake --load |
Builds the Docker image using the bake file. |
- Use gofmt (or
go fmt ./...) for formatting. - Follow golint/go vet recommendations – avoid exported names with underscores.
- Indentation: tabs (default Go style).
- Naming:
camelCasefor variables,PascalCasefor exported types and functions. - Linting:
go vet ./...andstaticcheck ./...are run in CI.
- Test files end with
_test.goand use the standardtestingpackage. - Name test functions
Test<Thing>and keep them focused. - Run coverage locally with
go test -cover ./.... - Aim for ≥ 80 % coverage on new code.
- Commit messages follow Conventional Commits:
<type>(<scope>): <description>. Examples:feat(server): add health endpoint,chore: update license. - PR description must include:
- A brief summary of the change.
- Linked issue number (
Fixes #123). - Any required migration steps.
- Screenshots for UI or asset changes.
- Keep PRs small and focused; request review after CI passes.
- Assisted‑by footer – when a commit is generated with AI assistance, append
a footer line to the commit message:
Assisted-by: GPT-OSS 120b
- Secrets are loaded via environment variables (see
README.md). - Do not commit
.envfiles; add them to.gitignore. - Run
go vetandstaticcheckbefore pushing to catch insecure patterns.
These guidelines aim to keep the codebase consistent and easy to contribute to. If you notice a gap, feel free to open an issue or submit a PR.