๐Ÿ“Š

No paying customers yet

Once first contracts are signed, this page wires up to POST /api/v1/platform/tenants/health-snapshot and renders per-tenant health KPIs. The skeleton below shows what to expect.

Planned KPI strip (per tenant)

DAU last 30d
โ€”
distinct admins
Login frequency
โ€”
avg logins/admin/wk
Open tickets
โ€”
support count
Days to renewal
โ€”
contract end
NPS (last 90d)
โ€”
survey response

Planned tenant list

Tenant Plan MRR Identities Health score Renewal CSM Risk
No tenants yet. First customer onboarding will populate this.

Health-score formula (proposed)

Each tenant gets a 0-100 health score with three weighted dimensions:

DimensionWeightSignals
Engagement40%Distinct DAU, login frequency, feature-breadth (% of nav items visited / month)
Operational30%Open tickets, SLA-breach count last 90d, deploy errors
Commercial30%NPS, days-to-renewal (proximity weight), invoice age

Health tiers: 75-100 green ยท 50-74 yellow ยท 25-49 orange ยท 0-24 red (churn risk).

Data sources (when wired)

  • Engagement โ†’ query audit_event filtered by event_type LIKE 'login.%' + per-tenant aggregation
  • Tickets โ†’ integrate Linear / Jira workspace via API once support tooling chosen
  • NPS โ†’ Delighted / Wootric integration (deferred)
  • Renewals โ†’ contract metadata on PlatformTenant (new fields: contract_start, contract_end, renewal_owner)
  • MRR โ†’ derived from TenantPlan + addons

Wire-up checklist (do this when first customer signs)

  1. Add contract_* fields to PlatformTenant via alembic migration
  2. Build HealthScoreService.compute_for_tenant() in a new backend/app/domain/customer_health/ module
  3. Wire scheduler sweep _maybe_compute_health_scores โ€” 6h interval per tenant
  4. Expose endpoint GET /api/v1/platform/tenants/health (platform-admin only)
  5. Replace this placeholder with real data fetch + render
  6. Set up Slack alert when any tenant drops into red tier