Admin Portal
Operator creates and manages customer organisations, reference data, and superadmin access without database intervention. The control surface that unlocks customer 2.
Why should I care?
Five cards that sell the dream
Same five positions. Different seat.
The customer sees the control surface. The builder sees the security model. The outer game sells operator freedom. The inner game proves isolation holds.
How does this get built?
Five cards that sell the process
The pitch is the shape. The flow diagrams prove the thinking. The VV stories validate the value.
Problem
Platform operator needs to create customer orgs, manage global reference data, and grant superadmin access. admin.dreamineering.com deployed but returns 403 (Better Auth invalid origin). /org/new returns 404. All org management requires direct DB access. Resource types only editable via seed function.
Any user with superadmin role can create orgs, see all orgs, manage resource types, and grant superadmin to others — zero database access required. Admin portal at admin.dreamineering.com fully operational.
No superadmin role claim. No org creation server action. No /admin route with middleware guard. Every server action scopes by organisationId — the admin layer needs a controlled bypass inaccessible to org-level admins. Better Auth trustedOrigins missing admin.dreamineering.com.
Superadmin queries span all orgs. That requires removing the organisationId filter that protects multi-tenant isolation. The bypass must live in middleware — not scattered across server actions — so there is exactly one place to audit and one place that can break.
Scorecard
Priority (5P)
Readiness (5R)
What Exists
| Component | State |
|---|---|
| Better Auth authentication | Working |
| organisations table | Working |
| Multi-tenancy schema | Working |
| governance_resource_types table | Partial |
| Next.js middleware | Working |
| Auth custom claims | Missing |
| /admin route | Missing |
| Org picker | Missing |
| admin.dreamineering.com | Deployed |
Relationships
| PRD | Contributes |
|---|---|
| Identity & Access | Parent — this extends org-level user management to the operator layer. |
| Agent Platform | Peer — Agent Platform manages agent identities within orgs; Admin Portal manages the orgs themselves. |
| Sales CRM | Downstream — new customer orgs created here are the orgs CRM data lives in. |
| ETL Data Tool | Downstream — ETL pipelines are per-org; org creation here enables per-org data import. |
If customer 2 is ready to sign and onboarding is still manual, pain jumps to 5 and this becomes top priority. If no second customer prospect emerges by 2026-09-18, move to backburner.
Questions
If org creation is operator-initiated, what is the path for a customer who wants to sign up without contacting the operator?
- Is the org picker the right UX, or should users maintain a default org preference that bypasses the picker on most logins?
- When a superadmin adds a resource type, should it propagate to all existing orgs automatically, or only appear when an org admin explicitly seeds permissions?
- What is the recovery path if a superadmin accidentally suspends the Dreamineering org itself?