Pencil Royal Setup

Complete these steps to start using the platform

1
Create Database Tables

You need to create the database tables in Supabase SQL Editor.

Takes 2 minutes

  1. Open Supabase SQL Editor →
  2. Copy the SQL below
  3. Paste it in the editor
  4. Click the ▶ Run button
CREATE TABLE IF NOT EXISTS schools ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE, name TEXT NOT NULL, location TEXT, profile_pic TEXT, approved BOOLEAN DEFAULT false, created_at TIMESTAMP DEFAULT NOW(), UNIQUE(user_id) ); CREATE TABLE IF NOT EXISTS students ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE, name TEXT NOT NULL, gender TEXT, created_at TIMESTAMP DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS competitions ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name TEXT NOT NULL, start_date TIMESTAMP, end_date TIMESTAMP, created_at TIMESTAMP DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS results ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), school_id UUID NOT NULL REFERENCES schools(id) ON DELETE CASCADE, rank INTEGER, score INTEGER, created_at TIMESTAMP DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS votes ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), student_id UUID NOT NULL REFERENCES students(id) ON DELETE CASCADE, voter_id UUID, created_at TIMESTAMP DEFAULT NOW() );
2
Verify Tables Created

After running the SQL, click the button below to verify everything is set up:

3
Start Using the App

Once the database is verified, you can register a school or login: