mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-09-19 07:34:57 +08:00
00f4621830
Replaces the scaffold page with the dashboard proper: 19 panels covering every
view of the PostHog dashboard this retires, driven by one filter row.
src/api.ts is the read API CG-12 specified: /api/{meta,summary,timeseries,
breakdown,activation,retention}, all range-scoped, all parameterized against a
closed set of dims and metrics, all shaped labels[] + datasets[] so the frontend
does no arithmetic. Rollups answer everything except the activation funnel,
which needs raw events and says where they start.
The frontend splits into a DOM-free panel registry (public/panels.js) and the
page that mounts it (public/app.js), so the render check can drive the same
registry the browser rendered from. Panels fail alone, refetch dims rather than
flashing, and every chart carries a table twin.
Two numbers are labelled rather than rounded off: range-wide "users" per
dimension is machine-days (the rollups cannot give distinct machines, and
per-day counts are taken as the largest single-event count so one machine's
install + index + usage is not counted three times), and recent activation and
retention cohorts are marked as still-converting instead of drawn as a cliff.
Both colour scales were run through the data-viz validator against the panel
surface, not picked by eye; the results are recorded in public/theme.js.
Verification, all against the committed fixture (12 machines over 10 days, every
expected number worked out by hand from the events, not recorded from a run):
scripts/smoke-api.sh 98 assertions
scripts/render-check.mjs 79 assertions — real Chromium over CDP, no new deps
scripts/smoke-auth.sh 54 assertions (unchanged, still green)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
23 lines
798 B
JSON
23 lines
798 B
JSON
{
|
|
"name": "codegraph-telemetry-dashboard",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "Password-gated admin dashboard over the codegraph telemetry D1 database (stats.getcodegraph.com)",
|
|
"scripts": {
|
|
"vendor": "node scripts/vendor-assets.mjs",
|
|
"dev": "npm run vendor && wrangler dev",
|
|
"deploy": "npm run vendor && wrangler deploy",
|
|
"types": "wrangler types",
|
|
"check": "npm run vendor && wrangler types && tsc --noEmit && wrangler deploy --dry-run",
|
|
"seed": "./scripts/seed-fixture.sh",
|
|
"smoke:auth": "./scripts/smoke-auth.sh",
|
|
"smoke:api": "./scripts/smoke-api.sh",
|
|
"smoke:render": "npm run vendor && node scripts/render-check.mjs"
|
|
},
|
|
"devDependencies": {
|
|
"chart.js": "^4.4.0",
|
|
"typescript": "^5.0.0",
|
|
"wrangler": "^4.36.0"
|
|
}
|
|
}
|