← Back to @payez/next-mvp
Admin Dashboard

Admin Dashboard

Full admin UI — Users, Sessions, Audit, Logs, Roles. Out of the box.

Every MVP install ships with a complete admin panel at /admin. No setup. No configuration. It reads your vibe_app data and renders a working dashboard immediately.

How it works

1

Install the MVP and navigate to /admin. If your session has an admin role, you see the full dashboard. If not, you get a 403. There's no setup step.

2

The dashboard reads from vibe_app tables (users, sessions, audit_log, roles, user_roles) via the Vibe API. It renders real data from your application — not demo data.

3

Admin actions (role changes, session revocations, user management) are performed via protected API routes and logged to the audit trail automatically.

4

The dashboard is role-aware — system admins see everything, while scoped admins see only the tabs their roles grant access to.

Users tab

View all users, search by email or name, see their roles, last login, session count, and account status. Click into a user to see their full profile, session history, role assignments, and audit trail. Admin actions: assign/revoke roles, deactivate accounts, force password reset, revoke all sessions. Every action is logged.

Sessions tab

Real-time view of all active sessions across your application. See who's logged in, from where, on what device, and when they last made a request. This is the same session data from Redis — rendered in a table with search, sort, and filter. Revoke any session with one click. Bulk-revoke all sessions for a user if their account is compromised.

Audit tab

Every admin action, every role change, every session revocation — logged with full context. The audit tab shows a chronological feed with filters for action type, actor, target user, and date range. Each audit entry includes: who did it (actor), what they did (action), who was affected (target), when it happened (timestamp), and additional details (JSONB — for things like "changed role from editor to admin").

// Example audit_log entries
{
  "actor": "admin@acme.com",
  "action": "role.assigned",
  "target_user": "jane@acme.com",
  "details": {
    "role": "vibe_app_admin",
    "previous_roles": ["editor"]
  },
  "timestamp": "2026-03-11T14:30:00Z"
}

{
  "actor": "admin@acme.com",
  "action": "session.revoked",
  "target_user": "jane@acme.com",
  "details": {
    "session_ip": "203.0.113.42",
    "reason": "suspicious_activity"
  },
  "timestamp": "2026-03-11T14:35:00Z"
}

Logs tab

Structured application logs from vibe-app-logger. Every API call, every error, every warning — formatted and searchable in the admin panel. This is not a replacement for Graylog or Datadog in production, but it gives you instant visibility during development and early production without configuring external logging infrastructure.

Roles tab

View all roles (system + custom), see which users hold each role, and manage custom role definitions. System roles are read-only — you can see them but not modify them. Create custom roles here, and they're immediately available for assignment and for use in page_permissions rules. No code change needed.

Extending the admin panel

The admin dashboard is a set of Next.js pages and components. You can add new tabs for your app-specific admin needs — customer management, content moderation, analytics — without touching the built-in tabs. New admin pages automatically inherit the auth check (admin role required), the layout (sidebar + header), and the audit logging (via withApiLogging on your API routes).

This is included. Not extra.

Admin Dashboard ships with every @payez/next-mvp install. 10K MAU free. No credit card required.