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>
2.2 KiB
2.2 KiB
Sidebar Integration
Purpose
Sidebar renders app-shell navigation, module access, campus branding, and the current role badge through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Sidebar does not own product content records. It reads module metadata from shared app constants and uses backend-owned campus branding received from the app shell.
Frontend Layers
View:
frontend/src/components/frameworks/Sidebar.tsxfrontend/src/components/sidebar/SidebarView.tsxfrontend/src/components/sidebar/SidebarBrand.tsxfrontend/src/components/sidebar/SidebarNavigation.tsxfrontend/src/components/sidebar/SidebarCampusRolePanel.tsxfrontend/src/components/sidebar/SidebarIcons.tsx
Business logic:
frontend/src/business/app-shell/hooks.tsfrontend/src/business/app-shell/selectors.tsfrontend/src/business/app-shell/types.ts
Shared config:
frontend/src/shared/constants/appData.ts
Behavior
Sidebar.tsxis a thin wrapper that prepares the page model throughuseSidebarPage.AppLayoutreceives preparedsidebarPropsfromuseAppShelland does not assemble sidebar contracts inline.useSidebarPagefilters available modules by role and prepares role/campus display values.useAppShellresolves backend-owned campus branding intocampusInfobefore passing it to Sidebar.- Selectors handle module access, role labels, and campus initials outside JSX.
- Sidebar navigation calls the app-shell module navigation action, which navigates to the selected module route path.
- The active sidebar item is derived from the current URL route through the app-shell business layer.
- View components receive a prepared page model and do not call API/data access modules.
- Sidebar navigation uses the local
Buttonprimitive instead of raw controls.
Data Ownership Rules
- Do not add seeded campus records or module content to Sidebar components.
- Campus branding is backend-owned data and should keep flowing through
campusInfo. - Module IDs, route paths, and role access metadata stay centralized in
frontend/src/shared/constants/appData.tsuntil backend-owned module configuration is introduced.