Admin portal
Internal staff app (ziteox-admin) — team-member side of Ziteox Account.
Admin portal
Purpose
The admin portal is Ziteox’s internal staff app (ziteox-admin). It is the team-member side of a Ziteox Account: operators manage organizations, projects, infrastructure, billing, outreach, gatekeep, MCP agents, and company tools. Clients use the client portal; shared identity lives on Ziteox Account.
Current state
| Piece | Status |
|---|---|
| Next.js admin app | In progress / live ops — monorepo app ziteox-admin |
| Sign-in via Ziteox Account | In progress — handoff routes wired; production gated with Account |
| Hosting | Vercel (monorepo root Directory ziteox-admin per platform README) |
| Domain | Default https://admin.ziteox.com in shared auth sites / handoff registry |
| Cloudflare Access on admin | Planned — phase 2 after Account go-live |
Who uses it
Staff with admin app memberships (super_admin, admin, project_manager in core.app_roles). Handoff registration sets require_staff = true and require_second_factor = true for client id admin.
Main areas (from sidebar + routes)
Sidebar: portal: ziteox-admin/src/components/admin/admin-sidebar.tsx. Dashboard routes under portal: ziteox-admin/src/app/dashboard/.
| Nav / hub | Paths (examples) |
|---|---|
| Overview | /dashboard |
| Outreach | /dashboard/outreach (+ map, queue) |
| Onboarding | /dashboard/onboarding, proposals, prototypes |
| Operations | /dashboard/operations — organizations, users, projects, domains |
| Infrastructures | /dashboard/infrastructures — quotas, bundles, usage, cost |
| Distribution | /dashboard/distribution |
| Office | /dashboard/work-orders, upgrades, calendar |
| Partners | /dashboard/partners |
| Beta | /dashboard/beta, site-previews, setup-prompts, email |
| Gatekeep | /dashboard/gatekeep, approvals, assets, tickets |
| Company | /dashboard/company (docs, brand assets, resources, team, ZiX, …) |
| Changelog | /dashboard/changelog |
| Billing / Finance | /dashboard/billing, /dashboard/finance |
| System | /dashboard/system — audit, sessions, access, settings, roles, hierarchy |
| MCP / agents | /dashboard/mcp, company ZiX hub (/dashboard/company/zix) |
Auth & roles
- Handoff —
/auth/start→ Account →/auth/handoff; helpers inportal: ziteox-admin/src/lib/auth-handoff.ts. Post-session gates: user match, aal2, fresh second factor (12h), staff. - API gate —
requireAdmindefaults to aal2 (portal: ziteox-admin/src/lib/api-auth.ts). - Role ceiling — nobody grants above their own rank (
portal: packages/auth/src/roles/ceiling.ts; admin also has local copies understandalone-auth/roles). - Legacy RBAC — permissions /
user_rolesstill used for route and API permission slugs (e.g. proposals in admin README).
Data it owns / drives
Shared Supabase project with layered schemas (see portal linking). Admin is the heavy writer for ops data. Notable admin-adjacent pieces:
| Area | Notes |
|---|---|
core.* | Orgs, roles, memberships, invites, audit, MCP tokens, handoff codes, apps |
projects.* | Projects, domains, work orders, prospects |
billing.* / finance.* | Invoices, expenses, payees |
infra.* | Quotas, vendors, infra.secrets (KMS sealed keys) |
outreach.* / inbound.* / partner.* / zix.* / email.* / hosting.* / support.* | Per TABLE_SCHEMA in @ziteox/supabase-routing |
Migrations live under both portal: ziteox-admin/supabase/migrations/ and portal: ziteox-client/supabase/migrations/ (platform README points sync at client supabase folder).
KMS / secrets vault
- Table
infra.secrets(+infra.secret_audit, viewinfra.secrets_meta) — AES-256-GCM ciphertext only; service_role; no anon/authenticated policies. - Migration:
portal: ziteox-admin/supabase/migrations/20261028220000_infra_secrets_kms.sql(header: local-first; do not apply to prod without Laki OK). - Admin API:
portal: ziteox-admin/src/app/api/infra/secrets/route.ts— list metadata / seal / rotate; aal2 viarequireAdmin; never returns plaintext. - Resolve path for provider refs:
portal: ziteox-admin/src/lib/secrets/resolve-provider-secret.ts.
Connections & MCP
- App connections —
core.app_connections(handoff first/last use); see portal-linking. - MCP service tokens —
core.mcp_service_tokens(prefixzxmcp_); issue/revoke in admin (portal: ziteox-admin/src/lib/mcp-service-tokens.ts); MCP HTTP at/api/mcp. - ZiX connections — product tables/migrations
zix_connections(company ZiX hub) — separate from Accountapp_connections.
Hosting / domain
| Fact | Source |
|---|---|
Vercel project root ziteox-admin | portal: README.md, MONOREPO_MIGRATION.md |
Default origin https://admin.ziteox.com | portal: packages/auth/src/sites.ts, handoff registry, core.apps site registration |
| Production DNS live confirmation | (unverified) beyond code defaults / docs |
Forge Core integration (decided 2026-11-01)
Locked decisions. The portal side is not built yet.
- Core project tokens (
zxcore_) are per project — never one member token spanning projects. - The admin portal registers Core projects and obtains project tokens on a member’s behalf via Ed25519 admin assertions (
member_idclaim). - The admin portal shows one admin screen listing a member’s tokens across all their projects via Core
GET /v1/admin/members/:memberId/tokens(local-only today). - See Admin portal integration.
Interfaces
| Kind | What |
|---|---|
| App | ziteox-admin |
| Domain (default) | admin.ziteox.com |
| Auth entry | /auth/start, /auth/handoff, /auth/signout |
| MCP | /api/mcp, service-accounts APIs under /api/mcp/ |
| Secrets | /api/infra/secrets |
Related
Sources
portal: ziteox-admin/src/components/admin/admin-sidebar.tsxportal: ziteox-admin/src/app/dashboard/portal: ziteox-admin/src/lib/api-auth.ts,auth-handoff.ts,mcp-service-tokens.tsportal: ziteox-admin/src/app/api/infra/secrets/route.tsportal: ziteox-admin/supabase/migrations/20261028220000_infra_secrets_kms.sqlportal: ziteox-admin/supabase/migrations/20261029220000_app_role_registry.sqlportal: ziteox-admin/supabase/migrations/20261031200000_app_site_registration.sqlportal: packages/auth/src/sites.ts,roles/registry.ts,handoff/registry.tsportal: packages/supabase-routing/src/index.tsportal: README.md- Forge:
docs/core/admin-portal-integration.mdx