40227-vm/frontend/docs/frame-integration.md
Dmitri d4a5378adf Refactor: migrate frontend to Vite/React, add product backend modules
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>
2026-06-09 15:18:23 +02:00

1.9 KiB

FRAME Frontend Integration

Purpose

FRAME follows the frontend three-layer architecture for persisted action-plan entries.

View -> Business Logic -> API/Data Access -> Backend

Files

View layer:

  • frontend/src/components/frameworks/FrameModule.tsx
  • frontend/src/components/frame/
  • frontend/src/components/frameworks/Dashboard.tsx
  • frontend/src/components/dashboard/DashboardFramePreview.tsx
  • frontend/src/components/frameworks/DirectorDashboard.tsx
  • frontend/src/components/director-dashboard/DirectorRecentFramePanel.tsx

Business logic layer:

  • frontend/src/business/frame/hooks.ts
  • frontend/src/business/frame/mappers.ts
  • frontend/src/business/frame/selectors.ts
  • frontend/src/business/frame/types.ts
  • frontend/src/business/dashboard/hooks.ts
  • frontend/src/business/director-dashboard/hooks.ts
  • frontend/src/business/director-dashboard/selectors.ts

API/data access layer:

  • frontend/src/shared/api/frame.ts
  • frontend/src/shared/types/frame.ts

Constants:

  • frontend/src/shared/constants/frame.ts

Behavior

  • FRAME entries load from GET /api/frame_entries.
  • Create/update workflows use typed API calls and React Query mutations.
  • FrameModule.tsx is a thin wrapper that calls useFrameModule and renders focused FRAME view components.
  • FRAME view components use shared UI primitives: Button, Input, Textarea, and StatePanel.
  • Static FRAME sample entries are not used as runtime persisted-data substitutes.
  • Empty and error states are rendered explicitly.
  • Dynamic F/R/A/M/E field access is typed through FrameSectionKey.
  • Director dashboard renders recent FRAME previews through director dashboard selectors instead of deriving preview rows in JSX.
  • Home dashboard renders the latest FRAME entry through useDashboardPage and DashboardFramePreview.

Dashboard zone check-ins are owned by the dashboard business layer and user progress API, not by FRAME.