Skip to main content

Admin UI

The admin section lives under /admin/*. Wrapped in AdminLayout (sidebar + outlet). Access guarded by RequirePlatformAdmin.

Pages

PathComponentStatus
/adminAdminOverviewKPIs (some live, some mock)
/admin/leadsAdminLeadsMock data — pipeline view
/admin/customersAdminCustomersMock data — paying customers + MRR
/admin/vendorsAdminVendorsMock data — agent publishers
/admin/agentsAdminAgentsLive — CRUD table
/admin/agents/newAdminAgentSubmitLive — create form
/admin/agents/:id/editAdminAgentEditLive — edit form
/admin/interactionsAdminInteractionsLive — event log

Guard

RequirePlatformAdmin checks useAuth().role === 'platform_admin'. On failure, redirects to /unauthorized. The check is client-side only — the backend re-enforces via PlatformAdminGuard on every write.

AdminAgents

Lists all agents including drafts and inactive. Filter by status. Actions: edit, view, soft-delete.

Internally uses useAgents() with the admin-only ?status=all query param (only honored if the request has platform_admin role).

AdminAgentSubmit / AdminAgentEdit

Form built with shadcn/ui form primitives. Fields:

  • Basic: name, slug, tagline, description, longDescription.
  • Branding: iconUrl (upload), photoUrls (upload, ordered).
  • Status + flags: status, featured, isNew, comingSoon.
  • Links: productDomain, docsUrl, changelogUrl.
  • OAuth: redirectUris (one per line).
  • Tags: multi-select.
  • Pricing tiers: child editor (add, remove, set isFree / price / interval / features).
  • Capabilities: child editor (icon picker + title + description).
  • Steps: child editor (title + description).
  • Changelog: child editor.
  • Metric definitions: child editor (slug immutable after save).
  • Tier quotas: matrix of (tier × metric) with NULL / 0 / N inputs.

On submit, sends one POST /agents/:id request (full replace for child collections).

AdminInteractions

Paginated feed of interactions rows. Filter by type. Manage notification recipients via a side panel calling /admin/interactions/recipients/*.

Future admin pages

Not yet implemented but in the schema:

  • User management (currently goes through better-auth admin plugin endpoints — /api/auth/admin/list-users etc., not yet wrapped in a UI).
  • Stripe event log (stripe_events table is queryable but no UI).
  • Audit log viewer (PostHog has it; could be embedded).

Add these as separate routes under /admin/* using the existing AdminLayout.

Adding a new admin route

  1. Add a route entry in src/App.tsx inside the <AdminLayout> nested route.
  2. Add a sidebar link in AdminLayout.tsx.
  3. Create the page under src/pages/admin/.
  4. Wrap data fetches with RequirePlatformAdmin if the page should fail closed.