Super-admin overview
The `/admin` area is a platform-level dashboard for FlippingKoin staff — separate from a company's own admin tools. It manages plans, companies, migrations, and platform-wide reports.
Access is gated by `user.pro === true`; regular company admins don't see it.
Step-by-step
- 1Sign in as a super-admin
Log in with a user that has `user.pro === true`. The /admin link appears in your account menu only when this flag is set.
- 2Manage plans
Admin → Plans. Create new plans, edit limits and features (like `allowSocialPublishing`), and sync them with Razorpay. Razorpay plans are immutable on price — rate changes require a new Plan record.
- 3Run data migrations
Admin → Run Migration. This invokes `/api/admin/mig` which idempotently backfills new schema fields and cleans up legacy data. Safe to re-run; the response includes a per-step summary.
- 4Reassign a company's plan
Admin → Companies → pick a company → Reassign plan. Only allowed when the company has no active paid subscription. Audited via the Action log with the BILLING event type.
Tips
`/admin/*` routes are gated in `withAdminRole` — non-pro users get 401 regardless of company role. Run migrations once per environment after deploying a schema change; the JSON summary tells you what got modified. Use the Action log filter (`type=BILLING`) to audit every plan reassignment.
Admin configuration
Super-admin status is `User.pro = true` — set in the database directly; there's no self-serve enrollment. Plan-tier feature flags (`allowSocialPublishing`, `limits.dataspaces`, etc.) are set here, not in company-level Settings.