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>
1.7 KiB
1.7 KiB
Object Router
Purpose
Top-level frontend URL routes are declared through React Router object configuration instead of inline JSX route declarations.
Files
frontend/src/app/appRoutes.tsxfrontend/src/app/ModuleRouteGuard.tsxfrontend/src/app/shellOutletContext.tsfrontend/src/app/AppRouter.tsxfrontend/src/app/AppProviders.tsxfrontend/src/shared/constants/routes.tsfrontend/src/shared/constants/moduleRoutes.tsfrontend/src/pages/modules/
Runtime Shape
App.tsxrenders provider composition and the router only.AppProvidersowns global providers, includingBrowserRouter.AppRouterrendersuseRoutes(appRoutes).appRoutesowns top-level route objects and nested product module routes.APP_ROUTE_PATHSowns route path constants that are reused outside the router.MODULESowns module metadata, including each module route path.- Product route pages are loaded with
React.lazy. AppLayoutis the shared shell route element and passes shell props through outlet context.- Module navigation uses route navigation instead of local active-module state.
Rules
- Do not add individual
<Route>declarations toApp.tsx. - Keep route elements thin; product behavior belongs in business hooks.
- Reuse
APP_ROUTE_PATHS.loginfor auth-expired redirects. - Add route-config and module-route metadata tests when routes change.
- New product modules must define a route path and a lazy page adapter.
- Restricted product routes should redirect to
/dashboardunless a specific access-state UX is implemented and tested. - Use object routes as the default pattern unless React Router data APIs require a later move to
createBrowserRouter.