40227-vm/frontend/docs/user-progress-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

2.2 KiB

User Progress Frontend Integration

Purpose

User progress follows the frontend three-layer architecture for sign language progress and dashboard zone check-ins.

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

Files

View layer:

  • frontend/src/components/frameworks/SignLanguage.tsx
  • frontend/src/components/sign-language/SignLanguageProgressPanel.tsx
  • frontend/src/components/sign-language/SignLanguageVideoModal.tsx
  • frontend/src/components/frameworks/Dashboard.tsx
  • frontend/src/components/dashboard/DashboardZoneCheckIn.tsx
  • frontend/src/components/frameworks/ZonesOfRegulation.tsx
  • frontend/src/components/zones-of-regulation/ZonesOfRegulationView.tsx

Business logic layer:

  • frontend/src/business/dashboard/hooks.ts
  • frontend/src/business/dashboard/selectors.ts
  • frontend/src/business/sign-language/hooks.ts
  • frontend/src/business/sign-language/selectors.ts
  • frontend/src/business/user-progress/hooks.ts
  • frontend/src/business/user-progress/mappers.ts
  • frontend/src/business/user-progress/types.ts

API/data access layer:

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

Constants:

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

Behavior

  • Learned sign IDs load from GET /api/user_progress?progress_type=sign_learned.
  • Marking a sign learned uses POST /api/user_progress.
  • Unmarking a sign uses DELETE /api/user_progress/by-item.
  • The sign language page combines user progress with backend content catalog records in useSignLanguagePage.
  • Dashboard zone check-in uses item_id=current and progress_type=zone_checkin; dashboard page composition lives in useDashboardPage.
  • The zones of regulation page currently renders content catalog records only. It does not persist check-ins; adding that interaction requires a dedicated UX task.
  • Views render explicit backend errors from React Query state.
  • User progress ownership is derived by the backend from the authenticated session.

Other module progress types should reuse this API only when the data is truly current-user progress. Aggregate director reporting should use separate backend summary endpoints.