Skip to content

Development and tests

Local setup

Requirements: Node.js 24 and Docker.

npm ci
cp .env.example .env
docker compose up -d postgres mailpit   # database and mail catcher
DATABASE_URL=postgres://traureise:<password>@localhost:5432/traureise npm run db:migrate
DATABASE_URL=postgres://traureise:<password>@localhost:5432/traureise SMTP_HOST=localhost \
  STORAGE_LOCAL_DIR=./data/uploads npm run dev

Scripts

Script What it does
npm run lint ESLint, including a rule that forbids hardcoded UI strings and rules that keep the layers apart
npm run typecheck TypeScript in strict mode
npm run test:unit Vitest: domain rules and use cases with in-memory fakes
npm run test:integration Vitest against the Compose PostgreSQL and Mailpit. It creates and migrates a separate traureise_test database.
npm run test:e2e Playwright against the running Compose stack (docker compose up -d --build first). Run npx playwright install chromium once.
npm run db:generate Generates a migration after changing src/infrastructure/db/schema.ts

Test levels

  • Unit tests cover every domain rule and every use case, with hand-written in-memory fakes for the ports.
  • Integration tests run the Drizzle repositories against a real PostgreSQL with the real migrations, send email through Mailpit, and process real images with sharp.
  • End-to-end tests run in Chromium against docker compose up. They log in through magic links read from the Mailpit API and cover the dashboard, every editor section and field with the live preview, the public page, calendar export, sharing, theming, authorization, deletion and logout. Every E2E test fails if the browser makes a request to a host other than the app.

No test is skipped, and Playwright runs with retries: 0, so flaky tests show up instead of being hidden.

Continuous integration

GitHub Actions runs everything on every pull request (.github/workflows/ci.yml). The E2E job starts the stack with docker compose up from .env.example, just like a fresh install. .github/workflows/docker.yml builds the image for every pull request and publishes it to ghcr.io/traureise/traureise from main and from v* tags. .github/workflows/pages.yml builds this documentation with mkdocs build --strict and publishes it.

Working on the docs

uvx --with mkdocs-material==9.7.7 --with 'mkdocs<2' mkdocs serve

The site is at http://127.0.0.1:8000. Diagrams are Mermaid blocks in the Markdown.