Development
Prerequisites
Section titled “Prerequisites”- Go 1.26+
- Node 22+
- Task
ffmpegandffprobeonPATH
git clone https://github.com/befabri/replayvod.gitcd replayvodtask setup # go mod download + npm installtask dev # server on :8080, dashboard on :3000Vite proxies /api/* and /trpc/* to the Go server, so the SPA works at http://localhost:3000 against a backend on :8080.
task build # production buildsThe recorder lands at server/bin/replayvod; the SPA is bundled to dashboard/dist/.
task # list every tasktask check # go vet + biome + tsc --noEmittask test # full test suiteCode generation
Section titled “Code generation”Three generators, all driven from the Taskfile. Generated files are committed; CI runs the :check variants to fail on drift.
task sqlc # queries/*.sql → pggen / sqlitegentask trpcgen # tRPC procedures → dashboard/src/api/generated/task twitch-api-gen # Twitch HTML docs → internal/twitch + eventsubtask gen # all of the aboveAfter adding a query in server/queries/{postgres,sqlite}/, run task sqlc to regenerate the typed Go. After adding a tRPC procedure in server/internal/api/, run task trpcgen to push types and Zod schemas to the dashboard.
Testing
Section titled “Testing”Test suites are gated by build tags so the default run stays fast and dependency-free.
| Command | Tag | What it covers |
|---|---|---|
task test | (none) | unit tests |
task test-integration | //go:build integration | Docker-backed (Garage S3, Postgres testcontainer) |
task test-ffmpeg | //go:build ffmpeg | real ffmpeg / ffprobe |
task test-live | //go:build live | real Twitch endpoints (opt-in) |
Container fixtures for integration tests live in server/internal/testdb/.
Dashboard
Section titled “Dashboard”Inside dashboard/:
npm run dev # Vite dev server on :3000npm run build # bundle to dist/npm test # vitest unit testsnpx playwright testnpm run lint # biomenpm run routes # regenerate routeTree.gen.tsEither Bun or npm works; both lockfiles are committed.
Inside relay/:
npm installnpm run dev # wrangler devnpm run deploy # wrangler deployYou need a Cloudflare account and wrangler installed.
Project layout
Section titled “Project layout”See Architecture → Server for the package-by-package map.
src/ routes/ file-based routes api/ tRPC client + generated types components/ React components (ui/ from shadcn) features/ domain modules hooks/ stores/ lib/ integrations/ i18n/ routeTree.gen.ts (generated)src/ index.ts Worker entrypoint and routing relay-do.ts Durable Object (buffer, fan-out, alarm)wrangler.jsonc Worker + DO bindings