Module System and Registry
Module System and Registry
Section titled “Module System and Registry”Source of Truth
Section titled “Source of Truth”src/utils/moduleRegistry.ts defines:
ModuleKey- module metadata (
label, icons, lazy component) - optional add-on relationships (
addOns)
ModuleAccessProvider Responsibilities
Section titled “ModuleAccessProvider Responsibilities”src/context/ModulesProvider.tsx:
- Receives raw module keys for current user
- Applies permission filtering and add-on logic
- Produces UI-ready
buttonsfor navigation - Exposes mutable
modules,sortOrder, and setters
Rendering Path
Section titled “Rendering Path”- Route hits
/appor/app/[module] Handlevalidates module against accessible button treeMainViewrendersRenderComponentRenderComponentresolves module entry from registry and lazy-loads module
Parent and Add-on Behavior
Section titled “Parent and Add-on Behavior”Parent modules may contain add-ons.
Filtering rules:
- Parent is shown when parent is accessible
- Parent may still appear when only child add-ons are accessible
- Child button list is reduced to accessible add-ons
Documentation Contract
Section titled “Documentation Contract”For every module key in moduleRegistry, docs should include:
- module purpose
- route entry behavior
- permission expectations
- critical components/hooks/services
- known failure modes