Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Get started

See Architecture for how the backend, admin UI, CLI, and a frontend fit together.

There are two ways to set up a development environment:

  1. Use the provided devcontainer: follow the devcontainer README.

  2. Develop directly on your machine, as described below.

Prerequisites

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:7001

Common 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:watch

Linting & 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:check

Type Checking

# Type-check all packages
pnpm typecheck

# Type-check a specific package
pnpm --filter @raven/backend-ts typecheck

Database

See Backend for the database migration commands.

Workspace structure

This is a pnpm monorepo. Packages are defined in pnpm-workspace.yaml.

PathPackageDescription
backend-ts/@raven/backend-tsTypeScript/Hono HTTP server
admin-ui/@raven/admin-uiAdmin web interface
eslint-config/@raven/eslint-configShared linter configuration
eslint-rules/@raven/eslint-rulesCustom lint rules
cli/@raven/cliraven command-line interface
importers/*/@raven/importer-*Content importers, one per format
core/*/@raven/core-*Code shared between packages
tests/@raven/integration-testsIntegration tests (Docker-based)
admin-ui-e2e/@raven/e2e-testsPlaywright E2E tests for admin-ui
snapshot-tests/@raven/snapshot-testsBackend snapshot tests (Docker-based)
docs/@raven/docsDocumentation sites (MyST)
docs/screenshots/@raven/docs-screenshotsScreenshot generation for the docs

The deploy/ folder isn’t a package. It has configuration and scripts for deployment.