This template uses Supabase as a database and authentication provider. Here's a quick introduction if you've never heard of it.

5-Min Walkthrough


1. Create a Supabase project

Sign up for a Supabase account and create a new organization and project.

You'll be shown a project ID and anon key for the new project. Copy these over to your .env file.

Next, go to your project page > Settings > API > Project API Keys, and copy the service role key over to your .env file. Your environment variables should look like this:


# Make sure to add all three!


2. Run migrations on your database

The template comes out-of-the-box with a bunch of database migrations – SQL queries that will set up the tables for your database.

Running these migrations will help you get set up for all the other features in the template, including authentication, Stripe payments, and image generation.

To run the migrations, run these three commands in your shell:

# To verify you have Supabase CLI installed
# If you don't, run `npm i supabase --save-dev` first
npx supabase --version
# To link your project to the Supabase CLI
# For more info, see
npx supabase link --project-ref <your_project_ref>
# Push migrations to your Supabase database
# For more info, see
npx supabase db push

Note that the project ref will be the id-like part of the Supabase URL you pasted in Step 1, ignoring the "https://" and "".

That's it! Visit the Supabase Dashboard > Your Project > Tables to ensure the new tables have been added to the database.

The migration files handle two other jobs:

  • Adding storage buckets under Your Project > Storage, so you can store files like user avatars and generated images
  • Setting up pgvector and vector search functions, so you can store pieces of texts with vector embeddings and perform Retrieval Augmented Generation (RAG). (Think: features like "chatting with PDFs".)

3. Set up authentication

The last thing you'll want to do while on the Supabase dashabord is to configure authentication. Check out the Authentication tutorial to set up Magic Links and Google OAuth with Supabase.

Running Supabase locally

You can run Supabase locally for development to keep your production and development databases separate. Follow the official Supabase Local Development guide to learn more.

If you're running Supabase locally, browse through the supabase/config.toml file to set up configurations for the local database. To enable Google Auth locally, switch enabled = true on Line 134 (it is turned off by default). Make sure to set your project_id correctly as well.

Last Updated: March 5