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.0 KiB
2.0 KiB
Policies Integration
Purpose
The handbook and policies workflow reads and mutates policy documents through the backend documents API.
Frontend Structure
- Framework wrapper:
frontend/src/components/frameworks/HandbookPolicy.tsx - Focused view components:
frontend/src/components/policies/ - Business hooks:
frontend/src/business/policies/hooks.ts - Business page workflow hook:
frontend/src/business/policies/pageHooks.ts - Business mappers:
frontend/src/business/policies/mappers.ts - Business selectors:
frontend/src/business/policies/selectors.ts - API layer:
frontend/src/shared/api/documents.ts - DTO types:
frontend/src/shared/types/documents.ts - Policy types/constants:
frontend/src/shared/types/policies.ts,frontend/src/shared/constants/policies.ts
Backend Contract
The slice uses the existing backend route:
GET /api/documents?category=policyPOST /api/documentsPUT /api/documents/:idDELETE /api/documents/:id
Policy records are represented as documents rows:
category: fixed topolicyentity_type: fixed toorganizationentity_reference: policy category displayed in the handbookname: policy titlenotes: policy contentuploaded_at: recorded mutation timestamp
Behavior
HandbookPolicyis a thin wrapper that callsusePoliciesPageand rendersPoliciesView.- Policy UI is split into focused components for the hero, create form, filters, status panels, list, cards, and empty state.
- Policy forms and filters use shared UI primitives:
Button,Input,Textarea,NativeSelect, andStatePanel. - Policy list/create/update/delete flows use React Query hooks and backend error states.
- Director and superintendent roles can manage policies in the frontend.
- Acknowledgement state remains session-local because the backend does not yet expose a policy acknowledgement contract.
Verification
npm run buildpasses.npm run lintpasses for the current frontend baseline.npm run typecheckpasses.npm run testpasses.