supabase-template

Get started

  1. Clone this repo

  2. Install dependencies, including the Supabase CLI

yarn
  1. Create frontend env file
cp .env.example .env
  1. Create supabase functions env file
echo "OPENAI_API_KEY=sk-xxx" > supabase/.env
  1. Start the supabase project
supabase start
  1. Start the supabase functions locally
yarn supabase:dev
  1. Start the frontend locally
yarn dev
  1. Open http://localhost:3100 with your browser to see the result.

Deploy

  1. Create a new project on Supabase

  2. Create a new project on Vercel

  3. To deploy the frontend, connect your Vercel project to your GitHub repo and push to main.

  4. To deploy the supabase functions, first login to Supabase:

supabase login

Then, link your project:

supabase link --project-ref <project-ref>

Then, deploy the functions:

yarn supabase:deploy

Optionally, if you're also using the Supabase Vector Store from LangcChain, you'll need to push the schema to the database:

supabase db push