Admin Data
Admin-only data console: view any table, delete records, take a full backup (JSON download) and restore from a backup. Every action is written to the Activity Log.
🎬 One-Click Demo Sample Data
Instantly fill every showcase page with believable rows — payroll run, asset register, application links, messages, assignments, behaviour points, support plans, library shelf, help-desk tickets, house points, cafeteria menu, lost & found, PTA meetings and more. Idempotent: tables that already have data are skipped, so clicking twice never duplicates. Perfect before showing the platform to a prospective school.
🧹 Delete loaded sample data removes exactly the rows the loader creates — payroll run, asset register, library shelf, tickets, messages, PTA, promotions and the rest — matched by their unique sample fingerprints, so real school records are never touched. Safe to click any time; rows already deleted are simply skipped.
🗄️ Full backup & restore
☁️ Google Drive Backup & Sync (school-owned, free)
Back up the entire school database straight into the school’s own Google Drive with one click, restore from Drive with one click, and let the platform re-back-up automatically on a schedule. Backups are the same portable JSON archives used everywhere else, so they restore perfectly. The connection uses Google’s drive.file permission: this site can only see the backup files it created — never the rest of the school’s Drive.
⚙️ Setup & automatic sync schedule (owner only)
How auto-sync works on a free stack: whenever an admin opens any page and a backup is due, it uploads silently in the background (after the first authorisation in that browser). Full setup steps: docs/GOOGLE-DRIVE-SYNC-GUIDE.md in this package. One-time DB update for older installs: run database/drive-sync.sql.
🚑 Disaster Recovery Wizard — restore a school onto a FRESH database from Google Drive (click to open)
When to use this: the school’s old Supabase project was paused too long / deleted / permanently lost, but backups exist in the school’s Google Drive. This wizard rebuilds everything on a brand-new database in ~30–45 minutes with free tools. (If the old project is merely paused, do NOT use this — just restore it at supabase.com and press the 💓 heartbeat on the Platform Health Console.)
- Create the fresh database: supabase.com → New project → copy the new Project URL and anon public key (Project Settings → API).
- Install the schema: new project → SQL Editor → paste the ENTIRE
database/complete-schema.sqlfrom the site files → Run → wait for “installed successfully ✅”. (This auto-installs keep-alive, the vault, Drive-sync and security settings.) - Reconnect this website: edit
assets/js/config.js— replace the old SUPABASE_URL and SUPABASE_ANON_KEY with the new values — push to GitHub; Vercel redeploys the SAME site onto the fresh database. - Recreate the first admin: Login page → Request access → sign up; then in Supabase → Table Editor →
profiles→ set that row torole = super_admin,status = approved. - Reconnect Google Drive: sign in here as that admin → expand ⚙️ Setup in the ☁️ Google Drive card above → paste the school’s existing OAuth Client ID (it is tied to the site URL, not the database, so the SAME one still works) → Save.
- One-click restore: click 📂 List Drive backups above → authorise with the school’s Google account → every past backup appears → on the NEWEST one click 🚑 Recover to new project (not plain Restore). Recovery mode imports every school record, skips dead login accounts, clears stale references, retries row-by-row, and verifies the SHA-256 seal first.
- Re-onboard people: staff/parents/students sign up again (send one broadcast); approve them on Approvals — restored records re-link by admission/staff number and email.
- Re-arm ALL safeguards: open the 🛡️ Platform Health Console → press 💓 heartbeat, re-add the two GitHub Action secrets with the NEW url/key, repoint UptimeRobot at the new project, switch Drive auto-sync back ON and run one fresh backup. Every tile must be green.
Full printable runbook with a “what survives / what doesn’t” table: docs/DISASTER-RECOVERY-RUNBOOK.md (included in this package). Prevention: keep auto-sync ON and glance at the Health Console weekly — then this wizard is never needed.
🔗 One-Click Re-link after Disaster Recovery (V12.6 — NEW)
After you recover a school from Google Drive into a FRESH Supabase project, everybody signs up again with NEW accounts. Their old data (students, staff, parent links, results, fees…) is back, but user_id / parent_id are empty — the old auth accounts are gone. Instead of linking one-by-one, this tool re-links EVERYBODY in one click using the SAME backup you recovered.
- Staff: matched by
staff_noORemail(both preserved). Old user_id → old email → new profile id via email bridge. Last write wins. - Students: matched by
admission_no(unique, preserved) ORid. Old user_id → old email → new profile id. Fallback: full_name + class when never linked before. - Parent-child: old
parent_id→ old email → new parent id, student_id preserved (same after recovery) → parent_child upsert. - Only
user_id / parent_idcolumns touched — school data never touched. Photos then auto-sync via V12.2 triggers.
Prerequisite: run recovery (🚑 Recover to new project) first, then ask everybody to sign up again and approve them on Approvals. Then run this re-link. Safe to run twice — already-linked rows skipped.
♻️ Portable Data Archive Center
Every machine-readable export can come back. Portable JSON preserves UUIDs, dates, arrays and JSON fields for later restoration/analysis; CSV remains available for spreadsheets and can be re-imported into the selected table. Files are processed locally and are never stored in Supabase.