Skip to main content

Backend (Supabase)

Setup

  1. Create a project in Supabase
info

Make sure to save the DB password somewhere safe. you'll need it in the future

  1. Install supabase cli and link the created project (below installation is for Mac)
brew install supabase/tap/supabase
supabase link
info

Make sure you are in your project directory before you run supabase link

  1. Run the below commands to initialize the database and deploy edge functions
supabase db push
supabase functions deploy
  1. (OPTIONAL) Setup Supabase local development

Supabase Project Structure

  • /supabase/migrations -> Changes to the database go here to sync local development with production environment
  • /supabase/functions -> This is the serverless backend that is run through Supabase edge functions
  • Configuration files:
    • /supabase/.env -> Environment variables for the production database
    • /supabase/.env.local -> Environment variables for the local database