Contributing
Issues and pull requests are welcome. This repository is strict about verifiable changes: CI checks formatting, lint, swagger drift, and tests, and documentation must ship in the same change.
Get running
Section titled “Get running”pnpm installcd app/server && go mod downloadThe backend needs an external NATS with JetStream:
docker run --rm -p 4222:4222 nats:2.10-alpine -jsFull steps: Local development.
Branch model
Section titled “Branch model”| Branch | Purpose | Rules |
|---|---|---|
main | Release trunk | Pull requests only; Quality must pass |
develop | Daily integration | Direct pushes allowed; short-lived branches merge back here |
feat/* fix/* docs/* … | Short-lived work | kebab-case, deleted after merge |
Names look like feat/server/space-tree or fix/web/login-redirect. The type prefix must come
from commitlint’s type-enum: feat fix docs style refactor perf test chore
build ci revert types wip.
Commits
Section titled “Commits”Conventional Commits:
feat(server): support include_sub when listing postsfix(web): keep the redirect parameter after logindocs(api): document the pagination ceilingcommitlint runs from the lefthook commit-msg hook. wip/* branches never merge to trunk.
Code conventions
Section titled “Code conventions”Backend (Go)
Section titled “Backend (Go)”- One-way layering:
handler → service → repository → db - Writes are
POSTwith action suffixes; responses go throughpkg.Success/pkg.Fail/pkg.HandleError - New error codes live only in
internal/pkg/errors.go - New services are wired explicitly in
server/wiring.go; a missing mapping is a compile error - Before pushing:
gofmt,go vet ./...,go test ./...
Frontend (React / TypeScript)
Section titled “Frontend (React / TypeScript)”- Pages in
app/web/app/**, domain components inapp/web/components/<domain>/ - New admin page: create
app/web/app/admin/<route>/page.tsx, register the menu entry incomponents/admin/layout/admin-shell.tsx, and the permission inlib/admin/auth/route-access.ts - Format and lint with
pnpm checkfrom the root
cd app/server && go test ./...pnpm checkbash feedchamber_test.sh -all # backend must be runningNew endpoints should cover the happy path, insufficient permission, and invalid input. Bug-fix PRs should include a regression check in a unit test or the API script.
Documentation
Section titled “Documentation”Documentation is part of the change and CI enforces it:
- Behaviour changes: update the relevant
AGENTS.md - API changes: run
make swagand commitopenapi.json(otherwiseswag-checkfails) - User-facing changes: update the matching page here; the docs build validates internal links and the base prefix
Authoring rules: app/docs/AGENTS.md.
Pull request checklist
Section titled “Pull request checklist”- Branch name follows
<type>/<scope>/<desc> - Commit messages follow Conventional Commits
-
gofmt,go vet, andgo testpass -
pnpm checkpasses - API changes regenerated
openapi.json - Affected
AGENTS.mdfiles and docs pages updated - Description explains why the change exists and how it was verified
Security and conduct
Section titled “Security and conduct”- Report vulnerabilities privately, per SECURITY.md
- Discussion follows the Code of Conduct