# Requirements

  • Nodejs version >= 12 (made with v16.17.0)
  • npm version >= 7 (made with v8.19.2)
  • Node packages, installed with npm install
  • Socket.io for client-server communication
  • Supabase for authentication
  • Google Sheets for data storage

# Supabase

Set up a Supabase project to manage authentication using these tutuorials. Add your anon key to .env and update src/routes/login.svelte with your chosen authentication methods. We have used 'Login with Email' and 'Login with Google'.

# Google Sheets

Set up your own Google Sheets file using this template.

# Secrets files

.env

# These can be found on your Supabase project.
# See https://supabase.com/docs/guides/with-sveltekit for a tutorial, specifically on using anon keys
# DANGER: USE THE 'ANON' KEY ONLY AS IT IMPLEMENTS ROW-LEVEL SECURITY! THE SERVICE ROLE KEY HAS FULL ACCESS TO YOUR DATABASE SO SHOULD NEVER BE PUBLIC!

# Static Public
VITE_SUPABASE_URL="https://<DATABASE_ID>.supabase.co"
VITE_SUPABASE_ANON_KEY="<ANON_KEY>"

server/secret.js

// Create a Google Cloud Project: https://developers.google.com/workspace/guides/create-project
// Enable the Google Sheets API: https://developers.google.com/workspace/guides/enable-apis

export const GOOGLE_SHEETS_API_EMAIL    = "<ACCOUNT_EMAIL>"
export const GOOGLE_SHEETS_PRIVATE_KEY  = "<PRIVATE_KEY>"

server/config.json

Note that the Google Sheets ID is not the full URL: https://docs.google.com/spreadsheets/d/<GOOGLE_SHEETS_ID>/

Note that sign up & sign in windows have not been implemented yet.

Admin UIds can be obtained from Supabase.

{
    "<PROJECT_NAME>" : {
        "open_sign_up" : "2022-11-01T00:00:00.000Z",
        "close_sign_up" : "2022-12-01T00:00:00.000Z",
        "open_sign_in" : "2022-11-01T00:00:00.000Z",
        "close_sign_in" : "2022-12-01T00:00:00.000Z",
        "cubes_data_url" : "<GOOGLE_SHEETS_ID>",
        "cubes_data_names" : ["<GOOGLE_SHEETS_TAB_NAMES>"],
        "admin_uids" : ["<SUPABASE_UIDs>"]
    }
}