Skip to content

Context Model (App State Only)

Principle

Context is for cross-page app state. Server datasets belong to query hooks (TanStack), not context.

Current Contexts

  • auth - session identity, current user, auth actions
  • system - system permission catalog (from /system/permissions)
  • notifications - global notifications + unread count
  • ui - global busy/session UI state
  • theme - theme and persistence behavior

Aggregation

src/context/index.ts contains:

  • static registry (getContext, getContexts)
  • wrapper helper (wrapWithContexts)
  • app wrapper (AppContextProvider)

This allows one import point and consistent provider order.