Run npm i to install the dependencies.
Run npm run dev:client to start the development client.
Run npm run server to start the development server on a different terminal.
Run python -m venv venv to create a virtual environment.
Run pip install -r requirements.txt to install the python dependencies.
For windows, use .\venv\Scripts\activate to activate the virtual environment.
For mac, use source venv/bin/activate to activate the virtual environment.
- Copy
.env.exampleto.env.localand fill in the Supabase values:
Copy-Item .env.example .env.localVITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYcome from your Supabase project's API settings (Project Settings ➜ API).DATABASE_URLis used only for CLI/database migrations and should never be exposed to the browser.
- Apply the database schema using the provided Supabase connection string:
psql "$env:DATABASE_URL" -f supabase/schema.sqlThe script creates:
insurance_planswith related policy metadata/documentsuserskeyed by email (includes DOB and plan membership)insurance_casespluscase_documentsfor provider uploads- A convenience view
plan_member_snapshotthat surfaces members, cases, and policy docs per plan
- Smoke-test the schema directly from
psql(helps confirm migrations on Supabase):
psql "$env:DATABASE_URL" -c "\dt"
psql "$env:DATABASE_URL" -c "SELECT plan_name, insurance_name FROM insurance_plans LIMIT 5;"
psql "$env:DATABASE_URL" -c "SELECT * FROM plan_member_snapshot LIMIT 5;"You should see the new tables listed, and the final query should return one row per plan with aggregated members/cases. Add seed data with regular INSERT commands to exercise the relationships before pointing the UI at Supabase.
- Use the shared Supabase client in
src/utils/supabase/client.tsto read/write data inside the app:
import { supabase } from '@/utils/supabase/client';
const { data, error } = await supabase.from('insurance_cases').select('*');Because the client relies on import.meta.env, remember to restart the dev server whenever you add or change environment variables.