For Day 3 of ViTaL Workshops!
Learn how to use React and TypeScript by turning your old HTML/CSS/JS into React Components and use them in your full-stack Habit Tracker Web App!
frontend/– React (Vite) app; calls the backend API.backend/– Express server; reads/writes Supabase (habits, habit_completions).supabase/– Migrations for the Supabase schema.
-
Backend env – In
backend/, copy.env.exampleto.envand set:SUPABASE_URL– your Supabase project URLSUPABASE_ANON_KEY– your Supabase anon key
-
Supabase – Apply migrations in
supabase/migrations/to create thehabitsandhabit_completionstables. -
Install and run
- From repo root:
npm run dev(starts backend on port 3001 and frontend on Vite’s port). - Or run separately:
npm run dev:backendandnpm run dev:frontend.
- From repo root:
In development, the frontend proxies /api to the backend. For production, set VITE_API_URL in frontend/.env to your backend URL before building.