A habit tracking app built with TanStack Start, React 19, and Prisma. It helps users stay consistent with daily habits through streak tracking, completion analytics, and activity visualizations.
- Daily habit completion with quick check interactions
- Habit creation/editing with color, frequency, and optional notes
- Streak tracking (current and longest)
- Activity heatmap and completion history
- Stats dashboard with time-range filters
- Authenticated user data via Supabase
- Responsive layout with desktop sidebar and mobile bottom navigation
- TanStack Start + TanStack Router (SSR)
- Vite + Nitro
- React 19 + TypeScript
- TanStack Query
- Tailwind CSS + Radix UI
- Supabase Auth
- Prisma + PostgreSQL
- Node.js 18+
pnpm(project usespnpm@10)- PostgreSQL database (local or Supabase Postgres)
git clone <your-repo-url>
cd habit-tracker
pnpm installCreate a .env file in the project root.
# Database
DATABASE_URL="postgresql://..."
# Optional but recommended for Prisma CLI/migrations
DIRECT_URL="postgresql://..."
# Supabase (server + browser)
SUPABASE_URL="https://<project-ref>.supabase.co"
SUPABASE_PUBLISHABLE_KEY="<anon-or-publishable-key>"
# Optional aliases supported by current code
# SUPABASE_ANON_KEY="<anon-key>"
# VITE_SUPABASE_URL="https://<project-ref>.supabase.co"
# VITE_SUPABASE_PUBLISHABLE_KEY="<anon-or-publishable-key>"
# Auth redirect URLs used in signup flow
DEV_SUPABASE_REDIRECT_URL="http://localhost:3000"
SUPABASE_REDIRECT_URL="https://your-production-domain.com"pnpm prisma generate
pnpm prisma db pushThe Prisma schema is located at src/prisma/schema.prisma (configured in prisma.config.ts).
pnpm devApp runs at http://localhost:3000.
pnpm dev- Run the TanStack Start dev server (via Vite)pnpm build- Build for productionpnpm start- Run the built server from.output/server/index.mjspnpm postinstall- Generate Prisma client
/login- Login screen/signup- Signup screen/check-email- Email verification prompt/- Authenticated home (today's habits)/habits- Habit management/habits/$habitId- Habit details and history/stats- Analytics and progress views/profile- User profile and sign out
Core Prisma models:
UserHabitHabitCompletion
- This project was migrated from Next.js to TanStack Start.
- Some dependencies/config may still reference legacy tooling during cleanup.