2.6 KiB
Admin App Access Setup
The admin app is designed to be internal-only and requires a separate privileged token flow.
Required admin worker configuration
Set these values for apps/admin:
ADMIN_APP_ACCESS_TOKENADMIN_APP_SESSION_SECRET
ADMIN_APP_ACCESS_TOKEN is the first-layer token required before the admin SPA will be served.
ADMIN_APP_SESSION_SECRET signs the worker-issued app session cookie after that token is accepted.
Production domain: https://admin-panel.xtablo.com
Deploy commands
Use the root command:
pnpm deploy:admin
Or directly from the app package:
pnpm --filter @xtablo/admin deploy
Required API configuration
Set these values for apps/api:
ADMIN_TOKEN_SIGNING_SECRETADMIN_TOKEN_AUDIENCEADMIN_APP_URL
ADMIN_TOKEN_SIGNING_SECRET signs short-lived admin session tokens.
ADMIN_TOKEN_AUDIENCE scopes privileged access to the admin app only.
ADMIN_APP_URL is the allowed frontend origin for the admin surface, for example https://admin-panel.xtablo.com.
Access model
- The operator reaches the private
apps/admindeployment from the internal network boundary. - The admin worker presents a dedicated app-access gate before any SPA asset is served.
- The operator submits the app access token, and the worker issues a signed session cookie.
- Only then does the browser load the React admin shell.
- Inside the shell, the operator pastes a separate privileged admin API token.
POST /admin/auth/exchangevalidates that token and returns a short-livedadmin_session.- The admin app stores that session locally and attaches it as a bearer token for admin routes.
- All privileged data and mutations go through
/admin/*API routes guarded by admin middleware.
Normal product auth is not sufficient for admin access.
Current guarded routes
GET /admin/overviewGET /admin/tablesGET /admin/tables/:tableId/metaGET /admin/tables/:tableId/rowsPATCH /admin/tables/:tableId/rows/:rowIdGET /admin/datasetsGET /admin/datasets/:datasetIdGET /admin/actionsPOST /admin/actions/:actionId/run
All write paths emit admin audit log entries.
Local development
- Run the API and local Supabase stack.
- Start the admin app with
pnpm dev:admin. - Configure worker env for
ADMIN_APP_ACCESS_TOKENandADMIN_APP_SESSION_SECRET. - Use the app-access token at the worker gate, then use a valid privileged API token compatible with
ADMIN_TOKEN_SIGNING_SECRETandADMIN_TOKEN_AUDIENCE.
Initial action coverage
deactivate_tablo_accessgrant_tablo_admin
Initial analytics coverage
profile_growthplan_mixtablo_access_mix