A gamified habit tracker built with React, Vite, and Tailwind CSS. It helps you build and maintain habits by tracking completion, streaks, and progress — complete with a character progression system and analytics.
- Create, edit, and complete habits
- Track streaks and habit history
- Gamified Character System that progresses with your habits
- Visual analytics and charts (built with
recharts) - Data persistence using
localStorageviahooks/useLocalStorage.js - Responsive UI with Tailwind CSS and subtle animations via
framer-motion
- Getting Started
- Available Scripts
- Project Structure
- Development Notes
- Contributing
- Roadmap & Known Issues
- License
Prerequisites:
- Node.js (LTS recommended)
- npm or yarn
Install dependencies:
npm install
# or
# yarnRun the dev server:
npm run devOpen http://localhost:5173 to view the app.
Build for production:
npm run buildPreview production build locally:
npm run previewLint the project:
npm run lintdev- Run Vite dev serverbuild- Create a production buildpreview- Preview the production build locallylint- Run ESLint across the project
A quick overview of the key files and folders:
index.html— App entry HTMLsrc/main.jsx— App entry pointsrc/App.jsx— Root app componentsrc/index.css— Tailwind + base stylessrc/components/— React componentsAnalytics.jsx— Charts & analytics viewsCharacter.jsx&CharacterSystem.jsx— Gamification logic and UIHabitList.jsx— Add/edit/complete habitsJourney.jsx— Progress/journey viewSettings.jsx— App settings
src/hooks/useLocalStorage.js— Custom hook for persistent statesrc/utils/dateUtils.js— Date helpers & calculationssrc/assets/— Static assets and character images
- Data is stored in
localStorageusinguseLocalStorage. To switch persistence strategies, replace the hook implementation. - Analytics charts are implemented with
rechartsand read from the stored habits data. - Tailwind configuration is in
tailwind.config.js— modify it to change themes or extend utilities. - For animations and transitions, the project uses
framer-motion.
Tips:
- To add a new feature, create or update a component in
src/components/, add styles in Tailwind as utilities or classes, and add tests if applicable. - Keep logic that manipulates dates centralized in
src/utils/dateUtils.jsto avoid inconsistencies.
Contributions are welcome! Please open an issue to discuss major changes before submitting a PR.
Guidelines:
- Fork the repo and create a feature branch
- Keep commits focused and descriptive
- Run
npm run lintand ensure code follows project style
Planned improvements:
- Add import/export of habit data (JSON)
- Cross-device sync via optional backend or third-party sync
- Add unit and integration tests
- Accessibility improvements
If you notice a bug or have a suggestion, please open an issue.
There is currently no license file in this repository. If you want to add one, consider using the MIT License.
If you have questions, open an issue or submit a pull request. Thanks for checking out this project — happy habit building! 🎯