2.9 KiB
2.9 KiB
Dashboard Integration
Purpose
Dashboard composes current-user operational data from backend APIs and content catalog payloads through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Runtime quote, compliance, sign-of-week, FRAME, communication event, and zone check-in data comes from backend-backed hooks. The frontend owns only UI state, navigation config, zone option styling, and presentation.
Frontend Layers
View:
frontend/src/components/frameworks/Dashboard.tsxfrontend/src/components/dashboard/DashboardView.tsxfrontend/src/components/dashboard/DashboardHero.tsxfrontend/src/components/dashboard/DashboardQuotePanel.tsxfrontend/src/components/zone-checkin/ZoneCheckInCard.tsxfrontend/src/components/dashboard/DashboardFramePreview.tsxfrontend/src/components/dashboard/DashboardUpcomingEvents.tsxfrontend/src/components/dashboard/DashboardWeeklyProgress.tsxfrontend/src/components/dashboard/DashboardSignOfWeek.tsxfrontend/src/components/dashboard/DashboardQuickActions.tsx
Business logic:
frontend/src/business/dashboard/hooks.tsfrontend/src/business/dashboard/selectors.tsfrontend/src/business/dashboard/types.ts
Shared contracts and UI config:
frontend/src/shared/types/dashboard.tsfrontend/src/shared/constants/dashboard.tsfrontend/src/shared/constants/contentCatalog.ts
Backend Contracts
Content catalog:
GET /api/public/content-catalog/dashboard-encouraging-quotesGET /api/public/content-catalog/dashboard-compliance-itemsGET /api/public/content-catalog/dashboard-sign-of-week
Feature APIs:
- F.R.A.M.E. entries through
useFrameEntries - Communication events through
useCommunicationEvents - Current-user daily Emotional Zone check-in through
useTodayZoneCheckIn(campus-staff roles only; seezone-checkin-integration.md)
Behavior
useDashboardPagecomposes all dashboard data sources into one page model.- The hero's "Week of …" uses the shared American (Sunday-start) week util (
shared/business/week.ts) — the same canonicalization as the F.R.A.M.E. week picker and the safety-quiz week. - Selectors handle greeting calculation, day-based quote selection, zone normalization, event limiting, and role-filtered quick actions.
- View components receive prepared props and do not call API/data access modules.
- Loading, empty, and error states remain explicit for each dashboard section.
- The existing
Dashboardprops API is preserved while the framework component becomes a thin wrapper.
Data Ownership Rules
- Do not add dashboard quote, compliance, sign-of-week, FRAME, event, or zone progress records to frontend constants.
- Keep frontend constants limited to quick-action navigation config, zone button style config, and display limits.
- Test-only fixtures may live in selector tests or
frontend/src/test-seeds/.