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>
3.0 KiB
3.0 KiB
ESA Funding Integration
Purpose
ESAFunding renders backend-owned ESA funding training content through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Static ESA explanatory copy and FAQs live in dedicated frontend constants. Editable ESA lists, staff role guidance, parent conversation script, and resource records belong to the backend content catalog. The frontend also owns local UI state, URL validation, acknowledgement interaction state, and presentation.
Frontend Layers
View:
frontend/src/components/frameworks/ESAFunding.tsxfrontend/src/components/esa-funding/EsaFundingView.tsxfrontend/src/components/esa-funding/EsaFundingHeader.tsxfrontend/src/components/esa-funding/EsaFundingHero.tsxfrontend/src/components/esa-funding/EsaFundingStateNotice.tsxfrontend/src/components/esa-funding/EsaFundingKeyPoints.tsxfrontend/src/components/esa-funding/EsaFundingApprovedUses.tsxfrontend/src/components/esa-funding/EsaFundingImpactRoles.tsxfrontend/src/components/esa-funding/EsaFundingFaq.tsxfrontend/src/components/esa-funding/EsaFundingQuickReference.tsxfrontend/src/components/esa-funding/EsaFundingResources.tsxfrontend/src/components/esa-funding/EsaFundingAcknowledgement.tsxfrontend/src/components/esa-funding/EsaFundingIcon.tsx
Business logic:
frontend/src/business/esa-funding/hooks.tsfrontend/src/business/esa-funding/selectors.tsfrontend/src/business/esa-funding/types.ts
Shared contracts:
frontend/src/shared/types/esaFunding.tsfrontend/src/shared/constants/esaFunding.tsfrontend/src/shared/constants/contentCatalog.ts
Backend Contract
The page reads:
GET /api/public/content-catalog/esa-funding-content
Content payload is seeded in:
backend/src/db/seeders/content-catalog-data/content-catalog-seed-payloads.js
Behavior
useEsaFundingPageloads ESA funding content and owns local FAQ expansion plus acknowledgement state.- Static ESA intro, state notice copy, and FAQs are read from
frontend/src/shared/constants/esaFunding.ts. - Selectors handle FAQ toggling and resource URL validation.
- View components receive a prepared page model and do not call API/data access modules.
- Loading and error states are explicit through
StatePanel. - Resource records with valid
httporhttpsURLs render as external links. Invalid or placeholder URLs render as unavailable instead of using no-op click handlers.
Data Ownership Rules
- Static ESA explanatory copy and FAQs may live in
frontend/src/shared/constants/esaFunding.ts. - Do not add editable ESA funding records such as approved uses, key points, checklist items, role guidance, conversation scripts, or resource records to frontend constants.
- Do not add frontend fallback ESA content payloads.
- Keep frontend logic limited to workflow state, resource URL validation, icon mapping, and presentation.
- Test-only fixtures may live in selector tests or
frontend/src/test-seeds/.