Repository navigation
feat(analytics): add Supabase signups to the admin dashboard - #112
Conversation
The admin dashboard only reported first-party visitor traffic, where "new users" means first-time visitors. Add a real signup series sourced from auth.users.created_at (guests excluded): - analytics_overview() now returns totals.signups/confirmedSignups and a dense per-bucket signupBuckets series (zeros included, not gaps) - dashboard gets a Signups stat card, a "New signups" chart and a Signups column in the breakdown table - visitor cards relabelled (New/Returning visitors) so they are not confused with accounts
|
@Coder-soft is attempting to deploy a commit to the yamura3's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
/api/stats and /api/track were still proxied to analytics.codersoft.xyz, the self-hosted Worker from 6b08678 that the Supabase migration (20261009_site_analytics) replaced. The Worker only serves /stats and /track now, so the dev dashboard got a 404 on /api/stats instead of hitting api/stats.js via the local Express adapter. Removing both entries lets them fall through to the generic /api -> localhost:3000 proxy, which implements them.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
What
The admin dashboard's "New users" card is a visitor metric (first-party page-view tracking), not an account metric. Browsing
/admincould not answer "how many people signed up?".This adds a real signup series from
auth.users:Signupswith a "N confirmed" hint.Signupscolumn; rows merge traffic buckets with the dense signup series.New visitors/Returning visitorsso the two are not confused.DB
New migration
20261021000000_analytics_signups.sqlreplacesanalytics_overview()(additive, jsonb return type unchanged):totals.signups,totals.confirmedSignupssignupBuckets[]built withgenerate_seriesso buckets without signups return0instead of a gapis_anonymous) accountssecurity definer,revoke ... from public, anon, authenticated+grant ... to service_roleonlyApplied to project
bmywdrwjdqmrkafhiuwnand verified: last 7 days → 31 signups / 31 confirmed, matchingauth.usersday counts.Checks
pnpm exec vite buildpassespnpm exec tsc -b— no new errors (only the pre-existing ones in ProfileEditor/useCreatorPacks/useProfile/Profile)pnpm exec eslintclean on the touched filesSummary by CodeRabbit
New Features
Improvements