A simple habit tracker for a small group (up to ~20 people) doing daily sports, with cheat days and sick days, photo uploads, and sport categories.
- Frontend: React + Vite + TypeScript + TanStack Query
- Backend: Supabase (Postgres, Auth, Storage)
-
Create a Supabase project at supabase.com.
-
In the SQL Editor, run the contents of
supabase/schema.sql. -
In Storage, create a new public bucket named
daily-photos. -
Copy
.env.exampleto.envand fill in your project's URL and anon key (found under Settings -> API). -
Install dependencies and run the dev server:
npm install npm run dev
src/
├── lib/
│ ├── supabaseClient.ts # Supabase client setup
│ └── types.ts # shared TS types for DB rows
├── hooks/ # data-fetching hooks (React Query + Supabase)
├── components/ # reusable UI pieces (e.g. CalendarGrid)
├── pages/ # top-level views (Login, Dashboard)
├── App.tsx # routes between Login/Dashboard based on auth
└── main.tsx # entry point, sets up QueryClientProvider
supabase/
└── schema.sql # database schema, kept in sync manually with the
# Supabase project (run in SQL Editor)
- participants: public profile table, one row per user (auto-created on
signup via a trigger), linked to
auth.users. - daily_entries: one row per participant per day, with:
category-- e.g.gym,padel,runningstatus--done,cheat,sick, ormissedphoto_url-- optional photo for the daynotes-- optional free text
Row Level Security ensures everyone can view all entries (for a shared overview), but each user can only insert/update/delete their own.
Early scaffold -- login + a basic monthly calendar grid are wired up. Still to build: entry form/modal for logging a day (category, status, photo upload), per-participant monthly views, and an overview of all participants.