Files
gstack/supabase/functions/dashboard/index.ts
T
Garry Tan 78840c64a8 feat: add shared team dashboard, regression alerts, weekly digest edge functions
Dashboard: Supabase edge function serving self-contained HTML with
PKCE OAuth, 6 parallel client-side REST queries, SVG charts, dark
theme, auto-refresh, who's-online from heartbeats. Public URL.

Regression alert: webhook on eval_runs INSERT, 5-min cooldown dedup
via alert_cooldowns, Slack notification on >5% pass rate drop.

Weekly digest: pg_cron Monday 9am UTC, aggregates 7-day team data,
Slack message with evals/ships/sessions/costs. 15 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:44:47 -05:00

24 lines
656 B
TypeScript

/**
* Dashboard edge function — serves the team dashboard HTML.
*
* Public URL: https://<project>.supabase.co/functions/v1/dashboard
* No auth required (the HTML page handles auth client-side via PKCE).
*/
import { getDashboardHTML } from './ui.ts';
Deno.serve((_req: Request) => {
const supabaseUrl = Deno.env.get('SUPABASE_URL') ?? '';
const anonKey = Deno.env.get('SUPABASE_ANON_KEY') ?? '';
const html = getDashboardHTML(supabaseUrl, anonKey);
return new Response(html, {
status: 200,
headers: {
'Content-Type': 'text/html; charset=utf-8',
'Cache-Control': 'no-cache, no-store, must-revalidate',
},
});
});