Skip to main content

12. Admin, Analytics & Platform

Purpose — The HQ control plane: role-scoped team dashboards (marketing / finance / technician-head), BI, the notifications engine, integrations (incl. Zapier/Pabbly — notes #13), audit, and platform services.

Personas served​

Marketing admin, Finance admin, Service head, Manager (scoped), Super admin.

Key capabilities​

  • Role-based, scoped admin — each team sees its domain; managers limited to assigned partners/regions (RBAC).
  • BI dashboards —
    • Marketing: traffic, conversion, campaign/coupon performance, content, reviews, NPS.
    • Finance: sales by channel/region/dealer, AR/ledgers, payouts, subsidy, reconciliation.
    • Technician head: SLA, job throughput, AMC renewals, warranty cost, technician productivity, CSAT.
  • Notifications engine — SMS / WhatsApp / email / push across all events (Notifications).
  • Integrations hub — ERP (SAP/Tally/Zoho), payment, courier, marketplace, accounting, IoT/solar telemetry (inverter performance).
  • Automation — n8n + Zapier & Pabbly (notes #13) — manage event→webhook subscriptions; signed outbound webhooks drive self-hosted n8n (internal orchestration) and Zapier/Pabbly (SaaS no-code). See Automation.
  • Audit logs, data export, API access — every mutation audited; export + API keys for tenants.
  • Tenant config & branding admin — edit the non-secret config document (Multi-Tenancy).

Data owned​

Mongo: dashboard configs, audit log, automation subscriptions, API keys. BI read models: materialized projections built from events (per Eventing); heavier analytics may use a read replica / warehouse (v2).

Events​

  • Emits: automation.dispatched, apikey.created, report.generated.
  • Consumes: all whitelisted domain events (for BI projections + automation fan-out).

APIs​

  • GET /admin/dashboards/:team (scoped), GET /admin/audit (scoped)
  • POST /admin/automation/subscriptions (event → Zapier/Pabbly URL)
  • POST /admin/apikeys, GET /admin/export/:dataset
  • PATCH /admin/tenant-config

Tenant-config knobs​

Dashboard layouts per role; enabled integrations; automation subscriptions; export/API policy; notification channel keys.

Dependencies​

RBAC, Eventing, Notifications, Automation; reads from all modules.

Open questions​

  • BI: live projections vs nightly warehouse — phase boundary (v1 projections, v2 warehouse).
  • Which ERP first (Tally most common for Indian SMB)?