feat(admin): analytics dashboard (DAU/MAU/messages/rooms/signups) (LC-97) #159
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-97-admin-analytics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds an admin analytics dashboard at
/admin/analytics(LC-97). Daily metrics are pre-aggregated into a newanalytics_dailytable (chat.db) by a background aggregator, so the dashboard renders from a handful of indexed reads instead of scanning the messages table on every page load.What's included
spawn_analytics_aggregator): backfills every day since the install's earliest activity at startup, then ticks hourly to keep today fresh.Scope notes
analytics_dailycarriesscope_kind/scope_idso a future SaaS build can add per-enclave breakdowns without a migration.Tests
server/tests/routes_analytics.rs: recompute counts (messages/DAU/active rooms), soft-delete + system-message exclusion, signup metric via backfill, dashboard render (200 + SVG + retention), recompute redirect (303), and the non-admin (403) / anonymous (303) auth gate. Migration0035_analytics_daily.sqladded to the hand-rolled migration lists in the affected test harnesses.just check,just test, andjust check-server-saasall green.🤖 Generated with Claude Code