Admin setup
Learn how to access the admin panel and configure administrative privileges after installing Dirly.
After successfully installing Dirly, this guide will walk you through the process of setting up administrator access. Youâll learn how to grant admin privileges to users, access the admin panel, and manage tool submissions.
Understanding Admin Roles in Dirly
Dirly uses a role-based access control system powered by Convex. The users table in your Convex database contains a role field that determines each userâs permissions:
users: defineTable({
clerkId: v.string(),
email: v.optional(v.string()),
role: v.string(), // "user" | "admin" | "moderator"
createdAt: v.number(),
})By default, when a new user registers through Clerk, they are assigned the "user" role. To grant administrative access, you need to manually update this role to "admin" in the Convex database.
Step 1: Register a User Account
Before you can assign admin privileges, you need to have a user account registered through Clerk.
Go to your live domain and navigate to the sign-up page:
https://yourdomain.com/sign-upComplete the registration form using your email and password (or through your configured OAuth providers).
After successful registration, youâll be logged in as a regular user with the "user" role.
Step 2: Find Your Clerk User ID
To update your role in the Convex database, you need your unique Clerk user ID. There are two ways to find it:
Method A: Using Browser Dev Tools
-
While logged in to your Dirly site, open your browserâs Developer Tools (F12).
-
Go to the Application or Storage tab.
-
Look for Local Storage â
https://yourdomain.com. -
Find the key
__clerk_client_jwtor look for Clerk-related data containing your user ID. -
Your user ID will look something like:
user_2th1234567890
Method B: Using Clerk Dashboard
-
Go to your Clerk Dashboard .
-
Select your Dirly project.
-
Navigate to Users in the left sidebar.
-
Find your email address in the list and click on it.
-
Copy the User ID (starts with user_).
Step 3: Update User Role in Convex
Now you need to access your Convex dashboard to update the role.
Go to your Convex Dashboard .
-
Select your Dirly project and deployment (e.g.,
prod:your-project). -
In the left sidebar, click on Data.
-
Find and click on the
userstable. -
Look for your user record â you can filter by
clerkIdand paste your Clerk user ID to find it quickly. -
Click on your user record to open the document editor.
-
Locate the
rolefield and change its value from"user"to"admin":
{
"clerkId": "user_2th1234567890",
"email": "your@email.com",
"role": "admin", // Changed from "user" to "admin"
"createdAt": 1704067200000
}Click Save or Update to apply the changes.
"admin" (case-sensitive). Step 4: Access the Admin Panel
Once your role has been updated to admin:
-
Refresh your browser on the Dirly site (or log out and log back in).
-
You should now see an Admin button appear in the top navigation bar.
-
Click the Admin button or navigate directly to:
https://yourdomain.com/adminYou now have full access to the administrative dashboard where you can:
-
Review pending tool submissions
-
Approve or reject tools
-
Send feedback to submitters
-
View site statistics and analytics
Troubleshooting
| Problem | Solution |
|---|---|
| Admin button not appearing after role update | Log out completely and log back in. Clerk sessions need to refresh to reflect role changes. |
| Canât find my user in Convex users table | Make sure youâve registered through Clerk first. The users table is populated only after successful authentication. |
| Role reverts back to âuserâ | Check if you have multiple user records with the same email. Update the correct one matching your Clerk ID. |
| Access denied when visiting /admin | Verify that your role is set to exactly âadminâ (not âAdminâ, âADMINâ, or with spaces). |
Next Steps
Now that you have admin access, you can:
-
Review and manage tool submissions
-
Configure site settings
-
Monitor user engagement and statistics
-
Manage featured tools and listings
For more information about using the admin panel, see the Admin Dashboard Guide.