feat(worker): step 4 — normalize pipeline, SSE, live events surface
4 months ago
Authored
grim- worker: process-event job (normalize → cols+jsonb+NOTIFY, quarantine on
parse failure, no-op on reprocess), pg-boss consumer entry
- api: GET /events/stream SSE off LISTEN/NOTIFY, dedicated client per
connection, CORS for the web origin
- web: /events route (§9 pattern) — server fn + query key factory,
EventSource → query-cache merge, event-row/live-indicator, nav entry;
authored lib/seo.ts
- integration: worker pipeline proven on real postgres (normalize cols, jsonb,
NOTIFY observed, quarantine, ping no-op)
- e2e smoke: signed webhook → row → worker → SSE frame captured
Parent0715bb2
22 files changed
- DECISIONS.md+20−0
- all-summaries.md+45−0
- apps/api/src/env.ts+2−0
- apps/api/src/index.ts+12−1
- apps/api/src/routes/stream.ts+52−0
- apps/api/src/webhooks.integration.test.ts+1−0
- apps/web/package.json+3−1
- apps/web/src/components/events/event-row.tsx+71−0
apps/web/src/components/events/events-page.tsx+51−0apps/web/src/components/events/live-indicator.tsx+15−0apps/web/src/components/layouts/dashboard-topbar.tsx+2−0apps/web/src/lib/events.functions.ts+25−0apps/web/src/lib/events.query.ts+59−0apps/web/src/lib/seo.ts+89−0apps/web/src/lib/server/db.ts+25−0apps/web/src/routes/events.tsx+18−0apps/worker/package.json+8−2apps/worker/src/index.ts+27−9apps/worker/src/jobs/process-event.ts+73−0apps/worker/src/process-event.integration.test.ts+147−0bun.lock+8−0packages/db/src/services/events.ts+1−1