Create Admin User
This guide walks you through on how to create an admin user after you’ve successfully installed the app.
Create an account
Section titled “Create an account”- Navigate to the register page of the app (e.g.
https://your-domain.com/register) - You have successfully registered a standard user account
Make it an admin
Section titled “Make it an admin”In order to give the account admin privileges and be able to access the admin dashboard, you will have to update the account directly in the database, set isAdmin to TRUE.
To do so, you will have to open the database tables via your desired GUI. This can be pgAdmin, Drizzle Studio, or any other built-in GUI if using a managed database service (e.g. Neon, Supabase, etc.).
Managed database service
Section titled “Managed database service”- If using a managed database service, simply navigate to your database → Tables section
- Click on the user table
- Locate the user row that you wish to make an admin user
- Find the isAdmin column, and change it from FALSE to TRUE
- Save
Drizzle Studio
Section titled “Drizzle Studio”Since WeaveAI is already using Drizzle as the ORM, Drizzle Studio comes packaged with the app.
-
Install Drizzle Packages
If you haven’t already installed the project dependencies, you can install just the Drizzle packages. Run the following command in the WeaveAI directory (where the app files are):
Terminal window npm install drizzle-orm drizzle-kitAlternatively, install all project dependencies with:
Terminal window npm install -
Make sure you have an .env file in your project with
DATABASE_URLenvironment variable and your database connection string. If you do not, temporary create one so Drizzle Studio can connect to the database. -
Open Drizzle Studio - Run the following command:
Terminal window npm run db:studio -
In your browser, enter the following URL:
https://local.drizzle.studio -
Click on the user table
-
Locate the user row that you wish to make an admin user
-
Find the isAdmin column, and change it from FALSE to TRUE
-
Save
You’re all set! You should now be able to access the admin dashboard while logged in with your admin account.