Skip to content

Enterprise analytics dashboard — charts, trends, and time-series #663

@teetangh

Description

@teetangh

Context

The org Overview page now has stat cards, an onboarding checklist, quick actions, and a recent activity feed (PR #655). The Analytics page has 6 stat cards. Both are numbers-only — no charts, no trends, no time-series visualizations.

This issue covers adding Recharts-based analytics to the org dashboard for established orgs with booking/billing history.

Scope

Overview page enhancements

  • Booking trend sparkline inside the "This month" stat card (mini line chart, last 14 days)
  • Seat utilization gauge for BUYER orgs with seatsTotal set (circular progress)

Analytics page redesign

  • Booking volume chart — bar chart, last 30 days, grouped by appointment type (consultation/subscription/webinar/class)
  • Revenue trend line — line chart, last 6 months, monthly gross
  • Top plans table — most-booked org plans ranked by booking count
  • Member growth chart — area chart showing cumulative member count over time
  • Seat utilization over time — line chart for BUYER orgs

New API endpoints needed

  • `GET /api/organizations/[orgId]/analytics/time-series?period=30d&metric=bookings`
    • Returns daily data points: `[{ date, count, amount }]`
    • Metrics: bookings, revenue, members
  • `GET /api/organizations/[orgId]/analytics/top-plans?limit=5`
    • Returns: `[{ planId, title, planType, bookingCount, revenue }]`

Dependencies

  • Recharts (already in package.json, used by admin payouts trend chart)
  • No schema changes needed — all data derivable from existing Payment, OrganizationMemberProfile, OrganizationPlan tables

Estimated effort

6-8 hours

References

  • PR Enterprise foundation — org CRUD, billing modes, SSO, dashboard #655 — enterprise foundation
  • `app/dashboard/organization/[orgId]/analytics/page.tsx` — current analytics page
  • `app/dashboard/organization/[orgId]/home/page.tsx` — current Overview page
  • `app/dashboard/admin/payouts/page.tsx` — existing Recharts usage pattern (payouts trend chart)

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnterpriseEnterprise tier — B2B org features, Architecture 4enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions