Personal productivity hub that combines Tasks, Habits, Pomodoro, XP gamification, Analytics, and an AI Assistant. Built with React, Redux Toolkit, Dexie (IndexedDB), Firebase Auth/Firestore, Recharts, and Tailwind-like utility classes.
- Tasks and Habits with local persistence (IndexedDB via Dexie)
- XP system with levels and history; XP persists automatically
- Pomodoro timer with accurate countdown, auto-advance, logging, and keyboard shortcuts
- Analytics dashboard: trends, completion, difficulty, XP progress, Pomodoro stats
- AI Assistant sidebar powered by a Netlify Function calling Gemini, personalized with Firestore data
- Google Sign-In; automatic sync from IndexedDB to Firestore per user
- Daily habit reset stored in
appMeta
- React 19, React Router, Redux Toolkit, React-Redux
- Dexie for IndexedDB, Firebase Auth + Firestore
- Recharts for charts
- Netlify Functions for serverless Gemini calls
src/componentsUI and featuresTaskManager,HabitManager,Pomodoro,analytics/*,AIAgentSidebar,Header,Sidebarroutes/AllRoutes.jsmain routing
src/components/indexedDB/*Dexie schema and data access (tasks, habits, xp, pomodoro, history, appMeta)src/components/store/*Redux slices and middlewaressrc/firebase/*Firebase initialization, AI service, and syncsrc/netlify/functions/gemini.jsNetlify serverless function
Prereqs: Node 18+, npm, a Firebase project, and an API key for Gemini.
- Install
npm install
- Environment variables
Create
.envin project root with:
REACT_APP_FIREBASE_API_KEY=your_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID=your_project
REACT_APP_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=...
REACT_APP_FIREBASE_APP_ID=1:...:web:...
# Netlify function (server-side) env var
GEMINI_API_KEY=your_gemini_api_key
- Run dev server
npm start
App runs at http://localhost:3000.
- Local persistence: Redux writes to Dexie via
indexedDB/*helpers andxpPersistenceMiddleware - Auto sync:
dataSyncMiddlewaredebounces POSTing all IndexedDB data to a local server (/sync-data) andfirebase_sync.jssaves to Firestore when authenticated - Daily habit reset:
App.jschecksappMeta.lastHabitResetand clearscompletedeach day - AI Assistant:
AIAgentSidebar→firebase/AiService.askGemini→ Netlify functiongemini.js(Gemini API). Responses can reflect user’s Firestore data
Single-file component with:
- Modes: focus/short/long; auto-advance and cycles
- Accurate countdown using end-time math (no drift)
- Start/Pause/Reset/Skip; Space/R/S shortcuts
- Optional sound + desktop notifications
- Logs each session to IndexedDB and Redux, enabling analytics
Located in src/components/analytics/* and includes:
- Task completion and difficulty charts
- Habit trend and type charts
- XP radial + progress charts (persisted in
xpandxpHistory) - Pomodoro daily and by-mode charts
src/firebase/config.jsinitializes Firebase (Auth + Firestore) from env vars- Google Sign-In in
Headercomponent; auth state stored inlocalStorage firebase_sync.jsconsolidates IndexedDB tables and writes them tousers/{uid}in Firestore
dataSync.js can POST your IndexedDB snapshot to a local server at http://localhost:8000/sync-data and GET from /data. This is optional. If unused, calls will fail harmlessly in console.
netlify.tomlsets build and functions dir:src/netlify/functions- Set
GEMINI_API_KEYin your Netlify site Environment Variables - Deploy steps:
- Push to GitHub
- Connect repo in Netlify
- Add env vars (React +
GEMINI_API_KEY) - Trigger build
npm start # run CRA dev server
npm run build # production build to /build
npm test # jest/react-testing-library (if tests added)
- Ensure Firestore security rules restrict access to a user’s own document
- Replace the inline audio placeholder in
Pomodoro.jsif desired - Frames in
public/Framesare used inHeaderand unlock by XP level