Complete guide for developers or anyone wishing to self-host the application.
- Node.js (Version 18 or higher)
- NPM or Bun
- A Supabase account (Free tier is sufficient)
Download the source code to your machine.
git clone https://github.com/simo-hue/habit-tracker.git
cd habit-trackerInstall all necessary libraries.
npm install
# or
bun installThis app uses Supabase for the database and authentication.
- Create a new project on Supabase.com.
- Go to Project Settings -> API.
- Copy
Project URLandanon public key. - Create a
.envfile in the project root and paste the values:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_anon_keyImportant
Database Setup: You will find a schema.sql file in the project root.
- Open the SQL Editor in your Supabase project.
- Copy and paste the entire content of
schema.sql. - Run the script to create all necessary tables and security policies.
npm run devThe app will be available at http://localhost:5173.
To create an optimized production build:
npm run buildThe dist folder will contain the static files ready to be uploaded to Vercel, Netlify, or your personal web server.
/src/components: Reusable UI components./src/hooks: Custom business logic (e.g.,useHabits)./src/lib/supabase.ts: Database client configuration./src/pages: Main application pages.
For architecture details, see TECHNICAL_DEEP_DIVE.md.