Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

AI Habit Tracker

A modern, full-stack habit tracking application with AI-powered insights, personalized habit suggestions, and streak tracking.

Demo Login

The demo account is already available in the database to see all features in action better:

  • Email: demo@example.com
  • Password: password123

Features

  • Modern UI/UX: Built with React and Tailwind CSS featuring glassmorphism, dynamic layouts, and a responsive design.
  • AI Coach: Integrated with Gemini 2.5 Flash to provide personalized weekly reports, habit suggestions, and morning motivation based on your specific goals and struggles.
  • Habit Tracking: Track daily habits, view historical completion heatmaps, and monitor your current and longest streaks.
  • Secure Authentication: JWT-based authentication using HTTP-only cookies to ensure maximum security.
  • Full Stack: Powered by a Node.js/Express backend and MongoDB.

Tech Stack

Frontend (Client)

  • React
  • Vite
  • Tailwind CSS
  • Axios
  • Recharts (for data visualization)
  • Lucide React (for icons)

Backend (Server)

  • Node.js
  • Express
  • MongoDB & Mongoose
  • JSON Web Tokens (JWT)
  • Google Gen AI SDK (@google/genai)
  • bcryptjs

Getting Started

Prerequisites

  • Node.js installed
  • MongoDB URI (local or Atlas)
  • Google Gemini API Key

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd ai-habit-tracker
  2. Setup the Backend

    cd server
    npm install

    Create a .env file in the server directory:

    PORT=8080
    MONGO_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
    GEMINI_API_KEY=your_gemini_api_key
    FRONTEND_URL=http://localhost:5173
  3. Setup the Frontend

    cd ../client
    npm install

    Create a .env file in the client directory:

    VITE_API_URL=http://localhost:8080/api

Running the Application

  1. Start the Backend Server

    cd server
    npm run dev
  2. Start the Frontend Client

    cd client
    npm run dev

Seeding the Database (Optional)

If you want to populate the database with a demo user and mock data for the last 90 days:

cd server
npm run seed

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages