Follow these steps to make your data permanent and accessible from any device.
- Go to supabase.com and create a free account
- Create a new project (choose any region close to KSA)
- Go to Settings → API and copy your Project URL and anon key
- Open this HTML file in a text editor and replace
YOUR_PROJECT and YOUR_ANON_KEY_HERE
- Go to SQL Editor in Supabase and run the schema below
- Upload the file to your hosting or Netlify (free)
-- Run this in Supabase SQL Editor
CREATE TABLE clients (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
name text NOT NULL,
industry text,
cr_number text,
vat_number text,
contact_name text,
contact_email text,
contact_phone text,
address text,
mgmt_fee numeric DEFAULT 200,
contract_start date,
status text DEFAULT 'Active'
);
CREATE TABLE employees (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
name text NOT NULL,
emp_id text,
nationality text,
passport_no text,
passport_expiry date,
dob date,
email text,
work_email text,
mobile text,
client_id uuid REFERENCES clients(id),
title text,
salary numeric,
contract_start date,
contract_end date,
status text DEFAULT 'Active',
iqama_no text,
iqama_expiry date,
iqama_profession text,
ins_provider text,
ins_class text,
ins_policy text,
ins_expiry date,
ins_fee numeric
);
CREATE TABLE costs (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
employee_id uuid REFERENCES employees(id),
client_id uuid REFERENCES clients(id),
date date NOT NULL,
cost_type text NOT NULL,
amount numeric NOT NULL,
reference text,
billable text DEFAULT 'yes',
invoice_ref text,
notes text
);
CREATE TABLE invoices (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
invoice_number text NOT NULL,
client_id uuid REFERENCES clients(id),
period text,
subtotal numeric,
vat_amount numeric,
total numeric,
status text DEFAULT 'Draft',
zoho_invoice_id text,
notes text,
line_items jsonb
);
CREATE TABLE insurance (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
employee_id uuid REFERENCES employees(id),
provider text,
class text,
policy_no text,
start_date date,
expiry_date date,
annual_fee numeric,
status text DEFAULT 'Active'
);
-- Enable Row Level Security (optional but recommended)
ALTER TABLE clients ENABLE ROW LEVEL SECURITY;
ALTER TABLE employees ENABLE ROW LEVEL SECURITY;
ALTER TABLE costs ENABLE ROW LEVEL SECURITY;
ALTER TABLE invoices ENABLE ROW LEVEL SECURITY;
ALTER TABLE insurance ENABLE ROW LEVEL SECURITY;