Skip to content

Create Admin User

This guide walks you through on how to create an admin user after you’ve successfully installed the app.

  1. Navigate to the register page of the app (e.g. https://your-domain.com/register)
  2. You have successfully registered a standard user account

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.).

  1. If using a managed database service, simply navigate to your database → Tables section
  2. Click on the user table
  3. Locate the user row that you wish to make an admin user
  4. Find the isAdmin column, and change it from FALSE to TRUE
  5. Save

Since WeaveAI is already using Drizzle as the ORM, Drizzle Studio comes packaged with the app.

  1. 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-kit

    Alternatively, install all project dependencies with:

    Terminal window
    npm install
  2. Make sure you have an .env file in your project with DATABASE_URL environment variable and your database connection string. If you do not, temporary create one so Drizzle Studio can connect to the database.

  3. Open Drizzle Studio - Run the following command:

    Terminal window
    npm run db:studio
  4. In your browser, enter the following URL: https://local.drizzle.studio

  5. Click on the user table

  6. Locate the user row that you wish to make an admin user

  7. Find the isAdmin column, and change it from FALSE to TRUE

  8. Save

You’re all set! You should now be able to access the admin dashboard while logged in with your admin account.