Admin Dashboard Demo
Hand-built in 2024 as an internal dashboard on Next.js, Drizzle, Neon Postgres, and session auth with role-based access. Rebuilt here as a self-contained demo so it runs on a free-tier deployment with no database, no auth provider, and no secrets. A real admin panel would keep the search query and page in the URL for shareable views — this demo deliberately trades that for zero backend. Original source on GitHub.
Demo mode — mock data
A faithful rebuild of the users screen from an internal admin dashboard (Next.js, Neon Postgres, session auth). Here it runs entirely in your browser: in-memory data, a fake session, simulated latency. Deletions last until you refresh or reset.
Viewing as:
X3N Labs — Users
Search, paginate, and (as an admin) delete users.
| Name | Username | Role | Actions |
|---|---|---|---|
| Grant Drew | gdrew | admin | |
| Ada Lindqvist | alindqvist | member | |
| Bram Okafor | bokafor | member | |
| Cecily Marsh | cmarsh | member | |
| Dmitri Volkov | dvolkov | member | |
| Elena Reyes | ereyes | member | |
| Farid Haddad | fhaddad | member | |
| Greta Nilsen | gnilsen | admin | |
| Hiro Tanaka | htanaka | member | |
| Imogen Clarke | iclarke | member |
Showing 1–10 of 57
Bugs the original shipped — fixed in this rebuild
Part of reviewing your own old work honestly is naming what was wrong with it:
- Search and pagination both navigated to the homepage (router.replace('/?…')) instead of staying on the admin route.
- The Username column rendered the user's name — name twice, username never.
- The delete server action checked whether the target was an admin but never who the caller was — any signed-in user could delete any non-admin account. The demo enforces caller-side RBAC, visibly, via the role toggle.
- Delete had no pending state, so a double-click fired twice. The demo disables the button in flight.
- Pagination didn't reset when the query changed; the demo returns to page 1 on a new search.