Module Registry Service
Component Detail
Service Layer
high complexity
Shared Component
mobile
0
Dependencies
4
Dependents
1
Entities
0
Integrations
Description
Riverpod-based service that parses the bootstrap API response to extract the tenant's enabled module set, exposes reactive streams of active navigation items and home widgets, and caches the module state in Drift for offline availability. Each area registers its nav item, widget factory, and deep-link routes against its area ID at app startup; disabled areas are not mounted.
module-registry-service
Responsibilities
- Parse the bootstrap API response to extract the tenant's enabled module set
- Expose reactive streams of active NavItems and HomeWidget factories filtered by user role from JWT claims
- Allow each area to register its nav item, home widget factory, and deep-link routes at startup via a declarative registry
- Cache the enabled module set in Drift so the home screen renders correctly when offline
- Apply role-aware filtering so role-restricted modules are excluded per JWT claims bag
Interfaces
registerArea(AreaRegistration registration) → void
Stream<List<NavItem>> get activeNavItems
Stream<List<HomeWidgetFactory>> activeHomeWidgets(UserRole role)
bool isModuleEnabled(String areaId)
Future<void> loadFromBootstrap(BootstrapResponse response) → void
Future<void> loadFromCache() → void
void reset() → void
Relationships
Dependents (4)
Components that depend on this component
Related Data Entities (1)
Data entities managed by this component