Accessing the Admin Panel
Admin access is controlled through environment variables. To become an administrator:- Obtain your Clerk User ID from the access denied page or your Clerk dashboard
- Add your User ID to the
NEXT_PUBLIC_ADMIN_USER_IDSenvironment variable in.env.local:
.env.local
Multiple admin IDs can be separated by commas. The IDs are trimmed automatically, so spacing doesn’t matter.
Access Control Implementation
The admin check is implemented inlib/admin.ts:6-9:
convex/tools.ts:11-19 using the checkAdmin function:
Dashboard Features
Once authenticated, admins can access/admin to view:
Real-time Statistics
The dashboard displays six key metrics in a grid layout:Total Tools
Combined count of approved and pending tools
Approved
Number of tools visible to users
Pending
Tools awaiting review
Categories
Unique categories in use
Featured
Number of featured tools
Total Upvotes
Aggregate upvotes across all tools
Pending Approvals Section
The main section displays all pending tool submissions with:- Tool preview card - Logo, name, description, category, pricing
- Submission metadata - Submitter ID, submission date, website link
- Tags display - All tags associated with the tool
- Quick actions - Approve, Reject, or View Details buttons
When there are no pending tools, the dashboard displays a “All caught up!” message.
Navigation
From the admin dashboard you can:- Click Details on any tool to view the full submission (
/admin/tools/[id]) - Use quick Approve or Reject actions directly from the list
- Return to the main site using the navigation header
Stats Data Source
Statistics are fetched from thegetAdminStats query in convex/tools.ts:254-282: