Skip to content

mrpawarGit/DailyPulse-Frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌟 DailyPulse - Personal Wellness & Habit Tracker

A modern, responsive habit tracking application built with React, TypeScript, and Tailwind CSS. Track your daily habits, log your mood, visualize your progress, and build lasting streaks.

DailyPulse Banner React TypeScript License

πŸ“₯ Backend Repository

πŸš€ Live Demo β†’ Visit DailyPulse

image

✨ Features

Core Features

  • 🎯 Habit Management: Create, edit, delete, and track both boolean and countable habits
  • πŸ“Š Analytics Dashboard: Visualise weekly trends, category breakdowns, and mood patterns
  • 😊 Mood Tracking: Log daily moods with emoji-based interface
  • πŸ”₯ Streak Counter: Maintain and visualize your consistency streaks
  • πŸ’ͺ Progress Tracking: Real-time progress rings and completion percentages
  • πŸ’‘ Motivational Quotes: Daily inspiration to keep you going

UI/UX Features

  • πŸŒ“ Dark/Light Mode: Seamless theme switching with persistent preferences
  • πŸ“± Fully Responsive: Works beautifully on mobile, tablet, and desktop
  • 🎨 Custom Color Themes: 8 color options for habit categorization
  • ⚑ Fast Performance: Optimized with React 19 and Vite
  • πŸ”’ Authentication Flow: Complete landing, login, and signup pages
  • πŸ” Mobile Navigation: Hamburger menu for seamless mobile experience

Data Features

  • πŸ’Ύ Local Storage: Automatic data persistence
  • πŸ“ˆ Recharts Integration: Beautiful, interactive charts and graphs
  • πŸ“… Date Management: Smart date handling with date-fns
  • πŸ”„ Real-time Updates: Instant UI updates on data changes

πŸ› οΈ Tech Stack

Technology Version Purpose
React 19.2.0 UI Library
TypeScript 5.8.2 Type Safety
Vite 6.2.0 Build Tool & Dev Server
React Router DOM 6.28.0 Client-side Routing
Tailwind CSS Latest Utility-first CSS
Recharts 3.3.0 Data Visualization
date-fns 4.1.0 Date Utilities
Lucide React 0.548.0 Icon Library

πŸ“¦ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher (comes with Node.js)
  • Git: For cloning the repository

Check your versions:

node --version
npm --version
git --version

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/mrpawarGit/DailyPulse-Frontend.git
cd dailypulse-react-app

2. Install Dependencies

npm install

This will install all required packages listed in package.json.

βš™οΈ Configuration

Environment Variables

Create a .env file in the root directory:

# API Configuration
VITE_API_URL=http://localhost:3000/api

# Optional: Analytics
VITE_GEMINI_API_KEY=your_gemini_api_key_here

Port Configuration

The app runs on port 5000 by default. To change it, edit vite.config.ts:

export default defineConfig({
  server: {
    port: 5000, // your desired port
    host: '0.0.0.0',
  },
  // ... rest of config
});

πŸƒβ€β™‚οΈ Running the Application

Development Mode

Start the development server with hot-reload:

npm run dev

The app will be available at: http://localhost:5000

Production Build

Build the app for production:

npm run build

Preview the production build:

npm run preview

πŸ“ Project Structure

dailypulse-frontend/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ analytics/
β”‚   β”‚   └── Analytics.tsx           # Analytics dashboard with charts
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx          # Login page
β”‚   β”‚   └── SignupPage.tsx         # Signup page
β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.tsx     # Loading indicator
β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx            # Navigation sidebar
β”‚   β”‚   └── ThemeToggle.tsx        # Theme toggle button
β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx          # Main dashboard
β”‚   β”‚   β”œβ”€β”€ MoodSelector.tsx       # Mood selection component
β”‚   β”‚   β”œβ”€β”€ MotivationalQuote.tsx  # Quote display
β”‚   β”‚   β”œβ”€β”€ ProgressRing.tsx       # Circular progress indicator
β”‚   β”‚   └── StreakCounter.tsx      # Streak display
β”‚   β”œβ”€β”€ habits/
β”‚   β”‚   β”œβ”€β”€ HabitCard.tsx          # Individual habit card
β”‚   β”‚   └── HabitForm.tsx          # Habit creation/edit modal
β”‚   β”œβ”€β”€ landing/
β”‚   β”‚   └── LandingPage.tsx        # Marketing landing page
β”‚   └── MainApp.tsx                # Main authenticated app wrapper
β”œβ”€β”€ context/
β”‚   └── ThemeContext.tsx           # Dark/Light mode context
β”œβ”€β”€ hooks/
β”‚   └── useMindTrack.ts            # Main application logic hook
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ api.ts                     # API service layer
β”‚   └── mockApi.ts                 # Mock API for development
β”œβ”€β”€ types.ts                       # TypeScript type definitions
β”œβ”€β”€ App.tsx                        # App root with routing
β”œβ”€β”€ index.tsx                      # Application entry point
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ logo.svg                   # Application logo
β”‚   └── vercel.json                # Vercel configuration
β”œβ”€β”€ .env                           # Environment variables
β”œβ”€β”€ .gitignore
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tailwind.config.js
└── README.md

