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.

Viewing as:
X3N Labs — Users
Search, paginate, and (as an admin) delete users.
NameUsernameRoleActions
Grant Drewgdrewadmin
Ada Lindqvistalindqvistmember
Bram Okaforbokaformember
Cecily Marshcmarshmember
Dmitri Volkovdvolkovmember
Elena Reyesereyesmember
Farid Haddadfhaddadmember
Greta Nilsengnilsenadmin
Hiro Tanakahtanakamember
Imogen Clarkeiclarkemember
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.