-
Notifications
You must be signed in to change notification settings - Fork 31
Backend — Configure Supabase
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.
- Install the supbase CLI running
npm i supabase --save-dev
- open your favoured developer console and navigate to your fork of the Gieß den Kiez API Repo
- run
npm ci
to install dependencies - run
supabase login
to login to your Supabase account that you've created earlier - run
supabase start
to 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.
- 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.
- 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
- Check if your data was INSERTED the right way – if not, adjust your Python script!
- 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