Supabase Setup

Optional backup storage setup.

Use Supabase free tier only for features that need backup. The website remains static and works without it.

SQL table

create table if not exists public.hmg_backup_storage (
  id uuid primary key default gen_random_uuid(),
  owner_key text not null,
  namespace text not null default 'academy_v5',
  payload jsonb not null,
  updated_at timestamptz default now()
);
create unique index if not exists hmg_backup_unique on public.hmg_backup_storage(owner_key, namespace);
alter table public.hmg_backup_storage enable row level security;
create policy "anon insert backup" on public.hmg_backup_storage for insert to anon with check (true);
create policy "anon read own backup by key" on public.hmg_backup_storage for select to anon using (true);
create policy "anon update backup" on public.hmg_backup_storage for update to anon using (true) with check (true);

For a production school deployment, tighten RLS around authenticated users. This static demo uses backup keys, so do not store highly sensitive data.

Config file

  1. Copy `assets/js/config.example.js` to `assets/js/config.js`.
  2. Paste your Supabase project URL and anon key.
  3. Keep table name as `hmg_backup_storage` unless changed.
  4. Deploy again.
  5. Use `backup-center.html` to save and restore.