See Architecture for how the backend, admin UI, CLI, and a frontend fit together.
There are two ways to set up a development environment:
Use the provided devcontainer: follow the devcontainer README.
Develop directly on your machine, as described below.
Prerequisites¶
Node.js >= 24
pnpm >= 12
Using corepack:
npm install --global corepack@latest && corepack enable pnpm
Docker
FFmpeg (provides
ffprobe, used to inspect uploaded audio and video)macOS:
brew install ffmpeg
gitleaks >= 8.19 (scans staged changes for secrets in the pre-commit hook)
macOS:
brew install gitleaksOther platforms: see the gitleaks installation docs
VSCode
pnpm install installs the lefthook git hooks.
The pre-commit hook fails if gitleaks is missing or finds a secret in the staged changes.
If a finding is a false positive, add gitleaks:allow as a comment on that line, or add the finding’s fingerprint to .gitleaksignore.
Setup¶
Start the databases and the backend:
pnpm install
deploy/local/docker-compose-dev.sh up # MySQL, Postgres and Garage
cd backend-ts
cp raven.example.toml raven.toml
MIGRATION_DATABASE_URI="mysql://root:root_password@localhost:4306/raven?charset=utf8mb4" pnpm db:migrate
pnpm dev # API at http://localhost:7001Common commands¶
Run commands from the repo root unless otherwise noted. See Backend for more on the backend, and Documentation to build these docs.
Testing¶
# Run all tests across the workspace
pnpm test
# Run backend-ts unit tests only
pnpm --filter @raven/backend-ts test
# Run integration tests (spins up Docker services)
pnpm --filter @raven/integration-tests test
# Run integration tests in watch mode
pnpm --filter @raven/integration-tests test:watchLinting & Formatting¶
# Lint all packages
pnpm lint
# Lint a specific package
pnpm --filter @raven/backend-ts lint
# Format all files
pnpm format
# Check formatting without writing
pnpm format:checkType Checking¶
# Type-check all packages
pnpm typecheck
# Type-check a specific package
pnpm --filter @raven/backend-ts typecheckDatabase¶
See Backend for the database migration commands.
Workspace structure¶
This is a pnpm monorepo. Packages are defined in pnpm-workspace.yaml.
| Path | Package | Description |
|---|---|---|
backend-ts/ | @raven/backend-ts | TypeScript/Hono HTTP server |
admin-ui/ | @raven/admin-ui | Admin web interface |
eslint-config/ | @raven/eslint-config | Shared linter configuration |
eslint-rules/ | @raven/eslint-rules | Custom lint rules |
cli/ | @raven/cli | raven command-line interface |
importers/*/ | @raven/importer-* | Content importers, one per format |
core/*/ | @raven/core-* | Code shared between packages |
tests/ | @raven/integration-tests | Integration tests (Docker-based) |
admin-ui-e2e/ | @raven/e2e-tests | Playwright E2E tests for admin-ui |
snapshot-tests/ | @raven/snapshot-tests | Backend snapshot tests (Docker-based) |
docs/ | @raven/docs | Documentation sites (MyST) |
docs/screenshots/ | @raven/docs-screenshots | Screenshot generation for the docs |
The deploy/ folder isn’t a package. It has configuration and scripts for deployment.