Development
Prerequisites
Section titled “Prerequisites”- Go 1.26.8+
- Node 22.19+
- Task
ffmpegandffprobeonPATH- Docker for database and integration tests
From the repository root:
git clone https://github.com/befabri/replayvod.gitcd replayvodcp server/.env.example server/.envtask setupSet 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.
task devThe Go server listens on port 8080 and the dashboard on http://localhost:3000. Vite proxies /api/* and /trpc/* to the server.
task buildThe 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:
task # list taskstask check # Go vet, dashboard checks, and TypeScript checkingtask test # Go and Vitest testsCode generation
Section titled “Code generation”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.
Testing
Section titled “Testing”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.
Dashboard
Section titled “Dashboard”Run these from dashboard/:
npm installnpm run dev # development server on port 3000npm run build # production buildnpm test # Vitest testsnpx playwright test # browser tests against the built dashboardnpm run check # Biome checksnpm run routes # regenerate routeTree.gen.tsPlaywright 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.
Documentation site
Section titled “Documentation site”Run these from landing/:
npm installnpm run devnpm run checknpm run buildDocumentation 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/:
npm installnpm run devnpm run deployDeployment requires a Cloudflare account configured for Wrangler. See Relay protocol for configuration and message formats.
Project layout
Section titled “Project layout”| 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. |