Find a file
2024-12-05 12:21:58 -05:00
public added icon to title bar 2024-11-20 20:11:20 -05:00
src removed week scrolling 2024-12-05 12:21:58 -05:00
.env fixed login ui and made it working 2024-11-21 21:37:29 -05:00
.gitignore fixing npm install vulnerabilities 2024-11-19 02:07:41 -05:00
eslint.config.js first commit 2024-11-17 13:40:06 -05:00
habits.db added features and settings 2024-11-20 18:46:31 -05:00
image-1.png Created comprehensive readme 2024-11-26 13:33:09 -05:00
image-2.png Created comprehensive readme 2024-11-26 13:33:09 -05:00
image.png Created comprehensive readme 2024-11-26 13:33:09 -05:00
index.html added icon to title bar 2024-11-20 20:11:20 -05:00
package-lock.json improved login and sign up pages 2024-11-22 01:21:33 -05:00
package.json improved login and sign up pages 2024-11-22 01:21:33 -05:00
postcss.config.js first commit 2024-11-17 13:40:06 -05:00
README.md Created comprehensive readme 2024-11-26 13:33:09 -05:00
server.js first commit 2024-11-17 13:40:06 -05:00
tailwind.config.js first commit 2024-11-17 13:40:06 -05:00
tsconfig.app.json first commit 2024-11-17 13:40:06 -05:00
tsconfig.json first commit 2024-11-17 13:40:06 -05:00
tsconfig.node.json first commit 2024-11-17 13:40:06 -05:00
vercel.json vercel deployment changes 2024-11-20 19:58:53 -05:00
vite.config.ts vercel deployment changes 2024-11-20 19:58:53 -05:00

Habit Tracker

A modern, full-stack habit tracking application built with React, TypeScript, and Supabase. Track your daily habits, visualize progress, and build better routines.

Habits page

alt text

Calendar page

alt text

Settings page

alt text

Features

  • 📱 Responsive design that works on desktop and mobile
  • 🌓 Light and dark mode support
  • 📊 Weekly and monthly habit tracking views
  • 🔄 Real-time updates using Supabase
  • 📈 Streak tracking and statistics
  • 🔐 User authentication and personal habit storage
  • Fast and responsive UI with Framer Motion animations

Tech Stack

  • Frontend:

    • React
    • TypeScript
    • Tailwind CSS
    • Framer Motion
    • Lucide Icons
  • Backend:

    • Supabase (Database & Authentication)
  • Development:

    • Vite
    • ESLint
    • PostCSS
    • Vercel (Deployment)

Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Supabase account

Environment Setup

  1. Clone the repository:
git clone https://github.com/rathiharivansh/habit-tracker-2.git
cd habit-tracker-2
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with your Supabase credentials:
VITE_SUPABASE_URL=
VITE_SUPABASE_ANON_KEY=

Database Setup

  1. Create a new Supabase project
  2. Set up the following tables in your Supabase database:
-- Habits table
CREATE TABLE habits (
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
name TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT TIMEZONE('utc'::text, NOW()) NOT NULL,
best_streak INTEGER DEFAULT 0
);
-- Habit completions table
CREATE TABLE habit_completions (
habit_id BIGINT REFERENCES habits(id) ON DELETE CASCADE,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
completion_date DATE NOT NULL,
PRIMARY KEY (habit_id, completion_date)
);
-- User preferences table
CREATE TABLE user_preferences (
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE PRIMARY KEY,
theme TEXT DEFAULT 'light',
default_view TEXT DEFAULT 'habits',
show_streaks BOOLEAN DEFAULT true,
habit_sort TEXT DEFAULT 'dateCreated'
);

Development

Run the development server:

npm run dev

The application will be available at http://localhost:5173

Building for Production

npm run build

Deployment

The project is configured for deployment on Vercel. Simply connect your repository to Vercel and it will automatically deploy your application.

Make sure to add your environment variables in the Vercel project settings.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments

Live Demo

Check out the live demo at: Habit Tracker Demo