πŸ“œ Available Scripts

Command Description
npm run dev Start development server on port 5000
npm run build Build for production
npm run preview Preview production build locally

πŸ”Œ Backend Integration

This frontend works with the DailyPulse backend API.

Backend Repository: DailyPulse-Backend

Authentication Flow

The app uses JWT tokens for authentication:

  1. User logs in β†’ receives JWT token
  2. Token stored in localStorage
  3. Token sent in Authorization: Bearer <token> header for protected routes
  4. Token expires after 7 days (configurable in backend)

API Endpoints Used

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • GET /api/habits - Get all habits
  • POST /api/habits - Create new habit
  • PUT /api/habits/:id - Update habit
  • DELETE /api/habits/:id - Delete habit
  • POST /api/logs - Log habit progress
  • POST /api/moods - Log daily mood

🧩 Components Overview

Core Components

Dashboard Components:

  • Dashboard.tsx - Main view with habit cards, streak, and mood selector
  • HabitCard.tsx - Interactive card for each habit with progress tracking
  • ProgressRing.tsx - SVG-based circular progress indicator
  • StreakCounter.tsx - Fire emoji with streak count

Analytics Components:

  • Analytics.tsx - Complete analytics view with multiple charts
  • Uses Recharts for LineChart, BarChart visualizations

Authentication:

  • LandingPage.tsx - Marketing page with features
  • LoginPage.tsx - Login form with validation
  • SignupPage.tsx - Registration form with validation

Common:

  • Sidebar.tsx - Responsive navigation sidebar with user profile
  • ThemeToggle.tsx - Floating theme toggle button
  • LoadingSpinner.tsx - Loading state indicator

Custom Hooks

useDailyPulse - Main application logic:

  • Manages habits, logs, streaks
  • Calculates completion percentages
  • Handles mood tracking
  • Provides analytics data
  • Syncs with localStorage

🎨 Styling

Tailwind CSS

The app uses Tailwind CSS with custom configuration:

Key Classes:

  • Dark mode: dark:bg-gray-900, dark:text-white
  • Responsive: md:grid-cols-2, lg:grid-cols-3
  • Custom colors: Blue theme (bg-blue-600)

Theme System

Light/Dark mode implemented via:

  • Context API (ThemeContext.tsx)
  • LocalStorage persistence
  • System preference detection
  • Smooth transitions
  • Floating toggle button on all pages

Color Palette

Habits can use 8 colors:

  • Blue, Green, Red, Yellow
  • Purple, Indigo, Pink, Gray

🚒 Deployment

Deployed on Vercel

The application is deployed and live at: https://daily-pulse-app.vercel.app/

Deploy Your Own

Deploy with Vercel

Steps to deploy:

  1. Fork this repository
  2. Import to Vercel:
    • Go to vercel.com
    • Click "Import Project"
    • Select your forked repository
  3. Configure Environment Variables:
    VITE_API_URL=your_backend_api_url
    
  4. Deploy!

Vercel Configuration

The vercel.json file is included for proper routing:

{
  "rewrites": [
    {
      "source": "/(.*)",
      "destination": "/index.html"
    }
  ]
}

This ensures React Router works correctly with page refreshes.

Code Style

  • Use TypeScript for type safety
  • Follow React best practices
  • Use functional components with hooks
  • Keep components small and focused
  • Add comments for complex logic
  • Write meaningful commit messages

πŸ› Known Issues

None at the moment! If you find any bugs, please open an issue.

πŸ‘₯ Authors

Mayur Pawar - @mrpawarGit

Akash Pandit - @Akashpandit01

πŸ™ Acknowledgments

πŸ—ΊοΈ Roadmap

  • Core habit tracking
  • Mood logging
  • Analytics dashboard
  • Dark/Light theme
  • Mobile responsive design
  • Deployment to Vercel
  • Backend API integration
  • Social features (friends, leaderboard)
  • Push notifications
  • AI-powered habit suggestions
  • Export data to CSV/PDF
  • Integration with wearables

πŸ“Š Project Stats

GitHub stars GitHub forks GitHub issues


Built using React + TypeScript + Vite

About

A modern, responsive habit tracking application built with React, TypeScript, and Tailwind CSS. Track your daily habits, log your mood, visualise your progress, and build lasting streaks.

Topics

Resources

Stars

Watchers

Forks

Contributors