Skip to main content

Local Supabase Server

Why?

When working on a feature branch, we can't change the schema of staging/dev db as others testing or working on other branches might face conflicts. To avoid this issue, when working on a feature branch which requires changing schema of the db, local db server MUST BE USED. Once the feature branch is merged, staging/dev db should be migrated accordingly.

Setup

  1. Install Docker/Docker Desktop
  2. npm install -g env-cmd
  3. ask for .env file and place it into code\backend\mb-supabase
  4. cd code\backend\mb-supabase
  5. env-cmd supabase start
  6. copy the api url and anon shown in the terminal to code\presentation\mb-client\.env.development
  7. mb-client should now connect to local db instead of staging db

How to change Schema

  • Follow this guide to create migration for your db
  • dont forget to update the seed too

some useful commands