Skip to content

AyushSingh360/Habitflow

Repository files navigation

๐ŸŽฏ HabitFlow - Advanced PWA Habit Tracker

React TypeScript PWA IndexedDB

A stunning, production-ready Progressive Web App for tracking habits with advanced animations, offline capabilities, and comprehensive analytics. Built with modern web technologies and designed for excellence.

๐Ÿš€ Live Demo โ€ข ๐Ÿ“– Features โ€ข ๐Ÿ› ๏ธ Installation โ€ข ๐ŸŽจ Animations โ€ข ๐Ÿ“ฑ PWA Features


โœจ Features

๐ŸŽฏ Habit Management

  • Smart Habit Creation - Intuitive form with 16 colors & icons
  • Category Organization - 10 predefined categories
  • Custom Reminders - Time-based notifications
  • Streak Tracking - Current & longest streak calculation
  • Progress Analytics - Completion rates & insights

๐ŸŽจ Beautiful Design

  • Dark/Light Mode - Seamless theme switching
  • Advanced Animations - 15+ custom animations
  • Micro-interactions - Ripple effects & hover states
  • Responsive Design - Perfect on all devices
  • Gradient Backgrounds - Animated floating elements

๐Ÿ“Š Analytics & Insights

  • Interactive Charts - Weekly & monthly progress
  • Performance Metrics - Detailed habit statistics
  • Motivational Quotes - Daily inspiration
  • Completion Tracking - Real-time progress updates
  • Data Export - Backup your progress

๐Ÿ”ง PWA Capabilities

  • Offline First - Works without internet
  • Installable - Add to home screen
  • Push Notifications - Habit reminders
  • Service Worker - Background sync
  • IndexedDB Storage - Local data persistence

๐ŸŽฌ Animations & Effects

๐ŸŒŸ Advanced Animation System

HabitFlow features a comprehensive animation system with 15+ custom animations:

  • fadeIn - Smooth entrance animations
  • slideUp/Down/Left/Right - Directional slide effects
  • bounce-gentle - Subtle bounce animations
  • wiggle - Playful wiggle effects
  • float - Floating elements background
  • glow - Pulsing glow effects
  • shimmer - Shimmer loading states
  • ripple - Button click ripples
  • heartbeat - Pulsing heart animations
  • confetti - Celebration effects
  • streak-fire - Streak flame animations

๐ŸŽญ Interactive Elements

  • Ripple Buttons - Material Design inspired click effects
  • Confetti Celebrations - Habit completion rewards
  • Hover Transformations - Scale and glow effects
  • Loading Animations - Multi-layered spinners
  • Progress Bars - Animated completion indicators

๐Ÿ“ฑ PWA Features

๐Ÿ”„ Offline Capabilities

  • IndexedDB Storage - Robust local database
  • Service Worker - Background caching
  • Offline Analytics - Works without connection
  • Data Synchronization - Seamless online/offline

๐Ÿ“ฒ Installation

  • Add to Home Screen - Native app experience
  • Standalone Mode - Full-screen operation
  • App Icons - Custom 192x192 & 512x512 icons
  • Splash Screen - Branded loading experience

๐Ÿ”” Notifications

  • Browser Notifications - Habit reminders
  • Permission Management - User-controlled
  • Scheduled Alerts - Time-based reminders
  • Instant Feedback - Completion notifications

๐Ÿš€ Quick Start

Prerequisites

Node.js 18+ and npm/yarn

Installation

# Clone the repository
git clone https://github.com/AyushSingh360/habitflow.git

# Navigate to project directory
cd habitflow

# Install dependencies
npm install

# Start development server
npm run dev

๐ŸŽ‰ That's it! HabitFlow will be running at http://localhost:5173

๐Ÿ› ๏ธ Available Scripts

Command Description
npm run dev ๐Ÿš€ Start development server with hot reload
npm run build ๐Ÿ“ฆ Build optimized production bundle
npm run preview ๐Ÿ‘€ Preview production build locally
npm run lint ๐Ÿ” Run ESLint for code quality

๐Ÿ—๏ธ Architecture

๐Ÿ“ Project Structure

habitflow/
โ”œโ”€โ”€ ๐Ÿ“ public/
โ”‚   โ”œโ”€โ”€ manifest.json          # PWA manifest
โ”‚   โ””โ”€โ”€ habit-icon-*.png       # App icons
โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/
โ”‚   โ”‚   โ”œโ”€โ”€ AnimatedBackground.tsx    # Floating animations
โ”‚   โ”‚   โ”œโ”€โ”€ ConfettiEffect.tsx       # Celebration effects
โ”‚   โ”‚   โ”œโ”€โ”€ RippleButton.tsx         # Interactive buttons
โ”‚   โ”‚   โ”œโ”€โ”€ HabitCard.tsx            # Habit display cards
โ”‚   โ”‚   โ”œโ”€โ”€ HabitForm.tsx            # Habit creation form
โ”‚   โ”‚   โ”œโ”€โ”€ HabitsView.tsx           # Main habits interface
โ”‚   โ”‚   โ”œโ”€โ”€ AnalyticsView.tsx        # Charts & statistics
โ”‚   โ”‚   โ”œโ”€โ”€ SettingsView.tsx         # App configuration
โ”‚   โ”‚   โ””โ”€โ”€ Header.tsx               # Navigation header
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ useHabits.ts             # Habit management logic
โ”‚   โ”‚   โ””โ”€โ”€ useDarkMode.ts           # Theme switching
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ database.ts              # IndexedDB operations
โ”‚   โ”‚   โ”œโ”€โ”€ habitStats.ts            # Statistics calculations
โ”‚   โ”‚   โ””โ”€โ”€ notifications.ts         # Push notifications
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ types/
โ”‚   โ”‚   โ””โ”€โ”€ habit.ts                 # TypeScript definitions
โ”‚   โ””โ”€โ”€ App.tsx                      # Main application
โ”œโ”€โ”€ ๐Ÿ“„ vite.config.ts               # Vite & PWA configuration
โ”œโ”€โ”€ ๐Ÿ“„ tailwind.config.js           # Tailwind & animations
โ””โ”€โ”€ ๐Ÿ“„ package.json                 # Dependencies & scripts

๐Ÿ”ง Technology Stack

  • Frontend: React 18 + TypeScript
  • Styling: Tailwind CSS + Custom Animations
  • Database: IndexedDB (via idb library)
  • Charts: Chart.js + React-ChartJS-2
  • PWA: Vite-Plugin-PWA + Workbox
  • Icons: Lucide React
  • Build Tool: Vite
  • Date Handling: date-fns

๐ŸŽจ Customization

๐ŸŒˆ Adding Custom Animations

// tailwind.config.js
extend: {
  animation: {
    'your-animation': 'yourKeyframes 1s ease-in-out infinite',
  },
  keyframes: {
    yourKeyframes: {
      '0%': { transform: 'scale(1)' },
      '50%': { transform: 'scale(1.1)' },
      '100%': { transform: 'scale(1)' },
    },
  },
}

๐ŸŽฏ Custom Habit Categories

// src/components/HabitForm.tsx
const CATEGORIES = [
  'Your Custom Category',
  'Health & Fitness',
  // ... existing categories
];

๐ŸŽจ Color Themes

// src/components/HabitForm.tsx
const COLORS = [
  '#YourColor',
  '#EF4444', // Red
  // ... existing colors
];

๐Ÿ“Š Analytics Features

๐Ÿ“ˆ Progress Tracking

  • Daily Completion Rates - Track daily progress
  • Weekly Charts - Bar charts for weekly view
  • Monthly Trends - Line charts for long-term trends
  • Streak Analytics - Current vs. longest streaks
  • Category Performance - Habits by category

๐Ÿ† Achievement System

  • Streak Milestones - Celebrate consistency
  • Completion Badges - Perfect day rewards
  • Progress Celebrations - Confetti animations
  • Motivational Quotes - Daily inspiration

๐Ÿ”’ Data & Privacy

๐Ÿ’พ Local Storage

  • IndexedDB - All data stored locally
  • No Cloud Sync - Complete privacy
  • Export/Import - Data portability
  • Offline First - Works without internet

๐Ÿ›ก๏ธ Security

  • Client-Side Only - No server dependencies
  • No Tracking - No analytics or tracking
  • Open Source - Transparent codebase
  • Self-Hosted - Deploy anywhere

๐Ÿš€ Deployment

๐Ÿ“ฆ Build for Production

npm run build

๐ŸŒ Deploy to Netlify

# Build the project
npm run build

# Deploy dist folder to Netlify
# Or connect your GitHub repo for auto-deployment

๐Ÿ”ง Deploy to Vercel

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod

๐Ÿณ Docker Deployment

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "preview"]

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/amazing-feature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add amazing feature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/amazing-feature)
  5. ๐Ÿ”„ Open a Pull Request

๐Ÿ› Bug Reports

  • Use GitHub Issues for bug reports
  • Include steps to reproduce
  • Provide browser/device information

๐Ÿ’ก Feature Requests

  • Describe the feature in detail
  • Explain the use case
  • Consider implementation complexity

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • React Team - For the amazing React framework
  • Tailwind CSS - For the utility-first CSS framework
  • Lucide - For the beautiful icon set
  • Chart.js - For the powerful charting library
  • Workbox - For PWA capabilities
  • Pexels - For high-quality stock images

๐Ÿ“ž Support & Community

๐ŸŒŸ Roadmap

๐Ÿ”ฎ Upcoming Features

  • Habit Templates - Pre-built habit suggestions
  • Social Features - Share progress with friends
  • Advanced Analytics - ML-powered insights
  • Habit Chains - Link related habits
  • Custom Themes - User-created color schemes
  • Voice Commands - Hands-free habit logging
  • Wearable Integration - Smartwatch support

๐ŸŽฏ Version 2.0 Goals

  • Cloud Sync - Optional cloud backup
  • Team Habits - Collaborative habit tracking
  • API Integration - Connect with fitness apps
  • Advanced Notifications - Smart reminder system

๐ŸŒŸ Star this repository if it helped you build better habits! ๐ŸŒŸ

Made with โค๏ธ and dedication to helping people build better lives

GitHub stars GitHub forks GitHub issues

Transform your life, one habit at a time with HabitFlow ๐Ÿš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published