This repository contains the backend configuration for the SDSUPlus Supabase project.
The following tooling is expected to be installed. The versions are simply what is currently used for development; other versions of these tools may still work.
node: 20.19.0npm: 10.8.2deno: 2.3.1 (for development only)- Docker (or Podman, tested with 5.4.2)
This setup was not written with self-hosting in mind, so the following instructions will be related to replicating the SDSUPlus backend on a new Supabase-hosted project.
- Create a new Supabase project.
- Download the Supabase CLI (
supabase) or just don't and prefix all commands withnpx.
- Reset your local Supabase developement database with
supabase db reset.- If you've never locally developed Supabase, this will be painful. You will need to download a lot of Docker images.
- If you have, keep in mind that this will wipe whatever you had in that local database. It will not touch the remote... yet.
- Push the migrations to the remote database with
supabase db push.- This will push the difference from the local to remote database. This may not produce the same setup as SDSUPlus if you're pushing to a non-bare Supabase project.
- Deploy the edge function to remote with
supabase functions deploy fetch-balance.- Again, this might end up installing a lot of docker images.
- The function expects the
user_metadatatable to already be populated withuser_idandred_idrecords. It will not work otherwise. - The cookies and request verification are currently hard-coded. It may need to be updated.