Monorepo for Together (synced YouTube watch/listen rooms). Default branch: main. Canonical remote: https://github.com/chtnnh/together.
- Read
docs/v0.3.0-plan.mdfor the approved v0.3.0 scope and phase order (v0.2.0 plan indocs/v0.2.0-plan.mdis historical). - Do not implement items marked out of v0.3.0 unless explicitly requested.
| Path | Purpose |
|---|---|
apps/web |
Next.js 15 UI + API routes |
services/realtime |
Cloudflare Worker + Durable Object (WebSocket rooms) |
packages/shared |
Events, Zod schemas, playback math |
packages/db |
Drizzle schema + migrations |
packages/ui |
Shared React components |
packages/track-resolver |
YouTube / ISRC matching |
pnpm install --frozen-lockfile
pnpm lint # Biome check
pnpm format # Biome write
pnpm typecheck
pnpm test:unit # Vitest (all packages)
pnpm ci:local # Full merge gate (same as CI)
pnpm ci:pre-commit # Hook: incremental checks
pnpm ci:pre-push # Hook: quality + affected unit/build (no E2E/visual)
pnpm --filter @together/web test:install # first time / CI
pnpm --filter @together/web test
pnpm --filter @together/realtime dev # requires Node 22+
pnpm --filter @together/web devSee CONTRIBUTING.md for merge gate contract, hook tiers, and viewing CI Playwright artifacts.
Env is loaded from repo root .env (see .env.example). Do not commit secrets.
- Client ↔ realtime events:
packages/shared/src/events.ts+ handler inservices/realtime/src/room-do.ts - Match existing naming and patterns; minimal diffs
- Mobile queue reorder: touch drag-and-drop only (no overflow move up/down menus)
- DB schema changes: edit
packages/db/src/schema.ts, runpnpm db:generate, commit the new SQL andpackages/db/drizzle/meta/(journal + snapshot). Never commit orphan.sqlfiles —pnpm db:migrateonly runs migrations listed in the journal. - Supabase transaction pooler (port 6543): use
max: 1on the postgres.js client and neverPromise.allmultiple DB queries on one connection — run one SQL statement or await queries sequentially.
Cloud agents must use the GitHub repository chtnnh/together, branch main.
- A local
forgejoremote may exist for mirroring; Cloud Agents do not use it. - Environment config:
.cursor/environment.json(Node 22 + pnpm install on startup). - Set secrets in Cursor Dashboard → Cloud Agents → Secrets (not in git): at minimum dummy values for local agent runs if testing web (
DATABASE_URL,YOUTUBE_API_KEY,ROOM_TOKEN_SECRET,NEXT_PUBLIC_*— see.env.example). - For v0.3.0 tasks, work one phase at a time from
docs/v0.3.0-plan.mdand runpnpm typecheckbefore finishing.