Skip to content

feat(admin): implement user management and moderation dashboard - #85

Merged
arnabnandy7 merged 4 commits into
mainfrom
feature/adminUserManagement
Sep 13, 2026
Merged

arnabnandy7 merged 4 commits into
mainfrom
feature/adminUserManagement

Conversation

@arnabnandy7

Copy link
Copy Markdown
Owner

Overview

Introduces a dedicated Admin Console to manage user accounts, permissions, and security moderation. The feature integrates Better Auth's administrative capabilities with Drizzle ORM to enable user discovery, role transitions, account blocking/unblocking, session revocations, and automated digest suppression for restricted users.


Key Highlights

  • Database & Schema Updates:

    • Adds role, banned, ban_reason, and ban_expires to user, and impersonated_by to session via migration 0014_user_moderation.sql.
    • Automatically synchronizes existing administrator memberships to the admin role while maintaining backwards compatibility with the legacy admin table.
  • Authentication & Authorization:

    • Registers Better Auth's server admin() plugin and client adminClient() plugin.
    • Implements server-side guard requireAdmin for page routes and administrative endpoints.
    • Suppresses automated cron delivery (such as weekly digests) for blocked accounts.
  • Admin User Interface:

    • Adds /admin route with server-side protection.
    • Provides a searchable, filterable, and paginated User Management directory with role badges and active/blocked statuses.
    • Introduces a confirmation modal supporting customizable ban reasons and expiration windows.
    • Integrates administrative email delivery testing into a unified dashboard layout.
    • Surface an Admin Console entry point in navigation for authorized administrators.

Verification

  • Automated Tests:
    • Added unit and component coverage for admin server guards, client wrappers, table interactions, dialog actions, and navigation triggers (tests/features/admin/).
    • All existing test suites pass (58 test files, 441 tests passing).
  • Static Analysis:
    • npx tsc --noEmit passed with 0 errors.
    • npm run lint passed with 0 warnings/errors.
  • Database Validations:
    • Migration script executed and verified against both Preview and Production databases.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openissue-dev Ready Ready Preview Sep 13, 2026 5:53pm UTC

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
…escing

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@sonarqubecloud

Copy link
Copy Markdown

@arnabnandy7
arnabnandy7 merged commit 66fec33 into main Sep 13, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Completed in Open issue portal development Sep 13, 2026

This branch was successfully deployed

1 active deployment
Preview — 1cec979a Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

1 participant