Contributing workflow
You need Node 24 (see .nvmrc) and Docker to test the container. The bridge repository also needs .NET 10 and Python 3.
npm installnpm run devVite listens on port 5173 and proxies /api and the WebSocket to the API on port 3003. scripts/dev.env sets placeholder keys and DEV_AUTH_BYPASS_USER, which refuses proxied requests and non-localhost hosts. Put overrides in .env.local and data in .dev-data, and both are gitignored. scripts/seed-demo.sh seeds demo data.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
npm test |
Runs Vitest for the server, web app, shared code and supervisor. |
npm run typecheck |
Type-checks the web app, server and panel. |
npm run lint |
Runs oxlint. CI adds --deny-warnings. |
npm run build, build:admin, build:server |
Builds the web app, the panel and the server bundle. |
npm run db:migrate |
Applies the schema. |
npm run contest:replay -- --template <id> --cabrillo <log> |
Scores a past log offline. |
npm run build:schema |
Regenerates the template JSON Schema. Commit the result. |
npm run build:theme-schema, build:example-theme |
Builds the theme manifest schema and the example package. |
npm run build:maps |
Regenerates web/public/maps/*.json. Commit the result. |
node scripts/build-cty.ts <cty.csv> <version> <date> |
Rebuilds the country snapshot. |
The drift tests fail on purpose. They cover the template schema, design tokens, auth touchpoints, text keys and brand names. Regenerate the file instead of bypassing the test.
In Net, use npm run dev, test, check and migrate:local. In the docs, use npm run dev and build.
Rules for new code
Section titled “Rules for new code”- Put no club-specific values in code. Those are instance settings.
- Never read
process.envdirectly. Add a setting toserver/config.ts. - Import no provider outside
server/lib/auth/andweb/src/lib/auth/. - Never hard-code the product name. Use
BRAND, or{product}inshared/text.json. - Keep outside services off the critical path.
- Add no native dependencies, and use only AGPL-3.0 compatible licenses.
- Put no secrets or personal data in the repository, including tests and fixtures.
- Write contests as v1 JSON templates with no code, and keep the reserved hooks.
- Keep
server/lib/auth/TOUCHPOINTS.mdcurrent. - Add new data or imagery sources to the Licenses page.
- Audit mutations inside their transaction, and publish realtime events after the commit.
- Put long text in
shared/text.json. - Add a golden test for any scoring change.
Branches and releases
Section titled “Branches and releases”A pull request must pass typecheck, lint at zero warnings, tests, the web and admin builds, and the image and Compose smoke tests. Work for a later release is an issue in that milestone.
Bump version in shared/version.json for user-facing releases and leave build to CI. If production needs anything when it moves to a new version, such as a setting, a migration or a data fix, put it in the cutover notes in the same pull request. Do not act on it without a maintainer’s go-ahead.
| To add | Start at |
|---|---|
| A setting | SETTINGS in server/config.ts, a label in shared/text.json under settings, then the Settings reference. |
| A migration | A new server/migrations/NNNN_name.sql, STRICT with CHECK. Never edit a migration that has been applied. |
| A route | A sub-app in server/routes/ with a permission check, an audit row in the transaction, and a test. |
| A permission | shared/roles.ts (and ADMIN_AREA_PERMISSIONS), a description in shared/text.json, and tests. |
| A contest | A template with embedded tests in shared/contest-engine/templates/. See Contest engine. |
| A program like POTA | shared/programs/ and server/routes/programs.ts. |
| A theme | Model it on scripts/example-theme/. Never commit one. |
| A radio type | Hamlib covers most radios. A native backend changes the protocol. See Radio bridge. |
| A docs page | A file in src/content/docs/ plus an entry in the sidebar in astro.config.mjs. |
Before you open a pull request
Section titled “Before you open a pull request”- Update the tests, and make sure
npm test,typecheckandlintpass. - Check that the diff and any screenshots contain no real names, callsigns, hosts, paths or secrets.
- Regenerate generated and mirrored files.
- For a user-visible change, note which docs pages it affects.
- For a scoring change, add a golden test. For a sign-in change, test both providers.