Admin Panel Demo
The @saas/admin module provides a user management admin panel, gated by the admin role.
Module: @saas/admin · Route: /dashboard/admin · Docs · Install Guide
Live Demo
Sign in as
admin@example.com/Admin123!to access the admin panel.
🖥️
Admin Panel — Live Demo
View demo at https://your-app.zeabur.app/dashboard/admin Configure your deployed Next.js app URL via the VITEPRESS_DEMO_BASE environment variable, then rebuild to enable live iframe embeds.
Features
| Feature | Component | Server Action |
|---|---|---|
| User Table | admin-user-table.tsx | listUsers() |
| Role Selector | admin-role-selector.tsx | updateUserRole() |
| Delete User | admin-delete-user-button.tsx | deleteUser() |
RBAC Gate
The admin panel is protected at three levels:
- Middleware — non-authenticated users are redirected to
/login - Page level —
requireRole('admin')redirects non-admin users to 404 - Server Action level — each action calls
requireRole('admin')independently
This defense-in-depth ensures no admin operation can be performed without the correct role, even if the page-level check is bypassed.
API Demo
GET/api/demo/admin/users
Note: The demo endpoint requires an admin session. Sign in at
/loginfirst.