WS8 PR D: admin usage dashboard

↗ view on GitHub · sloth-ninja · 2026-07-22 · 863f8447

Read-only firm usage overview for organisation admins. Aggregates existing
activity (chats, tabular reviews as workflow runs, documents) into period
totals, per-member activity, per-workflow-template runs and a per-day chat
trend. No migration, no new event capture, no new env vars.

Backend: lib/usageStats.ts (org-scoped aggregation, uuid->text member
resolution, 30d fetch floor, injectable now) + GET /admin/usage (requireAdmin,
asyncHandler, ?days=7|30). Frontend: (pages)/admin/dashboard with 4 stat tiles,
a restrained single-accent SVG daily bar chart (DD/MM labels, tabular figures),
member + workflow-template tables, 7d/30d switch, loading skeletons and
error+retry. mikeApi.getFirmUsage; sidebar Dashboard item (isAdmin-gated).

Tests: 10 usageStats cases incl. the watertight another-org-excluded case,
uuid->text matching, window edges/bucketing, empty/single org. Backend vitest
234 passed; backend+frontend tsc clean; evals:smoke 4/4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository Sloth-ninja/JessicaOSS
Author sloth-ninja <ezanahaddis@gmail.com>
Authored
Parents 36a18cea
Stats 8 files changed , +1352 , -5
Part of WS8 PR D: admin usage dashboard

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-863f8447.md from inside the repo you want the change in.

⬇ Download capture-commit-863f8447.md