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.7 KiB
2.7 KiB
Zones Of Regulation Integration
Purpose
ZonesOfRegulation renders backend-owned regulation zone content through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Runtime zone records, behaviors, strategies, matching signs, safety connections, and quick de-escalation flow content belong to backend content catalog payloads. The frontend owns only UI state, tab config, style-token mappings, and presentation.
Frontend Layers
View:
frontend/src/components/frameworks/ZonesOfRegulation.tsxfrontend/src/components/zones-of-regulation/ZonesOfRegulationView.tsxfrontend/src/components/zones-of-regulation/ZonesHeader.tsxfrontend/src/components/zones-of-regulation/ZonesTabs.tsxfrontend/src/components/zones-of-regulation/ZonesOverviewGrid.tsxfrontend/src/components/zones-of-regulation/ZoneOverviewCard.tsxfrontend/src/components/zones-of-regulation/ZoneDetailPanel.tsxfrontend/src/components/zones-of-regulation/ZoneDetailListPanel.tsxfrontend/src/components/zones-of-regulation/ZoneSignsPanel.tsxfrontend/src/components/zones-of-regulation/ZoneSafetyConnectionPanel.tsxfrontend/src/components/zones-of-regulation/ZonesQuickFlow.tsx
Business logic:
frontend/src/business/zones/hooks.tsfrontend/src/business/zones/selectors.tsfrontend/src/business/zones/types.ts
Shared contracts and UI config:
frontend/src/shared/types/app.tsfrontend/src/shared/constants/zonesOfRegulation.tsfrontend/src/shared/constants/contentCatalog.ts
Backend Contracts
The page reads:
GET /api/public/content-catalog/regulation-zonesGET /api/public/content-catalog/zones-of-regulation-page-content
Content payloads are seeded in:
backend/src/db/seeders/content-catalog-data/content-catalog-seed-payloads.js
Behavior
useZonesOfRegulationPageloads zone records and page-level content.- Selectors handle expanded-zone toggling, selected-zone lookup, safety connection lookup, and active-tab wording.
- View components receive a prepared page model and do not call API/data access modules.
- Loading and error states are explicit through
StatePanel. - The module preserves the current behavior: selecting a zone expands details; zone check-in persistence remains owned by the dashboard check-in flow until a dedicated UX task adds it here.
Data Ownership Rules
- Do not add zone records, QBS safety connection copy, or de-escalation flow content to frontend constants.
- Do not add frontend fallback zone payloads.
- Keep frontend constants limited to tab labels, default UI state, gradients, and ring classes.
- Test-only fixtures may live in selector tests or
frontend/src/test-seeds/.