Creating a Supabase Project
Last updated
Last updated
Supabase is an open-source alternative to Firebase that offers database management, authentication, real-time functionalities, and more. This guide will help you set up a new project in Supabase
Navigating to Supabase:
Visit the Supabase website and select "Start your project" or "Sign in".
Creating an Account:
You can register using an email, Google, GitHub, or other available methods. Follow the prompts to create a new account.
Verification:
If prompted, verify your email to activate your account.
Accessing the Dashboard:
Once logged in, you will be directed to your Supabase dashboard.
Starting a Project:
From the dashboard, click "New Project".
Setting Up:
Enter your project name.
Select a server region that is closest to your users to reduce latency.
Set a secure database password and make sure to copy it somewhere as it will be needed later.
Initialization:
Wait for Supabase to set up your project. This process may take a few minutes.
Copy The Important Keys:
NEXT_PUBLIC_SUPABASE_URL
: The unique URL to your Supabase project.
NEXT_PUBLIC_SUPABASE_ANON_KEY
: Public anonymized key for client-side usage.
SUPABASE_SERVICE_ROLE_KEY
: Service role key for backend usage.
Finding DATABASE URL
Locating the Database URL:
Click on the connect button in the right corner and copy the database URL below.
Database URL Details
Database URLs:
For the database URL, we will have the same URL but one will be used for the direct database access, and one for:
SUPABASE_DATABASE_URL=postgres://your-db-user:your-db-password@your-db-host:6543/your-db-name?pgbouncer=true
The URL in SUPABASE_DATABASE_URL must include ?pgbouncer=true
and the host should be your-db-host:6543
to avoid errors when using with Prisma.
Configuring Environment Variables
Saving Your Configuration:
Copy the following information:
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY
DATABASE_DIRECT_URL
SUPABASE_DATABASE_URL
Paste these into the .env
file you created in the previous step. Ensure you include the database password you copied earlier in the SUPABASE_DATABASE_URL
.