Administrator Guide
Operating Wedge Trade AI day-to-day once it's deployed — for platform operators, not end users (see docs/USER_GUIDE.md for that audience) and not engineers doing initial deployment (see DEPLOYMENT.md for that). Every page below lives under /admin, gated by requirePlatformAdmin()/requirePlatformCapability() — see docs/RBAC.md for the full role/capability matrix referenced throughout this guide.
Admin roles, in brief
Five platform-admin roles (distinct from the per-organization owner/admin/member roles regular users have — see docs/ORGANIZATIONS.md for those): super_admin and admin can do everything below; support_admin can use the Support Console and manage alerts/incidents but not billing or feature flags; billing_admin can manage subscriptions but not support actions; narrower roles exist for AI/automation-specific administration. Full matrix: docs/RBAC.md.
Daily operations
- `/admin` — the operator's home page: top-line KPIs, recent
activity, links into everything below.
- `/admin/monitoring` — Real-time Monitoring: broker latency, copy
latency, event queue depth, CPU/memory, database health, API response times, Stripe webhook failures, auth failures, reconnect attempts, failed executions. Refresh-on-demand (reload for a fresh snapshot), not push-live — this app has no persistent process to push updates to an open browser tab from (see docs/ARCHITECTURE.md).
- `/admin/incidents` — Incident Management: critical alerts
auto-create an incident here; work an incident to resolution, leave notes, and see its linked alert.
- `/admin/alerts` — configure the platform-wide (not per-user) alert
channels (Slack/Discord/email/Telegram/SMS webhook & credential env vars — see docs/ALERT_SYSTEM.md) and send a test alert.
User & organization support
- `/admin/users`, `/admin/organizations` — searchable lists
with plan tier, subscription status, and member counts.
- `/admin/support` (Support Console) — the actual working tool for a
support case: look up a specific user (their orgs, broker connections, API keys, active sessions — with a Revoke button for a compromised session), a specific organization (members, plan), a broker connection by name, or a subscription by organization id (plan/status/recent invoices, with Cancel at Period End / Reactivate buttons — a manage_billing-gated action that only ever flips Stripe's cancel_at_period_end, never changes plan/price; see docs/SECURITY_REVIEW.md §8 for why every admin action here is independently capability-gated, not just page-gated).
Broker & copy oversight
- `/admin/brokers` — every broker connection across every user,
filterable by platform/status — for spotting a broker-wide outage (many users' connections to the same platform going unhealthy at once) versus one user's own issue.
- `/admin/copy-sessions` — every active copy relationship
platform-wide, with status and last-event time.
- `/admin/orders` — failed order executions across every user, the
first place to look when a user reports a copy that didn't happen.
Business metrics
- `/admin/analytics` — Revenue (MRR, ARR, churn rate, trial
conversion — see analytics-math.ts's own doc comment for exactly how MRR is computed and its honesty caveats), Usage, and Trend analytics in one page.
- `/admin/audit` — the full audit log (login, logout, MFA, password
reset, broker connection, copy relationships, billing, organization management, admin actions), searchable and filterable by category.
Platform configuration
- `/admin/feature-flags` — toggle a flag globally, or override it
per-user/organization/plan.
- `/admin/security` — platform-wide security posture surface (see
the page itself for its exact scope).
- `/admin/release` — migration history (a real read of
supabase/migrations/ off disk) and this deployment's own version.
- `/admin/backups` — where Supabase backup status actually lives
(this app doesn't have live backup-status API access — the page says so plainly), the restore procedure, and a disaster-recovery checklist. See docs/DISASTER_RECOVERY_PLAN.md and docs/BACKUP_STRATEGY.md for the fuller, standalone versions of the same material.
AI Platform & Automation administration
- `/admin/ai` (Providers, Prompts, Conversations, Cost) — which AI
providers are configured, prompt template management, conversation oversight, and per-provider/per-feature cost tracking. See docs/AI_ADMIN_GUIDE.md for the dedicated deep-dive on this section — it's substantial enough to warrant its own document, referenced here rather than duplicated.
- `/admin/automation` (Analytics, Failures, Templates) — the
Automation/Workflow Engine's admin-side view: which workflows are running, what's failing and why, and the shared template library.
What requires going outside this app
Some things this admin panel deliberately does NOT do, and where they actually happen instead — stated plainly rather than left for an operator to discover by searching for a button that doesn't exist:
- Database backups/restores — Supabase Dashboard, not this app (see
/admin/backups's own page and docs/BACKUP_STRATEGY.md).
- Stripe-side refunds, disputes, tax settings — Stripe Dashboard.
The Support Console's subscription actions are deliberately narrow (cancel/reactivate only).
- Scheduling recurring checks (
GET /api/admin/alerts/check, the
automation/AI cron routes) — this app has no persistent scheduler of its own; point an external cron/scheduler at these routes (see DEPLOYMENT.md §12 Monitoring).
- Live push notifications — architecture-ready, no vendor
configured yet (see docs/ALERT_SYSTEM.md).