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.4 KiB
2.4 KiB
Safety Quiz Frontend Integration
Purpose
Safety/QBS quiz results follow the frontend three-layer architecture.
View -> Business Logic -> API/Data Access -> Backend
Files
View layer:
frontend/src/components/frameworks/QBSSafety.tsxfrontend/src/components/safety-quiz/frontend/src/components/frameworks/DirectorDashboard.tsxfrontend/src/components/director-dashboard/DirectorQuizResultsPanel.tsxfrontend/src/components/director-dashboard/DirectorRiskList.tsxfrontend/src/components/safety-quiz/SafetyQuizContentEditorPanel.tsx
Business logic layer:
frontend/src/business/safety-quiz/hooks.tsfrontend/src/business/safety-quiz/mappers.tsfrontend/src/business/safety-quiz/selectors.tsfrontend/src/business/safety-quiz/types.tsfrontend/src/business/director-dashboard/hooks.tsfrontend/src/business/director-dashboard/selectors.ts
API/data access layer:
frontend/src/shared/api/safetyQuizResults.tsfrontend/src/shared/types/safetyQuiz.ts
Constants:
frontend/src/shared/constants/safetyQuiz.ts
Behavior
- Quiz submission uses
POST /api/safety_quiz_results. - Staff completion and director dashboard rows load from
GET /api/safety_quiz_results. - QBS quiz content loads from
GET /api/public/content-catalog/safety-qbs-quiz. - Directors and superintendents can edit the QBS quiz content through the authenticated content catalog endpoint
PUT /api/content-catalog/safety-qbs-quiz. - Editable QBS quiz payloads are JSON-validated in the business layer before saving.
- Compliance views render empty and error states explicitly instead of substituting static staff rows.
- Result ownership is derived by the backend from the authenticated session.
QBSSafety.tsxis a thin wrapper that callsuseSafetyQuizPageand renders focused safety quiz view components.- Quiz score, progress, result feedback, and compliance summary are derived in business selectors.
- Weekly focus and key reminders are backend content payload fields, not frontend constants.
- Safety quiz view components use shared
Button,StatePanel, andModuleHeaderprimitives. - Director dashboard derives QBS completion metrics and risk rows in business selectors.
Remaining Related Work
If compliance needs pending/overdue rows for all staff, add a backend summary endpoint that joins staff membership with submitted results. Do not recreate pending staff rows in frontend static data.