ASAgriSense/Docs/Dashboard

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#

RoleDashboard scope
Entity AdminOrganisation-wide aggregates across all regions.
Regional ManagerTheir assigned region — all districts within it.
District ManagerTheir assigned district — all communities within it.
Sustainability OfficerTheir assigned communities only.
AuditorConfigured scope (org, region, or district — set at account creation).

Dashboard widgets#

WidgetDescription
Farmer countTotal farmers enrolled in scope, broken down by status (active/pending/inactive).
Compliance ratePercentage of active farmers meeting all 5 EUDR conditions.
Risk distributionPie/bar chart of plots by risk level (low/medium/high/critical/pending).
Program coveragePercentage of farmers enrolled in each active program type.
Recent activityTimeline of recent enrollments, assessments, and compliance changes.
Survey completionBaseline 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#

PackageTypeKey exports
@repo/feature-dashboardBackendServices: dashboard-summary, metric aggregators per module
@repo/dashboard-contractsShareddashboardSummaryQuerySchema, dashboardSummaryResponseSchema, tenantSlugSchema

API route#

RouteNotes
/api/dashboardReturns 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).