40227-vm/frontend/docs/vocational-opportunities.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

49 lines
1.9 KiB
Markdown

# Vocational Opportunities Frontend Slice
## Purpose
Vocational Opportunities follows the frontend three-layer architecture and loads opportunity records from the backend content catalog.
```text
View -> Business Logic -> API/Data Access -> Backend
```
The frontend keeps only presentation configuration in shared constants. Vocational opportunity records are backend-owned runtime content.
## Files
View layer:
- `frontend/src/components/frameworks/VocationalOpportunities.tsx`
- `frontend/src/components/vocational-opportunities/`
Business logic layer:
- `frontend/src/business/vocational/hooks.ts`
- `frontend/src/business/vocational/selectors.ts`
Shared constants and types:
- `frontend/src/shared/constants/contentCatalog.ts`
- `frontend/src/shared/constants/vocational.ts`
- `frontend/src/shared/types/vocational.ts`
API/data access layer:
- `frontend/src/shared/api/contentCatalog.ts`
- `frontend/src/shared/types/contentCatalog.ts`
## Behavior
- The framework component is a thin wrapper around `useVocationalOpportunities`.
- Opportunity records load from `GET /api/public/content-catalog/vocational-opportunities`.
- Shared constants own zip search configuration, category previews, category icon keys, and style tokens.
- Business selectors own zip normalization, local search result derivation, filtering, category lists, and stats.
- Business hook owns content loading, zip input, search state, search text, category filter, expanded card state, and saved opportunity state.
- View components render header, zip search, pre-search state, loading state, filters, stats, result cards, and empty results.
- Views render explicit loading and error states from the content catalog query.
## Management Contract
If vocational opportunities become tenant-owned or admin-editable beyond content catalog management, add a typed backend management contract and keep the frontend integration on the same path: `shared/api` + `business/vocational` + thin views.