Skip to content

feat(analytics): add Supabase signups to the admin dashboard - #112

Merged
creatorcluster merged 2 commits into
creatorcluster:mainfrom
Coder-soft:feat/admin-signup-analytics
Oct 21, 2026
Merged

creatorcluster merged 2 commits into
creatorcluster:mainfrom
Coder-soft:feat/admin-signup-analytics

Conversation

@Coder-soft

@Coder-soft Coder-soft commented Oct 21, 2026 •

Copy link
Copy Markdown

What

The admin dashboard's "New users" card is a visitor metric (first-party page-view tracking), not an account metric. Browsing /admin could not answer "how many people signed up?".

This adds a real signup series from auth.users:

  • Stat card: Signups with a "N confirmed" hint.
  • Chart: "New signups" — accounts created per day/week/month (UTC).
  • Breakdown table: new Signups column; rows merge traffic buckets with the dense signup series.
  • Visitor cards renamed New visitors / Returning visitors so the two are not confused.

DB

New migration 20261021000000_analytics_signups.sql replaces analytics_overview() (additive, jsonb return type unchanged):

  • totals.signups, totals.confirmedSignups
  • signupBuckets[] built with generate_series so buckets without signups return 0 instead of a gap
  • excludes guest (is_anonymous) accounts
  • still security definer, revoke ... from public, anon, authenticated + grant ... to service_role only

Applied to project bmywdrwjdqmrkafhiuwn and verified: last 7 days → 31 signups / 31 confirmed, matching auth.users day counts.

Checks

  • pnpm exec vite build passes
  • pnpm exec tsc -b — no new errors (only the pre-existing ones in ProfileEditor/useCreatorPacks/useProfile/Profile)
  • pnpm exec eslint clean on the touched files

Summary by CodeRabbit

  • New Features

    • Added signup and confirmed-signup metrics to Site Analytics.
    • Added signup trends by day, week, or month, including zero-activity periods.
    • Added signup data to analytics charts, summary cards, and breakdown tables.
    • Combined traffic and signup data into complete analytics rows.
  • Improvements

    • Renamed “Traffic Analytics” to “Site Analytics” throughout the admin experience.
    • Updated loading states to accommodate the expanded analytics summary.

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
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a390f2e6-172d-42cd-97d2-a54bbd2a4984
📥 Commits

Reviewing files that changed from the base of the PR and between e6a8b51 and e04ad77.

📒 Files selected for processing: 1
  • vite.config.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc51b307-edb9-4869-bb0b-e7f50871a1ed
📥 Commits

Reviewing files that changed from the base of the PR and between 9dc241e and e6a8b51.

📒 Files selected for processing: 4
  • src/lib/analytics.ts
  • src/pages/Admin.tsx
  • src/pages/Analytics.tsx
  • supabase/migrations/20261021000000_analytics_signups.sql

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The analytics function now returns signup totals and dense per-period signup buckets. The analytics dashboard displays signup metrics alongside visitor and visit metrics. The admin tab and dashboard heading now use “Site Analytics.”

Changes: Signup analytics

Layer / File(s) Summary
Signup data and response contract
supabase/migrations/20261021000000_analytics_signups.sql, src/lib/analytics.ts
The new analytics_overview function returns signup totals, confirmed-signup totals, and dense signup buckets. AnalyticsStats includes the corresponding totals and bucket series.
Dashboard metrics and labels
src/pages/Analytics.tsx, src/pages/Admin.tsx
The analytics page adds signup totals, a signup chart, and a Signups breakdown column. The admin tab and page heading change to “Site Analytics.”

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to e6a8b

No confirmed issue blocks the signup analytics change. The UTC bucket labels depend on the database retaining its default timezone.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding Supabase signup analytics to the admin dashboard.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit counts each signup bright,
And marks the confirmed ones just right.
New buckets fill each passing day,
While charts show numbers on display.
“Site Analytics,” the labels say,
Then off I hop through fields of hay.

Comment @coderabbitai help to get the list of available commands.

/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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@creatorcluster
creatorcluster merged commit bee59bc into creatorcluster:main Oct 21, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants