Skip to content

Providers and Runtime Context

Global providers are composed in src/app/providers.tsx.

  1. TenantProvider
  2. QueryClientProvider
  3. SessionProvider
  4. LockProvider
  5. NotifProvider
  6. ModuleAccessProvider
  7. BarLoaderProvider
  8. TabProvider
  9. SoundContext.Provider
  10. ChatSocketProvider
  11. SignOutOverlayProvider
  12. ProfileImageProvider
  13. ChatProvider
  • ModuleAccessProvider and module consumers rely on session-backed data.
  • TabProvider consumers (navigation, handlers) must render below it.
  • Chat runtime (ChatSocketProvider, ChatProvider) depends on session context.
  • LockProvider overlays the application and should wrap downstream UI.

ClientShell initializes runtime module context:

  • Sets setModulesInfo(initialModules) from server-fetched modules.
  • Loads and applies sidebar sort order config.
  • Persists module cache in local storage.

Treat provider order changes as architecture changes.

When changing order:

  1. Confirm all consuming hooks still mount beneath their providers.
  2. Test auth flows (/, /app, /logout).
  3. Test sidebar/module visibility and chat startup.
  4. Test lock screen behavior and cross-tab sync.