Skip to content

Development

  • Go 1.26.8+
  • Node 22.19+
  • Task
  • ffmpeg and ffprobe on PATH
  • Docker for database and integration tests

From the repository root:

Terminal window
git clone https://github.com/befabri/replayvod.git
cd replayvod
cp server/.env.example server/.env
task setup

Set Twitch credentials and SESSION_SECRET in server/.env. Choose DATABASE_DRIVER=sqlite for a local file database, or configure a PostgreSQL connection. Leave PUBLIC_BASE_URL empty for the default Vite development setup. See Configuration for other settings.

Terminal window
task dev

The Go server listens on port 8080 and the dashboard on http://localhost:3000. Vite proxies /api/* and /trpc/* to the server.

Terminal window
task build

The root build task writes the recorder to server/bin/replayvod and the dashboard’s static site to dashboard/dist/client/. The Docker image serves that static directory from the Go server.

Run these from the repository root:

Terminal window
task # list tasks
task check # Go vet, dashboard checks, and TypeScript checking
task test # Go and Vitest tests

Run generators from server/. Commit generated files with the changes that require them.

Command Output
task sqlc Typed PostgreSQL and SQLite query code from queries/.
task repo-adapter-gen Repository adapter mappings and generated methods. Run after sqlc.
task trpcgen Dashboard TypeScript types, enums, and Zod schemas from Go tRPC procedures.
task twitch-api-gen Twitch API client and EventSub types.
task gen Runs sqlc, repository adapter generation, and tRPC generation.

The corresponding :check tasks verify that generated files match their inputs. Twitch API generation has a separate snapshot workflow in server/Taskfile.yml.

Run these from server/. The default suite uses PostgreSQL 17 containers and SQLite files. Additional suites use Go build tags.

Command Coverage
task test Unit and database tests.
task test-integration HTTP and Garage S3 integration tests.
task test-upgrade Upgrade the latest published baseline to the candidate image on SQLite and PostgreSQL, then test rollback.
task test-upgrade-full Upgrade tests for all retained baselines and larger datasets.
task test-ffmpeg Tests using real ffmpeg and ffprobe processes.
task test-live Tests against live Twitch endpoints. Run explicitly when needed.

Database fixtures are in server/internal/testdb/. The upgrade suite needs a Linux Docker engine. Its baseline manifest and diagnostics are described in server/tests/upgrade/README.md.

Run these from dashboard/:

Terminal window
npm install
npm run dev # development server on port 3000
npm run build # production build
npm test # Vitest tests
npx playwright test # browser tests against the built dashboard
npm run check # Biome checks
npm run routes # regenerate routeTree.gen.ts

Playwright builds the dashboard and starts its preview server automatically. Most API calls are mocked in the browser tests; the subscription test also uses a Go fixture for the WebSocket transport.

Run these from landing/:

Terminal window
npm install
npm run dev
npm run check
npm run build

Documentation pages are MDX files in landing/src/content/docs/docs/. Sidebar entries are in landing/astro.config.ts. Keep UI labels consistent with the dashboard and check section links when renaming headings.

Write guides around the reader’s task: what to open, what to choose, and what happens next. Keep configuration details in the reference pages and implementation details in the contributor pages. Use concrete explanations and avoid filler or promises the software can’t guarantee.

Run these from relay/:

Terminal window
npm install
npm run dev
npm run deploy

Deployment requires a Cloudflare account configured for Wrangler. See Relay protocol for configuration and message formats.

Directory Contents
server/ Go server, database migrations, queries, and generators. See Architecture.
dashboard/src/routes/ Dashboard routes.
dashboard/src/features/ Feature components, queries, and forms.
dashboard/src/api/ tRPC client and generated types.
dashboard/src/i18n/ English and French translations.
relay/src/ Worker routes and Durable Object implementation.
landing/src/content/docs/docs/ User and contributor documentation.