A full-stack productivity app for tracking goals + habits and generating AI-assisted planning.
- Frontend: React (Vite)
- Backend: Node/Express + Sequelize (MySQL)
- AI: Google Gemini via
@google/generative-ai
Note:
src/context/AuthContext.jsxcurrently runs in offline/guest mode (it bypasses backend token validation and saves app state tolocalStorage). The backend remains available and is used by the AI endpoints.
- Landing page → Login / Register
- Sidebar navigation
- Dark/light mode
- Command palette (
Ctrl+K) for quick navigation
- Goals: stored as a structured JSON object by period (daily/weekly/yearly)
- Habits: list of habits with per-date completion
- History + streaks: streak logic is derived from completed dates in
AppContext
- Daily briefing:
POST /api/ai/briefing - Strategic goal generator / planner:
POST /api/ai/goal
src/components/UI views (Dashboard, Habits, Calendar, Analytics, Settings, etc.)context/AuthContext.jsx(auth + offline guest mode)AppContext.jsx(app state: goals, habits, history, briefing, etc.)
backend/server.jsExpress app bootstrap + DB syncroutes/auth.jsregister/login/verify endpoints (MySQL-backed)data.jsget/saveUserData(MySQL-backed)ai.jsAI endpoints
models/Sequelize models (User,UserData)services/aiService.jsGemini prompt + JSON parsing
middleware/authMiddleware.jsJWTprotectmiddleware
App.jsx- Chooses which view to render based on
viewfromAppContext - Shows login/register/landing when
useris null
- Chooses which view to render based on
AuthContext.jsx- In the current version, authentication is effectively offline:
- Any login/register/verify succeeds.
- A local
tracker_tokenis stored inlocalStorage. - A default
Guest Useris used.
- In the current version, authentication is effectively offline:
AppContext.jsx- Loads persisted state from
localStoragekey:tracker_app_data - Keeps state for:
goals,habits,history,isDarkMode,groups
- Updates
localStoragewith a debounce.
- Loads persisted state from
When the user generates or adjusts a strategic plan (see StrategicRoadmap.jsx):
- Frontend calls
fetch('http://localhost:5000/api/ai/goal', ...) - Backend
backend/routes/ai.jscalls:generateStrategicGoal(userInput, goalsData, options)
backend/services/aiService.js- Builds a prompt and requests Gemini (
gemini-1.5-flash→ fallback models) - Attempts to
JSON.parsethe response - Returns JSON to the frontend
- Builds a prompt and requests Gemini (
- Frontend maps response JSON into UI state and stores it locally.
- Node.js installed
- (Backend) MySQL running locally (only required if you plan to use MySQL-backed auth/data endpoints)
- (Backend) Gemini API key
From repo root:
npm install
npm run devBy default Vite serves on http://localhost:5173.
In backend/:
npm install
npm run devBackend runs on http://localhost:5000 by default.
Create backend/.env with at least:
PORT=5000JWT_SECRET=...GEMINI_API_KEY=...
If you want email verification + notifications to work:
EMAIL_USER=...EMAIL_PASS=...
If MySQL is not set up, server.js will log guidance, including creating the progress_tracker database.
- Use the sidebar to switch between:
- Dashboard
- Habit Tracker
- Calendar
- Yearly Goals (Master plan)
- Analytics
- Settings & Profile
- Strategic Roadmap
- Group Intelligence
- Press Ctrl+K
- Type to search/navigation
- Open Strategic Roadmap.
- Select a tab (Daily / Weekly / Yearly).
- Enter a goal description in AI Goal Architect.
- Click Generate Strategy.
- The app will display a structured plan (days + tasks). You can:
- Mark tasks complete
- Expand an objective
- Use SMART actions:
- ⚡️ Make it Easier (
simplify) - 🔥 Upgrade Difficulty (
upgrade) - 🗓️ Adjust Schedule (If Behind) (
catchup)
- ⚡️ Make it Easier (
- Daily briefing:
POST /api/ai/briefing- Body:
{ userData: { habits, goals, streak, ... } }
- Strategic goal:
POST /api/ai/goal- Body:
{ userInput, goalsData, adjustmentType?, currentPlan? }
Fields:
id(UUID)nameemail(unique)password(bcrypt hash)isVerifiedverificationCode
Fields (stored as JSON columns):
goals(nested structure by period)habits(array)history(array)isDarkMode(boolean)
-
Auth is offline right now
AuthContext.jsxcurrently bypasses backend token validation.- If you want real auth to work, you’ll need to:
- Call backend
/api/auth/loginand store the real JWT token - Update
AuthContext.jsxto validate via/api/auth/verify - Update
AppContext.jsxto load/save viabackend/routes/data.js
- Call backend
-
AI responses must stay JSON
aiService.jsexpects Gemini to return strict JSON.- It does a best-effort cleanup for markdown fences.
-
Keep frontend JSON mapping in sync
- The UI expects AI output like:
titledurationdays: [{ day, title, completed, tasks: [{ name, done }] }]
- The UI expects AI output like:
- Frontend:
npm run devnpm run buildnpm run lint
- Backend:
npm run dev(uses nodemon)
Ensure backend is running on http://localhost:5000.
Check:
backend/.envhasGEMINI_API_KEY- Response JSON parse failures (log will show the raw AI text)
Create DB:
CREATE DATABASE progress_tracker;Then restart backend.