ui-admin-application — React Tenant Admin Panel
By Engineering Team•October 10, 2026•5 min read
Responsibility
ui-admin-application is the operator-facing counterpart to ui-application — tenant admins and staff manage catalog, inventory, pricing, shipment configuration, and mobile-app content through this panel rather than any direct backend access. Like the shopper app, it holds no independent business logic beyond orchestrating calls to the services that own each decision.
- Feature Triad (5-file) — every feature directory is exactly
<Feature>Types.ts(interfaces, no logic) →<Feature>Repository.ts(the only file importingapiClient, one file per microservice boundary) →<Feature>Service.ts(pure data-mapping functions, no React) →<Feature>Controller.ts(a custom hook doing state orchestration, readsauthStoreonce) →<Feature>Page.tsx(stateless JSX). A multi-level feature (e.g. Category) may shareTypes/Repository/Serviceacross sub-pages while each sub-level gets its ownController/Pagepair. - Wizard/Multi-Step pattern —
stockEntryandmobileAppConfigare the canonical references for any feature needing a guided multi-step flow (step ownership of state,StepIndicator/StepConnector, section title bar, footer navigation). - Multi-tenancy —
TenantIDcomes from the Firebase JWT only, flowing one direction:authStore→ controller → service argument → repository argument →apiClientheader. It is never injected insideapiClient.tsitself, never read fromauthStoreinside a repository or service, and never passed as a prop through a component tree. - HTTP & error handling —
apiClient.tsis the single Axios instance for every backend call; its interceptors attachAuthorization/X-Tenant-ID/X-Firebase-AppCheck, map HTTP errors to a typedAppError, and on a 401 clearauthStoreand redirect to/login. - Global state boundary — Zustand’s
authStoreis the only cross-feature global state in the app; no Redux or Context is used for feature-local state. - Observability —
initTracing(otelEndpoint?, apiBaseUrl?), called once inmain.tsx, wiresXMLHttpRequestInstrumentationwithpropagateTraceHeaderCorsUrls;traceparentis injected by the instrumentation itself,X-Correlation-IDis minted per-request viacrypto.randomUUID()—X-Tenant-IDis deliberately not injected at this layer.startUploadSpantracks upload lifecycles, delegated fromfeatures/media/MediaService.ts. - Firebase App Check —
ReCaptchaV3Providerin non-DEV builds;import.meta.env.DEVskipsinitializeAppCheckentirely and the interceptor instead sendsVITE_FIREBASE_APPCHECK_DEBUG_TOKENdirectly, matchingui-application’s anduser-secure-engine’s debug token; see [[06-security]] for the cross-service mismatch hazard.
Tech Stack
| Concern | Choice |
|---|---|
| Language / framework | TypeScript (strict) / React 18 + Vite |
| UI library | MUI v6 |
| Global state | Zustand (authStore only) |
| Networking | Axios, single instance (apiClient.ts) |
| Routing | React Router v6, lazy-loaded via React.lazy |
| Logging | loglevel, structured debug/warn/error convention |
Implementation Notes
- Page-level screenshot walkthroughs for this app’s screens (category master, mobile-app-configure, package master, product catalog, stock entry, tenant master, warehouse master) live under this application’s
07-ui-admindoc section, one hub doc per feature area. - This app never sends
X-Tenant-IDfrom a hardcoded or client-chosen value — it is always sourced from the authenticatedauthStorestate populated after Firebase sign-in, consistent with [[06-security]]‘s header contract.
Related Documents
Full module reference: ui-admin-application/CLAUDE.md.