In your Supabase project, go to
SQL Editor (left sidebar) and run this SQL:
-- Run this in Supabase SQL Editor
create table clients (
id uuid primary key default gen_random_uuid(),
name text not null,
email text,
goal text,
program text,
week int default 1,
total_weeks int default 8,
progress int default 0,
weight numeric,
target_weight numeric,
last_active text,
status text default 'active',
notes text,
created_at timestamptz default now()
);
create table workouts (
id uuid primary key default gen_random_uuid(),
name text not null,
type text,
duration text,
exercises jsonb,
sent_to text,
created_at timestamptz default now()
);
create table nutrition_plans (
id uuid primary key default gen_random_uuid(),
client_id uuid references clients(id) on delete cascade,
calories int,
protein int,
carbs int,
fats int,
notes text,
created_at timestamptz default now()
);
create table checkins (
id uuid primary key default gen_random_uuid(),
client_id uuid references clients(id) on delete cascade,
client_name text,
energy int,
sleep int,
soreness int,
notes text,
status text default 'pending',
created_at timestamptz default now()
);
create table custom_exercises (
id uuid primary key default gen_random_uuid(),
name text not null,
muscle text,
equipment text,
icon text,
notes text,
created_at timestamptz default now()
);
-- Allow public access (coach-only app, no multi-user auth needed)
alter table clients enable row level security;
alter table workouts enable row level security;
alter table nutrition_plans enable row level security;
alter table checkins enable row level security;
alter table custom_exercises enable row level security;
create policy "allow all" on clients for all using (true);
create policy "allow all" on workouts for all using (true);
create policy "allow all" on nutrition_plans for all using (true);
create policy "allow all" on checkins for all using (true);
create policy "allow all" on custom_exercises for all using (true);
Paste it into the SQL editor and click
Run. You should see "Success. No rows returned."