Tier-5
Merged
HU
4mo ago+12430+12430+01234567890123456789012345678901234567890123456789-5809-5809-0123456789012345678901234567890123456789
Summary by cubic
Tier 5 scale upgrades plus Tier 6/7 polish: adds a DO-backed rate limiter, KV-cached session lists, structured logs with trace IDs, deep health checks, and ships PWA offline read-only, i18n, scorecard export, and static API docs.
-
New Features
- API scale: per‑IP
RateLimiterDurable Object;CACHEKV forGET /sessions(KV 60s, HTTPmax-age=15,X-Cache), structured JSON logs withX-Trace-Idand 500 bodies includingtraceId, deep readiness atGET /health?deep=1(503 on DB down). - API docs: live
GET /openapi.jsonand static Redoc at/docsfromapps/web/public/openapi.json(exported vianpm run export:openapi). - Web offline: PWA via
vite-plugin-pwawith WorkboxNetworkFirstfor/sessions*; React Query persistence forsessions/session;OfflineBanner; queriesofflineFirst, mutationsonline. - UX extras: print‑ready scorecard export on Session Detail;
i18nextwithenstrings;FileFielduses hidden input + visible “Choose file” button; optional analytics viaVITE_PLAUSIBLE_DOMAINorVITE_CF_WEB_ANALYTICS_TOKEN. - Quality & DX: Vitest RTL component tests, OpenAPI contract tests, Playwright visual tests;
npm run deploy:staging:full; upgradedwranglerto v4; improved README.
- API scale: per‑IP
-
Migration
- Create and bind KV namespaces for
CACHE(run fromapps/api:wrangler kv namespace create ...) and deploy DO migration forRateLimiter; IDs are configured inwrangler.toml. - Deploy with
npm run deploy:staging:full(migrate → force‑rls → rls check → seed → deploy). - Optionally set
VITE_PLAUSIBLE_DOMAINorVITE_CF_WEB_ANALYTICS_TOKENfor analytics; no changes needed for local dev.
- Create and bind KV namespaces for