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 Backend API - https://github.com/mrpawarGit/DailyPulse-Backend
π Live Demo β Visit DailyPulse
- π― 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
- π 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
- πΎ 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
| 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 |
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
git clone https://github.com/mrpawarGit/DailyPulse-Frontend.git
cd dailypulse-react-app
npm install
This will install all required packages listed in package.json.
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
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
});
Start the development server with hot-reload:
npm run dev
The app will be available at: http://localhost:5000
Build the app for production:
npm run build
Preview the production build:
npm run preview
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
| Command | Description |
|---|---|
npm run dev |
Start development server on port 5000 |
npm run build |
Build for production |
npm run preview |
Preview production build locally |
This frontend works with the DailyPulse backend API.
Backend Repository: DailyPulse-Backend
The app uses JWT tokens for authentication:
- User logs in β receives JWT token
- Token stored in localStorage
- Token sent in
Authorization: Bearer <token>header for protected routes - Token expires after 7 days (configurable in backend)
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginGET /api/habits- Get all habitsPOST /api/habits- Create new habitPUT /api/habits/:id- Update habitDELETE /api/habits/:id- Delete habitPOST /api/logs- Log habit progressPOST /api/moods- Log daily mood
Dashboard Components:
Dashboard.tsx- Main view with habit cards, streak, and mood selectorHabitCard.tsx- Interactive card for each habit with progress trackingProgressRing.tsx- SVG-based circular progress indicatorStreakCounter.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 featuresLoginPage.tsx- Login form with validationSignupPage.tsx- Registration form with validation
Common:
Sidebar.tsx- Responsive navigation sidebar with user profileThemeToggle.tsx- Floating theme toggle buttonLoadingSpinner.tsx- Loading state indicator
useDailyPulse - Main application logic:
- Manages habits, logs, streaks
- Calculates completion percentages
- Handles mood tracking
- Provides analytics data
- Syncs with localStorage
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)
Light/Dark mode implemented via:
- Context API (
ThemeContext.tsx) - LocalStorage persistence
- System preference detection
- Smooth transitions
- Floating toggle button on all pages
Habits can use 8 colors:
- Blue, Green, Red, Yellow
- Purple, Indigo, Pink, Gray
The application is deployed and live at: https://daily-pulse-app.vercel.app/
Steps to deploy:
- Fork this repository
- Import to Vercel:
- Go to vercel.com
- Click "Import Project"
- Select your forked repository
- Configure Environment Variables:
VITE_API_URL=your_backend_api_url - Deploy!
The vercel.json file is included for proper routing:
{
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}
This ensures React Router works correctly with page refreshes.
- 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
None at the moment! If you find any bugs, please open an issue.
Mayur Pawar - @mrpawarGit
Akash Pandit - @Akashpandit01
- Recharts for beautiful charts
- Lucide for icons
- Tailwind CSS for styling
- Vite for blazing fast build tool
- Vercel for hosting
- React and TypeScript communities for amazing tools
- 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
Built using React + TypeScript + Vite