Skip to content

dhappy/mob.trwb.live

Repository files navigation

Serial Mob

A web application that keeps a serial mob programming team staffed continuously, 24 hours a day. Coders apply, a coordinator admits them to an eligible pool, and participants work arbitrary open-ended shifts laid out on a universal decimal "percentage clock" (100 hours / day · 100 minutes / hour · 100 seconds / minute, 0:00:00 anchored to the earliest sunrise in Washington, DC, with no time zones). When a participant passes the baton, their spot opens and the pool is notified by email + web push (reservation holders first); claims resolve atomically to a single winner. The mob's work is a set of GitHub issues synced two-way.

Full specification and design live in specs/001-serial-mob-team/ (spec.md, plan.md, data-model.md, research.md, contracts/, quickstart.md).

Stack

  • SvelteKit 2 / Svelte 5 (SSR + server routes), installable as a PWA — adapter-node.
  • Supabase: Postgres (source of truth), Auth, Realtime, Edge Functions (Deno), pg_cron.
  • Correctness-critical logic (claim, capacity, single-Driver, coverage, RLS) lives in Postgres SECURITY DEFINER functions and policies (Constitution Principle I).
  • pnpm is the package manager. (No Prettier — ESLint only.)

Prerequisites

  • Node 20+ and pnpm
  • Supabase CLI + Docker (local stack)
  • A GitHub App (App ID, private key, webhook secret) for issue sync
  • A Resend API key and generated VAPID keys (web push)

Setup

pnpm install
cp .env.example .env          # fill in secrets
supabase start                # local Postgres + Auth + Realtime + Functions
supabase db reset             # apply migrations (schema, RLS, SQL functions, pg_cron)
supabase functions serve      # notify-open-spot, github-action, github-webhook, detect-gaps
pnpm dev                      # SvelteKit on http://localhost:5173

Environment

See .env.example. PUBLIC_* vars are browser-exposed; everything else (service-role key, Resend key, VAPID private key, GitHub App key, webhook secret) is server-only and must never reach the client.

Tests

pnpm test:unit         # Vitest: clock conversion, coverage sweep, GitHub mappers
pnpm test:integration  # Vitest against a live local Supabase stack (RLS, claim, handoff, coverage)
pnpm test:e2e          # Playwright user journeys
pnpm check             # svelte-check (types)
pnpm lint              # ESLint

Integration and e2e suites self-skip when their env (PUBLIC_SUPABASE_URL + SUPABASE_SERVICE_ROLE_KEY, and E2E_* storage states) is absent, so the unit run stays green without Docker. To run them, start the stack and export those vars first.

Project layout

src/lib/clock/        decimal percentage-clock conversion (pure)
src/lib/coverage/     interval/coverage + gap computation (pure)
src/lib/domain/       shared types, enums, Zod validators, GitHub mappers
src/lib/server/       service-role client, auth guards, errors, notify (email/push), github
src/lib/client/       browser client + Realtime helpers
src/routes/           pages (apply, coordinator, roster, spots, work, settings) + api/ endpoints
supabase/migrations/  schema, RLS, SQL functions, pg_cron
supabase/functions/   Edge Functions (Deno)
tests/                unit · integration · e2e

About

Serial mobbing interface for 24⁄7 development.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors