Skip to content

SDSUPlus/mpb-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mpb-backend

This repository contains the backend configuration for the SDSUPlus Supabase project.

Tooling

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.0
  • npm: 10.8.2
  • deno: 2.3.1 (for development only)
  • Docker (or Podman, tested with 5.4.2)

How to use

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.

Setting up Supabase tooling

  1. Create a new Supabase project.
  2. Download the Supabase CLI (supabase) or just don't and prefix all commands with npx.

Setting up the database

  1. 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.
  2. 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.

Setting up the edge

  1. 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_metadata table to already be populated with user_id and red_id records. It will not work otherwise.
    • The cookies and request verification are currently hard-coded. It may need to be updated.

About

Supabase backend for SDSUPlus application.

Resources

Stars

Watchers

Forks

Contributors