Frontend Architecture Overview
Frontend Architecture Overview
Section titled “Frontend Architecture Overview”The frontend is a Next.js App Router application with a module-driven UI and provider-heavy client runtime.
Architecture Layers
Section titled “Architecture Layers”- App Routing Layer
- Next.js routes in
src/app/*handle URL entry and auth-gated redirection.
- Runtime Provider Layer
- Global providers in
src/app/providers.tsxcompose session, query cache, module access, tabs, lock state, notifications, chat socket, and UI overlays.
- Module Navigation Layer
moduleRegistrydefines module keys, labels, icons, lazy components, and add-on nesting.ModuleAccessProviderfilters available modules per user and produces sidebar-ready buttons.TabProvidertracks activeModuleKeyin UI state.
- Render Layer
Handlevalidates route module access and synchronizes active tab.MainViewandRenderComponentlazy-load module entry components.
- Domain Layer
- Feature modules live under
src/modules/*. - Shared primitives live under
src/components/*andsrc/context/*.
Key Frontend Concepts
Section titled “Key Frontend Concepts”- URL route and current tab are coordinated but distinct.
- Module visibility is permission-derived, not hardcoded in view components.
- Parent module entries can expose add-ons via nested
childrenbuttons. - Many modules rely on shared component primitives (
DynamicTable,TabManager,SidePanel,ListEngine).
Priority Risk Areas
Section titled “Priority Risk Areas”- Provider ordering regressions in
src/app/providers.tsx - Module access filtering and add-on visibility
- Route/module mismatch handling in
Handle - Cross-tab state sync flows (lock, notifications, chat)