Module 8
Operational Dashboards
Purpose#
Provides role-scoped operational visibility across all SMS modules. The dashboard is the entry point after login and gives each user a summary of their operational scope — org, region, or district — without requiring navigation into individual modules.
Role scoping#
| Role | Dashboard scope |
|---|---|
| Entity Admin | Organisation-wide aggregates across all regions. |
| Regional Manager | Their assigned region — all districts within it. |
| District Manager | Their assigned district — all communities within it. |
| Sustainability Officer | Their assigned communities only. |
| Auditor | Configured scope (org, region, or district — set at account creation). |
Dashboard widgets#
| Widget | Description |
|---|---|
| Farmer count | Total farmers enrolled in scope, broken down by status (active/pending/inactive). |
| Compliance rate | Percentage of active farmers meeting all 5 EUDR conditions. |
| Risk distribution | Pie/bar chart of plots by risk level (low/medium/high/critical/pending). |
| Program coverage | Percentage of farmers enrolled in each active program type. |
| Recent activity | Timeline of recent enrollments, assessments, and compliance changes. |
| Survey completion | Baseline survey completion rate across assigned farmers. |
Data fetching#
Dashboard data is fetched via SWR with a polling interval for near-real-time updates. The API endpoint accepts a tenantSlug and optional scope filters (region_id, district_id) and returns a summary response typed against dashboardSummaryResponseSchema in @repo/dashboard-contracts.
Packages#
| Package | Type | Key exports |
|---|---|---|
@repo/feature-dashboard | Backend | Services: dashboard-summary, metric aggregators per module |
@repo/dashboard-contracts | Shared | dashboardSummaryQuerySchema, dashboardSummaryResponseSchema, tenantSlugSchema |
API route#
| Route | Notes |
|---|---|
| /api/dashboard | Returns a summary response scoped to the authenticated org + optional geographic filters. |
Build incrementally
The dashboard is designed to be built incrementally as feature modules land. Each module contributes one or more widgets. Start with farmer count and compliance rate (available after modules 2 and 7 land), then add risk distribution (module 4) and program coverage (module 5).