Organisations
—
Total users
—
Contacts (CRM)
—
Quotes
—
System status
All organisations summary
| Organisation | Slug | Plan | Users | Contacts | Quotes | Actions |
|---|
Organisations
Each organisation is a fully isolated tenant. All data is scoped by
org_id with Postgres Row Level Security. An org cannot see another org's data.
Users & Profiles
| Name | Organisation | Role | Created | Actions |
|---|
Invite a new user
This sends a Supabase magic-link invite. Once the user sets their password, their
cf_profiles row is created with the org and role you choose below.
User details
User can change this after first login via Forgot password.
Assign org to existing user
Use this if a user already has a Supabase Auth account but no
cf_profiles row.First-time Setup Guide
Step 1 — Run schema SQL
Open your Supabase project → SQL Editor → paste and run corruflow_schema.sql. This creates all tables, RLS policies, and the atomic quote sequence function.
-- Tables created by schema SQL:
cf_organizations · cf_profiles · cf_customers
cf_contacts · cf_activities · cf_enquiries
cf_complaints · cf_quotes · cf_rate_master
cf_counters · cf_approved_rates · cf_rate_history
cf_travel_logs
-- RLS: all tables scoped by org_id
-- RPC: cf_next_quote_seq(p_org_id) — atomic seq
cf_organizations · cf_profiles · cf_customers
cf_contacts · cf_activities · cf_enquiries
cf_complaints · cf_quotes · cf_rate_master
cf_counters · cf_approved_rates · cf_rate_history
cf_travel_logs
-- RLS: all tables scoped by org_id
-- RPC: cf_next_quote_seq(p_org_id) — atomic seq
Step 2 — Create your first organisation
Create an org record for your company. Every user must belong to an org to access data.
Step 3 — Create admin profile for yourself
Your Supabase Auth account exists, but you need a cf_profiles row to access org data. Fill in your user UUID (from Supabase Auth → Users) and the org you just created.
Step 4 — Initialise quote counter
Each org needs a quote sequence counter row. Run this once per org after creating it.
Step 5 — Seed default rate master
Seed a default rate master for an organisation so the Costing Engine has paper grades and conversion rates to work with.
Supabase anon key & URL
These are currently hard-coded in all CorruFlow HTML files. To change them, do a find-and-replace across all files.
To update: open each .html file in a text editor and replace
CF_SB_URL and CF_SB_ANON values.