Auth & Admin Console
What this page is. A diagnostic and admin surface for the access platform itself — the part that handles sign-in and decides who can use which demo.
Who it is for. Internal aroughidea staff with a row in the platform_admins table. We call those people operators on this site.
Where end users go. End users never come here. They go directly to a demo URL such as demo-reference.aroughidea.com/app and are redirected to sign in if they need to.
Mental model. Access platform decides who can use what. Demos decide what to do. OpenRouter charges for it.
Where you are in the system
demochat.aroughidea.com
Environment
- NODE_ENV
production - OPENROUTER_MANAGEMENT_API_KEY
not set — spend summary will return 503 - AUTH_HOST
auth.aroughidea.com - SMTP
Supabase default (custom SMTP not configured) - Admin auth
trusted x-platform-user-id header (scaffold)
Guided steps
Run these in order. Later steps depend on earlier ones; each step shows what it requires before you click.
-
1
Confirm the service is up
not yet probedWhat this checks. A simple
/healthresponse that proves the app is running. Prerequisites. None. -
2
Test the sign-in handoff
manualWhat this checks. The redirect chain from this app to
auth.aroughidea.comand back to a demo. Prerequisites. An email address that already has a Supabase user (existing users only — sign-up is intentionally disabled).Advanced — choose a custom return URL or domain
Useful if the default custom domain is not provisioned in this environment, or if you want to land on a different demo after sign-in.
-
3
Open the Admin Console
manualWhat this opens. The page that shows OpenRouter spend, recent usage events, and user/invite management.
Prerequisites.
- You must have a row in
platform_adminsfor your Supabase user. Without it, every/admin/*call returns403. OPENROUTER_MANAGEMENT_API_KEYmust be set in this environment to load the spend summary. Currently: not set — the OpenRouter Summary tab will return 503.
Copyable SQL — add yourself to
platform_adminsINSERT INTO platform_admins (user_id) VALUES ('<your-supabase-user-uuid>') ON CONFLICT (user_id) DO NOTHING;Find your UUID in Supabase Dashboard → Authentication → Users.
- You must have a row in
Reference
Glossary — terms used on this page
- OperatorInternal aroughidea staff with a row in the
platform_adminstable. - DemoA thin server-side product app (e.g.
demo-reference) that delegates auth and access to this platform via@aroughidea/access. - OrganizationThe unit of access. Users belong to one or more orgs and inherit the union of their orgs' grants.
- GrantAn org-level permission to use a specific demo or feature.
- Magic linkAn email sign-in link delivered by the auth service in lieu of a password.
- Auth handoffThe redirect chain from a demo to
auth.aroughidea.comand back, after sign-in. - Usage eventA row in
usage_eventswritten by a demo after a successful AI action.
Endpoints exposed by this app
auth.aroughidea.com/login?next=....auth.aroughidea.com/login in production)./admin/*.Where to go next
- Demo wiring console (the other entry point): demo-reference.aroughidea.com
- End-user demo entry: demo-reference.aroughidea.com/app
- Chatbot demo (real product surface): demochat.aroughidea.com/app
- User journey doc:
docs/user-journey.md - New demo checklist:
docs/new-demo-checklist.md - Entry-point redesign rationale:
docs/entry-point-redesign.md