Admin Overview

Overview of the admin panel features including user management, organization oversight, and platform analytics.

The MakerKit Admin Panel is a built-in dashboard for managing users, organizations, and platform activity. It provides user management (ban, impersonate, role changes), organization oversight, session control, and RBAC-based permissions.

Access it at /admin with an admin account. The panel integrates with Better Auth's admin plugin and supports custom admin roles for support staff or moderators.

Getting Started

Creating Your First Admin

After running pnpm seed, use these test credentials:

  • Email: admin1@makerkit.dev
  • Password: testingpassword

To promote an existing user to admin:

  1. Run Prisma Studio: pnpm --filter "@kit/database" prisma:studio
  2. Open the users table
  3. Set the role column to admin for your user
  4. Sign out and back in to refresh the session

Dashboard Metrics

The admin dashboard at /admin displays four key metrics:

MetricDescription
Total UsersAll registered accounts on your platform
Active SessionsSessions created in the last 24 hours that haven't expired
Banned UsersAccounts with restricted access
New This WeekSign-ups from the past 7 days

Core Features

User Management

The Users section (/admin/users) provides full control over user accounts:

  • Search: Find users by name or email
  • Filter: By role (user/admin) and status (active/banned)
  • Sort: By name, email, creation date, role, or status
  • Paginated results: 25 users per page

Available actions per user:

ActionDescription
View DetailsFull user profile with sessions and subscriptions
Change RolePromote to admin or demote to user
ImpersonateSign in as the user for debugging (non-admin users only)
Ban/UnbanRestrict or restore account access
RemovePermanently delete the account (non-admin users only)
View SessionsSee all active sessions
Revoke SessionsEnd specific or all sessions
Admin Users Table

See User Management for detailed documentation.

Organization Management

The Organizations section (/admin/organizations) lets you oversee all teams:

  • Search: Find organizations by name
  • View Details: See organization info, members, and subscriptions
  • Member Access: Click through to any member's user details
Admin Organizations Table

See Organization Management for detailed documentation.

Role-Based Access Control

Admin permissions are configured via RBAC in packages/rbac/src/admin-rbac.config.ts:

import { defineAdminRBACConfig } from './admin/factory';
export default defineAdminRBACConfig({
// Default: single 'admin' role with full permissions
// Add custom roles as needed:
/*
roles: {
support: 50, // Can help users but not delete
moderator: 30, // Can ban but limited access
},
permissions: {
support: {
user: ['list', 'get', 'ban'],
session: ['list', 'revoke'],
organizations: ['list', 'view'],
dashboard: ['view'],
},
},
*/
});

See RBAC Permissions for detailed documentation on customizing admin roles.

The admin sidebar includes:

  • Dashboard (/admin) - Overview and statistics
  • Users (/admin/users) - User management
  • Organizations (/admin/organizations) - Organization oversight

Click "Back to Dashboard" in the sidebar header to return to your regular account.

Security Considerations

The admin panel includes multiple security layers:

  1. Route Protection: Middleware blocks non-admin access to /admin/* routes
  2. Server-Side Checks: requireAdmin() verifies admin status in server components
  3. Action Middleware: adminActionClient protects all server actions
  4. Permission Checks: withAdminPermission() enforces granular RBAC permissions
  5. Impersonation Safeguards: Cannot impersonate admin users or banned accounts

For implementation details, see Extending Admin.

Frequently Asked Questions

How do I create an admin user?
Run pnpm seed for test credentials (admin1@makerkit.dev), or use Prisma Studio to set a user's role column to 'admin'. Sign out and back in to refresh the session.
Can I have multiple admin roles with different permissions?
Yes. Define custom roles like 'support' or 'moderator' in packages/rbac/src/admin-rbac.config.ts with specific permissions for each role.
What happens when I impersonate a user?
You're signed in as that user for up to 1 hour. A banner shows you're impersonating. Click 'Stop Impersonating' or sign out to end the session.
Why can't I impersonate certain users?
Security restrictions prevent impersonating other admin users or banned accounts. Demote the admin to a regular user first if debugging is needed.

Next: User Management