Skip to content

Development

By the end of this page you can run redfish from source, run the checks and tests, and apply migrations, all through Docker.

redfish is built with SvelteKit 2 (Svelte 5, TypeScript) and Tailwind CSS 4, with Drizzle ORM on SQLite (better-sqlite3) and MJML for email. A second process, the worker, runs the job queue for sending, scheduled launches and retention. See Operations.

There is no host toolchain. From the repository root:

Terminal window
cp .env.example .env
docker compose up -d

This starts the dev server on port 3000 and the worker. After changing dependencies, rebuild the image, because the anonymous node_modules volume otherwise hides the new packages:

Terminal window
docker compose build && docker compose up -d --force-recreate

Run the full check suite the way CI does, inside a throwaway container:

Terminal window
docker compose run --rm app sh -c 'npm ci && npm run format:check && npm run check && npm test'

The scripts are:

  • npm run format:check: Prettier formatting (fix with npm run format).
  • npm run check: svelte-check against the TypeScript project.
  • npm test: the Vitest suite.

The database schema is managed with Drizzle:

  • npm run db:generate: generate a migration from the schema.
  • npm run db:migrate: apply migrations in development. The production web service applies them at startup.
  • npm run db:seed: seed base data.
  • npm run db:seed:demo: seed demo data.

The worker is started with npm run worker.

Work on a branch (feat/..., fix/..., docs/... or chore/...) and never push to main. CI runs Prettier, svelte-check, Vitest, the production build, npm audit, a licence check and CodeQL. For the full workflow, see CONTRIBUTING.md. For security issues, see Security.