1.9 KiB
1.9 KiB
Community Service Frontend Slice
Purpose
Community Service & School Partnerships follows the frontend three-layer architecture and loads organization records from the backend content catalog.
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.tsxfrontend/src/components/community-service/
Business logic layer:
frontend/src/business/community/hooks.tsfrontend/src/business/community/selectors.ts
Shared constants and types:
frontend/src/shared/constants/contentCatalog.tsfrontend/src/shared/constants/community.tsfrontend/src/shared/types/community.ts
API/data access layer:
frontend/src/shared/api/contentCatalog.tsfrontend/src/shared/types/contentCatalog.ts
Behavior
- The framework component is a thin wrapper around
useCommunityService. - Organization records load from
GET /api/content-catalog/read/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.