Frontend: - Replace Next.js with Vite + React + TypeScript - Add new component architecture (app-shell, sidebar, dashboard modules) - Implement product modules: FRAME, safety protocols, walkthrough checkin, campus/staff attendance, personality quiz, sign language, classroom timer - Add shadcn/ui component library with Tailwind CSS - Remove legacy generated components, stores, and pages Backend: - Add product migrations: frame_entries, user_progress, safety_quiz_results, walkthrough_checkins, communication_events, personality_quiz_results, campus_attendance_config/summaries, staff_attendance_records, content_catalog - Add corresponding models, services, and routes - Implement cookie-based auth with refresh token rotation - Add content catalog seeder with product content - Migrate to ESLint flat config - Switch from yarn to npm Infrastructure: - Update .gitignore for new tooling - Add project documentation (CLAUDE.md, docs/) - Remove deprecated config files and yarn.lock Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.6 KiB
2.6 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/dashboard/DashboardZoneCheckIn.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 zone check-in through
useZoneCheckIn
Behavior
useDashboardPagecomposes all dashboard data sources into one page model.- 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/.