Skip to content

Admin Stats Dashboard — read endpoint with all aggregations - #507

Open
Yurika-Kan wants to merge 9 commits into
devfrom
app-portal/feature/stats-dashboard
Open

Admin Stats Dashboard — read endpoint with all aggregations#507
Yurika-Kan wants to merge 9 commits into
devfrom
app-portal/feature/stats-dashboard

Conversation

@Yurika-Kan

@Yurika-Kan Yurika-Kan commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Add /admin/stats dashboard: get live Mongo data, service, API, jest unit tests

🎫 Issue #487

▶ Changelist:

For http://localhost:3000/admin/stats

  • Split StatusBreakdownChart into application, decision, and RSVP breakdowns as three separate cards
  • Added getTotals, getStatusBreakdown, getDecisionBreakdown, getRsvpBreakdown, getDemographics, getTimeline aggregation functions against applicant_data
  • Reworked types.ts to match applicant_data
  • Cache + API route for stats payload, dynamic loading for /stats route
  • Added jest config + unit tests per aggregation
  • Pre-commit hook now fails fast if next dev is running (conflicts with yarn build)

🎥 Screenshots & Screencasts:

Stats Page with Mongo Prod applicant data!
image
image

📝 Notes + 🚧 TODO:

  • Demographics dimension selector still TODO (see StatsDashboard)
  • Fix chart x-xis overflow:
image - Brainstorm better way to represent all the diff majors for x-axis: image

Note: to access this page, user must log into platform with ...@hackbeanpot.com credentials!

🧪 Testing:

  • yarn test — unit tests (mongodb-memory-server) covering:
    getTotals: counts across all status fields correct
    getStatusBreakdown: groups by applicationStatus
    getDecisionBreakdown: groups decisionStatus scoped to submitted applicants only
    getRsvpBreakdown: groups rsvpStatus scoped to admitted applicants only
    getTimeline: groups submissions by day
    getDemographics: groups school dimension from applicationResponses; returns empty rows for dimensions with no data
  • double checked with Mongo values
  • curl tested payload, counts, timeline
  • smoke tested page

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
core-live Ready Ready Preview Jul 30, 2026 3:14am
core-main Ready Ready Preview Jul 30, 2026 3:14am

@Yurika-Kan Yurika-Kan linked an issue Jul 30, 2026 that may be closed by this pull request
26 tasks
@Yurika-Kan Yurika-Kan changed the title Confirm the StatsPayload shape Admin Stats Dashboard — read endpoint with all aggregations Jul 30, 2026
@Yurika-Kan
Yurika-Kan marked this pull request as ready for review July 30, 2026 03:21
Copilot AI review requested due to automatic review settings July 30, 2026 03:21
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.

Stats — read endpoint with all aggregations

1 participant