A full-stack, aesthetically driven habit tracking application designed to help users build and maintain positive habits through highly visual tracking, progressive rewards, and daily accountability.
- Dynamic Dark Mode UI: A stunning, modern dark-themed interface built from scratch with glassmorphism effects, radial gradients, and fluid micro-animations.
- Prestige Badge System: Long-term performance indicator. Earn progressive visual badges (Bronze, Silver, Gold, Platinum, Diamond, Apex) based on lifetime habit completion percentage. Features dynamic lighting and particle effects.
- Momentum Flame 2.0: A physically accurate, multi-layered gas flame visualizer that grows and changes color based on your monthly consistency and momentum.
- Advanced KPI Dashboard: At-a-glance circular progress rings for Today, Weekly, and Monthly completion rates, plus historical momentum tracking.
- Interactive Habit Grid: A responsive, horizontally scrolling calendar grid to mark habits complete.
- Drag-and-Drop Reordering: Intuitively reorder your habits using
@dnd-kit. - Soft Delete & Undo: Accidentally deleted a habit? Instantly recover it with a custom animated toast notification.
- Detailed Analytics: Visual graphs and Top Habits tracking to analyze your long-term performance.
- Mobile-First Responsive Layout: flawless experience across desktop, tablet, and mobile devices.
- React 18.2.0 - Core UI library
- React Router 7.11.0 - Client-side routing
- Framer Motion - Fluid animations and layout transitions
- @dnd-kit core/sortable - Drag and drop functionality
- Day.js - Lightweight date parsing and formatting
- Axios - HTTP client for API requests
- JWT Decode - Secure frontend token management
- Node.js with Express 5.2.1 - Robust server framework
- MongoDB with Mongoose 9.1.1 - NoSQL Database and ODM
- JSON Web Tokens (JWT) - Secure, stateless authentication
- Bcrypt - Enterprise-grade password hashing
- CORS - Secure cross-origin resource sharing
Before you begin, ensure your development environment meets the following requirements:
- Node.js (v14.0.0 or higher)
- npm (v6.0.0 or higher)
- MongoDB (v4.0 or higher) - Running locally or via MongoDB Atlas
git clone https://github.com/KaushalMikaelson/habit-tracker.git
cd habit-trackerInstall dependencies for both the frontend and backend environments:
# Install root dependencies
npm install
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate a .env file in the backend directory:
cd backend
cp .env.example .envEdit the .env file with your specific configuration details:
# Server Configuration
PORT=5000
# MongoDB Configuration
MONGO_URI=mongodb://127.0.0.1:27017/habit-tracker
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here
# Logging Configuration
# Options: 'none', 'error', 'info', 'debug'
LOG_LEVEL=infoCreate a .env file in the frontend directory:
REACT_APP_API_URL=http://localhost:5000Ensure your MongoDB instance is running:
# On Windows
mongod
# On macOS/Linux
sudo systemctl start mongodLaunch the application by opening two separate terminal windows:
Terminal 1 - Backend Server:
cd backend
node server.jsTerminal 2 - Frontend Application:
cd frontend
npm startThe application will now be accessible at:
- Frontend App:
http://localhost:3000 - Backend API:
http://localhost:5000
habit-tracker/
βββ backend/
β βββ controllers/ # Business logic & request handlers
β βββ middleware/ # Auth & validation middleware
β βββ models/ # Mongoose schemas (User, Habit)
β βββ routes/ # REST API route definitions
β βββ utils/ # Helper functions & logger
β βββ server.js # Express application entry point
β
βββ frontend/
β βββ public/ # Static assets
β βββ src/
β β βββ api/ # Axios instance & API calls
β β βββ components/ # Modular React components
β β β βββ habits/ # Grid, layout, and habit controls
β β β βββ kpi/ # Analytical rings and stats
β β β βββ MomentumFlame/ # Complex visual indicator
β β β βββ PrestigeBadge/ # Long-term progression system
β β βββ hooks/ # Custom React hooks (useHabits)
β β βββ pages/ # High-level route components (Dashboard, Auth)
β β βββ utils/ # Date formatting, calc logic
β β βββ App.js # Root component routing
β βββ package.json
βββ README.md
POST /api/auth/signup- Register a new user accountPOST /api/auth/login- Authenticate user and receive JWT
GET /api/habits- Retrieve all habits for the authenticated userPOST /api/habits- Create a new habit entryPATCH /api/habits/:id/toggle- Toggle habit completion status for a specific dateDELETE /api/habits/:id- Soft delete a habit (allows undo)PATCH /api/habits/:id/undo- Restore a previously soft-deleted habitPATCH /api/habits/reorder- Update habit display order
- Password Cryptography: Bcrypt hashing with secure salt rounds
- Stateless Auth: JWT-based authentication preventing session hijacking
- Route Protection: Custom Express middleware for strict endpoint access control
- Input Sanitization: Server-side validation to prevent injection attacks
- CORS Policies: Strictly controlled cross-origin resource sharing rules
- Verify MongoDB daemon is actively running:
mongod --version - Double-check the
MONGO_URIconnection string in your backend.envfile
If ports 5000 or 3000 are blocked by another process:
# Windows: Find and terminate process
netstat -ano | findstr :5000
taskkill /PID <PID> /F- Verify
JWT_SECRETis correctly populated in the backend.env - Clear browser
localStorageand attempt re-login to flush stale tokens
This project is open-source and licensed under the MIT License.
Kaushal Mikaelson
- GitHub: @KaushalMikaelson
Contributions, bug reports, and feature requests are highly encouraged. Please check the issues page to get involved.
Crafted with focus and discipline.