A modern, minimal productivity web app for focus sessions with analytics, smart insights, and distraction tracking. Uses a Postgres backend for session storage.
- Timer, Stopwatch, and Deep Work modes
- Session tracking with focus score
- Smart insights (no external AI)
- Weekly sessions heatmap (LeetCode-style)
- Analytics dashboard (weekly trends, focus scores, subjects)
- Idle + tab visibility tracking
- Clean, modern UI with smooth animations
- React + Vite
- Node.js + Express
- Postgres (Supabase)
api/ # Vercel serverless entry
server/
app.js
db.js
routes/
middleware/
utils/
src/renderer/
app/
components/
hooks/
pages/
services/
styles/
npm install
Create .env in the project root:
PORT=4000
CORS_ORIGIN=http://localhost:5173
DATABASE_URL=postgresql://postgres.hmetouyremaililsxvtb:YOUR_PASSWORD@aws-1-ap-southeast-2.pooler.supabase.com:6543/postgres
Create .env.local for the frontend:
VITE_API_URL=http://localhost:4000
npm run server:dev
npm run dev
DATABASE_URLCORS_ORIGIN(your Vercel domain)VITE_API_URL(optional, your Vercel domain +/api)
vercel
- In Vercel, set
DATABASE_URL,CORS_ORIGIN, and optionallyVITE_API_URL. - Redeploy with
vercel --prod --force. - Confirm API health:
https://<your-app>.vercel.app/api/healthreturns{"ok":true}. - Save a session and verify:
- History updates
- Analytics refreshes
- Toast appears on save
- Optional: add preview env vars if you use preview deployments.
- Supabase pooler connection string is recommended for serverless.
- The heatmap uses last 4 weeks of session data.
Add screenshots here:
docs/screenshots/dashboard.pngdocs/screenshots/timer.pngdocs/screenshots/analytics.png