40227-vm/frontend/docs/community-service.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

# Community Service Frontend Slice
## Purpose
Community Service & School Partnerships follows the frontend three-layer architecture and loads organization records from the backend content catalog.
```text
View -> Business Logic -> API/Data Access -> Backend
```
The frontend keeps only presentation configuration in shared constants. Community organization records are backend-owned runtime content.
## Files
View layer:
- `frontend/src/components/frameworks/CommunityService.tsx`
- `frontend/src/components/community-service/`
Business logic layer:
- `frontend/src/business/community/hooks.ts`
- `frontend/src/business/community/selectors.ts`
Shared constants and types:
- `frontend/src/shared/constants/contentCatalog.ts`
- `frontend/src/shared/constants/community.ts`
- `frontend/src/shared/types/community.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 `useCommunityService`.
- Organization records load from `GET /api/public/content-catalog/community-organizations`.
- Shared constants own partnership labels/classes, age group labels, and category icon keys.
- Business selectors own category extraction, typed select value normalization, organization filtering, and stats.
- Business hook owns content loading, search text, category/type/age filters, expanded organization state, saved organization state, and filter panel state.
- View components render header, filters, stats, organization cards, details, and empty state.
- Views render explicit loading and error states from the content catalog query.
## Management Contract
If community organizations 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/community` + thin views.