Skip to content

Contributing to Academy

Thank you for helping. Academy is in a public beta: bug reports, fixes, translations and documentation are the most welcome contributions right now. For a larger change, open an issue first so we can agree on the approach before you build it.

Issues are for contributions and for bugs in the code. Questions about an account, data, billing or support don’t go into issues: ask through the support tickets in the portal (Help → Support tickets). Security vulnerabilities never go into a public issue; report them as SECURITY.md says.

Academy is licensed under the GNU AGPLv3 (AGPL-3.0-only), and contributions are accepted under the same licence: what you contribute is licensed to everyone under AGPL-3.0-only, as the rest of the code is. There is no contributor licence agreement and no separate commercial licence (ADR 0178).

The one exception is the n8n node in integrations/n8n-nodes-academy, which is MIT; contributions there are MIT.

Sign off every commit to confirm you may contribute it under that licence (Developer Certificate of Origin):

Terminal window
git commit -s -m "What the change does"

This adds Signed-off-by: Your Name <you@example.com> to the message. Only contribute code you wrote yourself or whose licence allows it to be included here; new dependencies must pass pnpm licences:check.

Follow Local development: Node.js 26+ (with npm install -g corepack@0.36.0 && corepack enable, since Node 26 ships no corepack), pnpm 10, ffmpeg, and Docker for PostgreSQL and Redis (docker compose up -d). The defaults in apps/api/.env.example and apps/web/.env.example work as they are. The developer handbook’s quickstart goes on from there to demo data and the first API calls.

Terminal window
pnpm format # Prettier; CI fails on unformatted code (pnpm format:check)
pnpm lint # Oxlint
pnpm typecheck
pnpm test # needs PostgreSQL and Redis from docker compose; the whole suite takes about a quarter of an hour
pnpm licences:check # after adding or updating a dependency

To run only the tests you touched: pnpm --filter @academy/api exec vitest run test/<name>.test.ts.

  • Prettier formats TypeScript, JavaScript, JSON, CSS and YAML at 120 characters a line (.prettierrc.json). Markdown and generated files are left out (.prettierignore). Let the editor format on save; the recommended VS Code extensions are in .vscode/extensions.json.
  • Oxlint (.oxlintrc.json) fails on code that is wrong (category correctness, an unused disable comment too). Some rules are warnings whose number may not grow (options.maxWarnings): lower it when you remove one, never raise it.
  • Size limits (.oxlintrc.size.json, portal ADR 0461), checked by pnpm lint through scripts/size-check.mjs. They count lines without blank lines and comments, and leave tests out:
    • a file at most 500 lines;
    • a function at most 100 lines (a React component in a .tsx file at most 250);
    • complexity at most 20, nesting at most 4 deep, at most 5 parameters. The places that were past them already are in size-baseline.json. They may only shrink: when one got smaller, pnpm size:update lowers its number. A new place past a limit, or a listed one that grew, fails. Then split the file or the function. Only a person may decide to let one through, by editing the baseline in the PR and saying why.
  • An exception names its reason: // oxlint-disable-next-line <rule> -- <why>.
  • The help explains every function (ADR 0489), checked by apps/web/src/help/coverage.test.ts: every button, field, tab and menu entry of the app (a short English text of the catalog, see apps/web/src/help/coverage.ts) is named in the learners’, trainers’ or administrators’ handbook, with what it does. A new label nobody explains fails; explain it in the handbook page of its screen. The labels unexplained when the check began are in apps/web/src/help/coverage-baseline.json. It may only shrink: once a listed label is explained, UPDATE_HELP_COVERAGE=1 pnpm --filter @academy/web exec vitest run src/help/coverage.test.ts takes it out. Only a person may let a new one through, by adding it there in the PR and saying why.
  • The commit that formatted the whole repository is in .git-blame-ignore-revs; run git config blame.ignoreRevsFile .git-blame-ignore-revs once so git blame skips it.
  • ESLint is not used: typescript-eslint does not support TypeScript 7.

The API tests run one file after the other unless API_TEST_WORKERS says how many workers to use (CI uses 4, ADR 0360). Each worker gets a copy of the test database and the next Redis database number, so a parallel run needs that many free Redis databases from TEST_REDIS_URL’s number on.

CI skips the API suite for a pull request that changes only the web app, the docs or the deploy scripts (docs/deploy.md). A test or source file in apps/api that reads a file outside it goes into scripts/ci-changes.mjs.

Some files are generated, and a test fails while they are out of date. Regenerate them when you change what they describe:

You changed Run It updates
a setting in apps/api/src/config.ts pnpm --filter @academy/api config:doc docs/configuration.md
an MCP tool pnpm --filter @academy/api mcp:tools-doc docs/mcp-tools.md
an ADR in docs/adr/ pnpm docs:adr-index docs/adr/README.md
a route of the automation API, or a schema it uses UPDATE_OPENAPI_DOC=1 pnpm --filter @academy/api exec vitest run test/openapi.test.ts docs/integrations/openapi-v1.json (the docs site’s API reference)

Interfaces need a changelog entry. A pull request that changes what other systems rely on (a route, field, scope or error code of the automation API, a webhook event or payload, OAuth, SCIM, a stable MCP tool marked ★, an endpoint of LTI, SCORM, cmi5 or xAPI) adds an entry to docs/changelog.md in the same pull request, with the date and what integrators have to do. A deprecation names the date from which the old way stops, at least 12 months ahead. Without the entry the pull request is not merged.

  • Read the neighbouring code first and write the same way: its naming, comment density and idiom. Prettier formats the code and Oxlint checks it (“Format and lint” below).
  • Where code goes: apps/api/README.md and apps/web/README.md (ADR 0462). Oxlint rejects an import from another area’s routes.ts.
  • API: a module per area in apps/api/src/modules/, request and response shapes in packages/contracts (zod), checked with parseBody. Every table holding an organisation’s data has row-level security; tests in apps/api/test/ run against a real PostgreSQL.
  • Database changes are new files in apps/api/migrations/, numbered after the highest one there. Never edit a migration that has been merged. Every new migration says in its first lines whether the code running now survives it (ADR 0427):
    • -- deploy: expand: new tables, nullable columns or ones with a default, new indexes, functions or policies, data added. It may go out at any time, and a deploy that fails goes back to the old code only.
    • -- deploy: contract: a drop, a rename, a new not null, a changed type, deleted data (with -- backup before:), narrower rights. It goes out only during a locked maintenance window, and a deploy that fails also puts the database back.
    • To rename or remove something without a window, split it: expand first (the code writes both and reads the new), then contract in a later window. node scripts/release/migration-classes.mjs --check (also a CI step) finds a migration without its class.
  • Web: Next.js App Router in apps/web. Every text a person sees goes through the message files in apps/web/src/lib/i18n/messages/, in all six languages (en, de, fr, es, it, et; packages/contracts/src/languages.ts): a test fails when one is missing. If you can’t write a language, put the English text there and say so in the pull request.
  • MCP: a new API route needs an MCP tool with the same rights, or an exclusion saying why it has none; the coverage test in apps/api/test/mcp.test.ts checks it (docs/mcp.md).
  • Decisions that change how something works get an ADR in docs/adr/ with the next free number; an ADR that changes an earlier one says so in its header (Changes:, Replaces:).
  • Documentation: the handbooks for learners, trainers and organisations are Markdown in apps/docs/src/content/docs/en/<handbook>/, in English for the beta (ADR 0274); the portal’s Help and the docs site read the same files. The guides for servers and developers stay in docs/, and the docs site copies them in when it is built (apps/docs/src/repo-docs.mjs lists them). A new screen gets its page in exactly one handbook (ADR 0274).
  • Commit messages say what the change does for the people using it, in a full sentence.

This repository is exported from the maintainers’ own Git server once per release. A pull request merged here is carried over there and comes back with the next export, with your authorship and sign-off kept (the open-source projects).

Please don’t open a public issue for a vulnerability. See SECURITY.md.