Connect Your Database
One-time setup — takes 5 minutes
Step 1 — Create Supabase Project (Free)
Go to supabase.com → Sign up free → New Project → name it novussteel-ops
Step 2 — Run the Database Setup SQL
In Supabase → SQL Editor → paste and run this:

CREATE TABLE users (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, name text, email text UNIQUE, password text, role text, dept text, eid text, phone text, join_date date, active boolean DEFAULT true, created_at timestamptz DEFAULT now()); CREATE TABLE logs (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, date date, eng text, eng_id uuid, project text, task text, hours numeric, dwg int, status text, notes text, submitted_at timestamptz DEFAULT now(), locked boolean DEFAULT true); CREATE TABLE kpis (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, eng text, month text, drawings int, hours numeric, accuracy numeric, ontime numeric, rfis int, revisions int, created_at timestamptz DEFAULT now()); CREATE TABLE doubts (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, num int, date date, raised_by text, raised_by_id uuid, project text, category text, description text, priority text, assigned_to text, status text DEFAULT 'Open', resolution text, created_at timestamptz DEFAULT now()); CREATE TABLE leaves (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, emp text, emp_id uuid, type text, from_date date, to_date date, days int, reason text, contact text, applied date, status text DEFAULT 'Pending'); CREATE TABLE attendance (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, emp text, emp_id uuid, date date, in_time time, out_time time, hours numeric, status text, note text); CREATE TABLE clients (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, company text, contact text, email text, phone text, country text, type text, status text, revenue numeric, notes text, last_contact date); CREATE TABLE deals (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, title text, company text, value numeric, stage text, close_date date, probability int, added_by text, created_at timestamptz DEFAULT now()); CREATE TABLE leads (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, company text, contact text, source text, service text, budget numeric, priority text, status text, followup date, added_by text); CREATE TABLE payroll (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, emp_id uuid, name text, role text, dept text, eid text, basic numeric, hra numeric, transport numeric, special numeric, gross numeric, pf numeric, esi numeric, tds numeric, net numeric, bank text); CREATE TABLE projects (id uuid DEFAULT gen_random_uuid() PRIMARY KEY, name text, client text, location text, pm text, deadline date, status text, progress int DEFAULT 0); INSERT INTO users (name,email,password,role,dept,eid) VALUES ('Vinay Kumar','[email protected]','Admin@NES2025!','admin','Management','NES-000');
Step 3 — Get Your Keys
Supabase → Project Settings → API → copy Project URL and anon public key
Your keys are saved in your browser — never sent anywhere else