Skip to content

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.

https://your-app.zeabur.app/dashboard/admin Open ↗
🖥️
Admin Panel — Live Demo

Configure your deployed Next.js app URL via the VITEPRESS_DEMO_BASE environment variable, then rebuild to enable live iframe embeds.

View demo at https://your-app.zeabur.app/dashboard/admin

Features

FeatureComponentServer Action
User Tableadmin-user-table.tsxlistUsers()
Role Selectoradmin-role-selector.tsxupdateUserRole()
Delete Useradmin-delete-user-button.tsxdeleteUser()

RBAC Gate

The admin panel is protected at three levels:

  1. Middleware — non-authenticated users are redirected to /login
  2. Page levelrequireRole('admin') redirects non-admin users to 404
  3. 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
Base URL (your deployed Next.js app)
Authorization Header (optional)
Try in Live App →

Note: The demo endpoint requires an admin session. Sign in at /login first.

Released under the MIT License.