Skip to main content

uicommon

Used by all verticals. Provides authentication, HTTP utilities, and theming.


Project Structure

Resolved via the nnet-uicommon alias in {workspace}/{vertical}/ui/vite.config.ts.

uicommon/
├── auth/
│ ├── auth.tsx # AuthProvider, useAuth, ProtectedRoute, LoginButton
│ └── logout.tsx # performLogout
├── config/
│ └── runtimeConfig.ts # getRuntimeConfig, useRuntimeConfig
├── services/
│ └── auth_api.ts # get_session, logout (calls Auth Service)
└── utils/
├── ffb_api.ts # fetchJson, postJson, uploadToS3
├── ffb_cache.ts # Client-side caching with TTL
├── result.ts # Result<T> response type
└── useTheme.ts # Dark mode hook

Key Exports

ModuleExportsDescription
auth/authAuthProvider, useAuth, ProtectedRoute, LoginButtonAuthentication state and route protection
utils/useThemeuseThemeDark/light mode based on system preference
utils/ffb_apifetchJson, postJson, uploadToS3HTTP client with built-in caching
services/auth_apiget_session, logoutCalls the Auth Service