added deploy:all
Merged
HU
4mo ago+2458+2458+0123456789012345678901234567890123456789-273-273-012345678901234567890123456789
Summary by cubic
Refactors the API and web app to support signed media, paginated sessions, and real-time updates, and adds a streamlined local dev setup. Includes OpenAPI docs, stronger middleware, and comprehensive tests.
-
New Features
- Media:
POST /media/uploadwith MIME/size validation, immutable hashed R2 keys, signed fetch URLs, byte-range reads; HMAC viaMEDIA_SIGNING_SECRET. - Sessions: Modular Hono app with
GET/POST/PATCH /sessions, cursor pagination,SessionRoomDurable Object broadcasts, and OpenAPI 3.1 spec. - Security: CSP, stricter CORS using
APP_ORIGIN, rate limiting, and JSON body size limits. - DB/RLS:
withPrincipalsetsrole oche_appand owner context; migration grants to enableSET ROLE. - Web: Lazy-loaded routes,
PlayerAvatar, improved Overview/History/Detail,useLiveSessionexposesconnected, WS URL accepts?key=..., ViteenvDirat repo root. - Tooling: Local R2 binding,
scripts/wrangler-dev.mjs, env/key helpers (env-setup,generate-keys,setup,with-env), doctor checks, and OpenAPI endpoint. - Tests: Unit tests for media, pagination, principal, sessions; Playwright e2e with
@axe-core/playwrighta11y checks and seeded global setup.
- Media:
-
Migration
- Run
npm run setupto create.envandapps/api/.dev.varsfrom templates. - Set
DATABASE_URL(Neon) andMEDIA_SIGNING_SECRETin.env; ensureAPP_ORIGINandVITE_API_BASEmatch local defaults. - Generate local API keys:
npm run keys:generate(writes.oche-keys.jsonand syncs.dev.vars). - Apply DB changes:
node scripts/run-steps.mjs db:migrate db:force-rls db:seed. - Start dev:
npm run dev(wrangler API + web). For staging/prod, set Wrangler vars/secrets, R2 buckets, and Hyperdrive IDs.
- Run