Skip to main content

Development

Find your way around the repository, run the console against a mock API, run the checks and tests, and see which files Nova generates.

Repository Layout

PathContents
apps/botThe bot, control panel, and worker workspace, discord-stonker-bot-app-bot
apps/docsThis documentation site, discord-stonker-bot-docs
packages/dockerThe s6-overlay service definitions and root filesystem for the image
scriptsRepository maintenance scripts
testsRepository-level tests, such as the Docker architecture checks
DockerfileThe multi-stage image build
compose.ymlThe appliance's Docker Compose file
nova.config.jsonProject identity and workspace settings for Nova

Workspaces and Commands

The repository uses npm workspaces with Node.js 22, 24, or 26.

CommandWhat it does
npm run dev --workspace discord-stonker-bot-app-botRuns the bot's src/index.ts with tsx watch, plus the console's Vite dev server, but not the web process or the worker
npm run dev:web --workspace discord-stonker-bot-app-botStarts the console's Vite dev server on port 5175, which sends /api and /media requests to the web process at http://127.0.0.1:22604, such as a running appliance
npm run mock --workspace discord-stonker-bot-app-botStarts the console on port 5175 against a mock API, with no database or bot needed
npm run check --workspace discord-stonker-bot-app-botRuns the bot's lint, four type checks, and tests
npm run build --workspace discord-stonker-bot-app-botTranspiles the bot into apps/bot/build and builds the console into apps/bot/build/console
npm run e2e --workspace discord-stonker-bot-app-botBuilds the image as discord-stonker-bot:e2e and runs the Playwright smoke test against it
npm run deploy:containerBuilds and starts the appliance with Docker Compose

For the documentation site, run npm run check and npm run build from apps/docs.

The Mock API

npm run mock serves the console at http://localhost:5175/ with an in-memory API, so you can try every page without Docker.

  • What it has — Two servers, the real feature catalog and editors, users of every role, access tokens, notification destinations, and live logs.
  • Lost key — Start it with MOCK_KEY_REPLACED=true to see the Saved secrets were removed notice and a paused notification destination.
  • Signing in — The terminal prints the mock setup code and the test accounts you can use after setup.
  • Resets — Everything lives in memory, so restarting the command starts over.

Tests

  • Unit tests — Vitest files named *.test.ts sit next to the sources in apps/bot/src/lib.
  • Route tests — Files in apps/bot/src/routes run the whole Express app against PGlite, an in-memory PostgreSQL, with every migration applied, through the helpers in apps/bot/src/tests/support.
  • Repository tests — tests/ checks the Docker architecture and the project setup.
  • End-to-end tests — apps/bot/tests/e2e holds a Playwright smoke test that starts the built image, adds one Discord server straight to its database, and drives the control panel in Google Chrome without contacting Discord. It reads the setup code from the container log, creates the Owner, signs in again with the password, opens every page, Notifications included, saves a fixture Bot Token on Connection, and signs out.
  • Documentation tests — apps/docs/src/tests checks frontmatter, links, tables, terminology, dotenv files, and type declarations.

Legacy Reference

The legacy bot's code is in the repository's Git history, at the v3.4.3 tag. It is recommended to use it as a record of past behavior rather than as code to copy.

Generated Files

Nova generates several files, and local edits to them are lost the next time Nova runs.

  • Agent instructions — CLAUDE.md, AGENTS.md, and conventions/*.md, from nova generate must-haves agent-conventions.
  • Environment samples — The .env.sample files, from nova generate must-haves dotenv.
  • Project files — The README.md files, .editorconfig, .gitignore, .dockerignore, and the GitHub workflows, issue templates, and funding file.