Connect Home Hub to Supabase for real-time sync across all browsers and household members.
home-hub.In your Supabase project, go to SQL Editor and run this query:
create table if not exists task_completions ( id uuid default gen_random_uuid() primary key, task_id text not null unique, completed_by text, completed_at timestamptz default now(), next_due timestamptz, created_at timestamptz default now() ); -- Allow all reads and writes (household app, no auth needed) alter table task_completions enable row level security; create policy "Allow all" on task_completions for all using (true) with check (true);
task_completions and toggle it on.Create a file called config.js in the root of the project:
// config.js — your Supabase credentials window.SUPABASE_URL = 'https://your-project-id.supabase.co'; window.SUPABASE_ANON_KEY = 'your-anon-public-key-here';
Then add it to index.html before the other scripts:
<script src="config.js"></script>
anon key is safe to expose in a frontend app — it only has the permissions defined by your Row Level Security policies. Never expose your service_role key.
/..netlify.app URL.config.js to your .gitignore so your keys aren't committed to GitHub. On Netlify, set the keys as Environment Variables instead and inject them at build time if you want a more secure setup.
Once deployed, any time someone marks a task complete, every other browser on the same Netlify URL will update within seconds.