In this guide we show you how you can easily set up your supastarter SaaS using Supabase.
Before we start, make sure you have a Supabase account. If you don't have one yet, you can create one for free at supabase.io.
1. Create a new Supabase project
2. Get connection strings
In the supabase dashboard, navigate to Settings > Database. Here you will find the connection string, that we will need later.
We will need both the transaction mode string and the session mode string:
3. Create a new supastarter project
As described in the supastarter documentation, you can create a new supastarter project by running the following command:
In the CLI wizard, you will be asked for the database connection string. Paste the connection string you copied in step 2. Make sure to replace the password placeholder in the connection string with the one you created in step 1.
4. Fix envs for migration connection
There is one special case for the migration connection. In the supastarter project, open the .env.local
file and change the DATABASE_URL
to the following:
Then add the following env below that line:
Make sure to replace the password and project ref placeholders with your own values.
Next we need to add the migration connection to the prisma/schema.prisma
file. Add the following line to the top of the file:
After the migrations are run, make sure to enable RLS for all created tables in the Supabase dashboard.
5. Run development server
Now you should be able to start the development server by running the following command in the project root:
That's all it takes to set up supastarter with Supabase! If you have questions, feedback or feature requests, feel free to reach out to us on Twitter or on the supastarter Discord server.
The ultimate starter kit to build a scalable and production-ready SaaS
Save endless hours of development time and focus on what's important for your customers with our SaaS starter kits for Next.js 14 and Nuxt 3
Get startedStay up to date
Sign up for our newsletter and we will keep you updated on everything going on with supastarter.