Skip to content

Backend — Configure Supabase

Julia Zet edited this page Sep 11, 2023 · 7 revisions

After you've set up your Supabase Account, you'll need to configure your Supabase Project.

We highly recommend to use the Supabse CLI to facilitate working with Supbase. Of course you can also work directly with Supabase Studio in the browser. However, this might not be reproducable and thus is prone to errors and not very developer friendly. Thus, we use Docker to run Supabase locally to first edit our Backend locally, before we migrate/push it to our remote Supabase instance.

  1. Install the supbase CLI running npm i supabase --save-dev
  2. open your favoured developer console and navigate to your fork of the Gieß den Kiez API Repo
  3. run npm ci to install dependencies
  4. run supabase login to login to your Supabase account that you've created earlier
  5. run supabase startto start a local instance of Supabase on your computer. Please note that you need Docker to be running.
  • supabase will start a database according to the SQL statements in the seed.sql, afterwards it will execute all the migrations within the migrations folder.
  1. You should now see a locally running Supabase instance. Credentials and the link to the locally running Supabase Studio will be provided in your console.
  2. Transform your tree data as needed (e.g. by using a python script) and push it into your local Supabase database instance
  • we use a Python script to yearly update our tree data, which might be a good starting point for your own Python script
  1. Check if your data was INSERTED the right way – if not, adjust your Python script!
  2. run supabase db push to push your local changes to your remote Supbase project.

💡 We highly recommend to use transform the tree data into the current Gieß den Kiez data structure to avoid customization for the Frontend. However, if you like to use a customized DB schema, please read about Supbase migrations to keep track of your changes: $ subase db diff