Skip to Content
Prodly 2.0 is released 🎉
User Management

User Management

The User Management section in the admin panel allows administrators to view, search, edit, and delete user accounts. It provides a comprehensive interface for managing all registered users, their subscription plans, credit balances, and administrative privileges.

Overview

This page displays a paginated list of all users with key information. Administrators can quickly find users by email, adjust their credits or plan type, grant admin rights, or remove accounts when necessary.

User Management Interface Example of the user management table (screenshot placeholder)

Key Features

  • Search Users – Real‑time search by email address (debounced to reduce server load).
  • User Table – Shows email, remaining credits, plan type (free/pro/enterprise), admin status, and join date.
  • Edit User – Open a modal to change credits, plan, or admin status.
  • Delete User – Permanently remove a user and all associated data (with confirmation).
  • Pagination – Navigate through large user lists with intelligent page numbering and ellipsis.

Using the User Management Page

Searching for Users

Type an email address (or part of it) into the search field. The list updates automatically as you type, resetting to the first page of results. Click the Clear button (if implemented) to reset the search.

Editing a User

  1. Click the Edit button in the actions column of the desired user.
  2. A modal dialog appears with the following fields:
    • Credits remaining – numeric input for the user’s credit balance.
    • Plan type – dropdown with options: Free, Pro, Enterprise.
    • Admin – checkbox to grant or revoke administrator privileges.
  3. Modify the values and click Save to apply changes. A success or error toast will appear.
  4. Click Cancel to close the modal without saving.

Deleting a User

Deleting a user is permanent and cannot be undone.

  1. Open the edit modal for the user you want to delete.
  2. Click the red Delete button at the bottom left of the modal.
  3. A browser confirmation dialog will ask you to confirm the deletion.
  4. If confirmed, the user and all associated data (profiles, descriptions, brand voices, bulk jobs, usage logs) are permanently removed from the database.

Pagination Controls

  • Previous / Next buttons navigate one page at a time.
  • Page numbers show the current range; ellipsis (...) indicate skipped pages.
  • Click any page number to jump directly to that page.

Technical Details

  • Data Source: auth.users joined with user_profiles table.
  • API Endpoints:
    • GET /api/admin/users?search=...&page=...&limit=10 – fetches paginated users.
    • PATCH /api/admin/users/[id] – updates user profile (credits, plan, admin).
    • DELETE /api/admin/users/[id] – deletes user and cascades to related records.
  • Real‑time Search: Implemented with lodash/debounce to avoid excessive API calls.
  • Pagination Logic: Uses a configurable page size (default 10) and generates a compact page range with ellipsis.

What Happens When You Delete a User?

  • The user’s record is removed from auth.users (Supabase Auth).
  • All rows in dependent tables (user_profiles, brand_voices, descriptions, bulk_jobs, usage_logs) that reference the user are deleted due to foreign key constraints with ON DELETE CASCADE.
  • The action is irreversible; there is no “soft delete” or recycle bin.

Conclusion

The User Management page gives administrators full control over the platform’s user base. With powerful search, inline editing, and safe deletion workflows, it ensures that user data can be managed efficiently and securely.

Last updated on