feat(admin): web admin panel — user CRUD, role assignment, system health #150

Merged
jason.woltje merged 1 commits from feat/p7-014-admin-panel-v2 into main 2026-03-15 19:18:47 +00:00
Owner

Summary

  • Add BetterAuth admin plugin (admin/member roles) to auth package
  • Add banned/banReason/banExpires fields to users schema
  • Gateway AdminModule with user CRUD endpoints at /api/admin/users
  • Gateway AdminHealthController with system health at /api/admin/health (DB, Valkey, agent pool, providers)
  • AdminGuard enforcing admin role on all /api/admin/* routes
  • Web admin page with two-tab UI: User Management and System Health
  • AdminRoleGuard client-side redirect for non-admin users
  • Add @mosaic/queue to gateway deps for Valkey health check

Closes #125

Test plan

  • Admin user can access /admin page
  • Non-admin user is redirected away from /admin
  • User list displays all users with name, email, role, status, created date
  • Create user form creates new users with hashed passwords
  • Role toggle promotes/demotes users between admin and member
  • Ban/unban toggles user ban status
  • Delete removes user (with confirmation)
  • Health tab shows DB/Valkey/agent pool/provider status

Generated with Claude Code

## Summary - Add BetterAuth admin plugin (admin/member roles) to auth package - Add banned/banReason/banExpires fields to users schema - Gateway AdminModule with user CRUD endpoints at /api/admin/users - Gateway AdminHealthController with system health at /api/admin/health (DB, Valkey, agent pool, providers) - AdminGuard enforcing admin role on all /api/admin/* routes - Web admin page with two-tab UI: User Management and System Health - AdminRoleGuard client-side redirect for non-admin users - Add @mosaic/queue to gateway deps for Valkey health check Closes #125 ## Test plan - [ ] Admin user can access /admin page - [ ] Non-admin user is redirected away from /admin - [ ] User list displays all users with name, email, role, status, created date - [ ] Create user form creates new users with hashed passwords - [ ] Role toggle promotes/demotes users between admin and member - [ ] Ban/unban toggles user ban status - [ ] Delete removes user (with confirmation) - [ ] Health tab shows DB/Valkey/agent pool/provider status Generated with Claude Code
jason.woltje added 1 commit 2026-03-15 19:18:36 +00:00
- Add BetterAuth admin plugin with admin/member role configuration
- Add banned/banReason/banExpires fields to users schema
- Gateway AdminModule: user list/create/role/ban/delete endpoints at /api/admin/users
- Gateway AdminHealthController: system health at /api/admin/health (DB, Valkey, agent pool, providers)
- AdminGuard: enforces admin role on all /api/admin/* routes
- Web admin page: two-tab UI (User Management + System Health)
- AdminRoleGuard: client-side redirect for non-admin users
- Add adminClient to web auth-client for BetterAuth admin plugin integration
- Add @mosaic/queue as gateway dep for Valkey health check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason.woltje merged commit a760401407 into main 2026-03-15 19:18:47 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#150