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.
Docker-first setup
Section titled “Docker-first setup”There is no host toolchain. From the repository root:
cp .env.example .envdocker compose up -dThis 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:
docker compose build && docker compose up -d --force-recreateRun the checks and tests
Section titled “Run the checks and tests”Run the full check suite the way CI does, inside a throwaway container:
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 withnpm run format).npm run check: svelte-check against the TypeScript project.npm test: the Vitest suite.
Migrations and seed
Section titled “Migrations and seed”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 productionwebservice 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.
Contributing
Section titled “Contributing”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.