leerob / next-saas-starter

Get started quickly with Next.js, Postgres, Stripe, and shadcn/ui.
https://next-saas-start.vercel.app
MIT License
5.49k stars 616 forks source link

Supabase Setup - Guide #40

Closed albertpco closed 1 month ago

albertpco commented 1 month ago

No idea where to put this but wanted to follow up from twitter since i finally found a few minutes to give this a shot.

Quick Setup Guide for next-saas-starter with Supabase

1. Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/leerob/next-saas-starter
cd next-saas-starter

2. Install Dependencies

Install all the required dependencies using pnpm:

pnpm install

3. Run the Database Setup

Run the following command, and when prompted to choose between a local Postgres instance or a remote one, choose R for remote:

pnpm db:setup

When prompted, select "R" to use a remote Postgres instance.

Copy your Supabase Postgres connection URL from the Supabase dashboard:

4. Run Database Migrations

Once the database is connected, apply the migrations to set up your schema:

pnpm db:migrate

5. Seed the Database (Optional)

If the project includes a seed script for populating initial data, run the following command:

pnpm db:seed

6. Start the Development Server

Now you're ready to run the app. Start the development server with:

pnpm dev

Your Next.js app should now be connected to Supabase, and you can access it locally at http://localhost:3000.

NOTE: This setup guide does not include authentication configuration.

leerob commented 1 month ago

Nice, thank you! I believe this should all be covered in the README 😄

albertpco commented 1 month ago

Should be! But just saw that PR so maybe people go brrr through the list without pausing on the local dev.