Distraction Tracker for Developers
An open-source productivity tool that helps developers track coding sessions, monitor distracting websites, and calculate a focus score based on browsing activity.
DevFocus helps you stay accountable by:
- Tracking browsing activity during coding sessions
- Categorizing websites as productive, distracting, or neutral
- Calculating a focus score based on where you spend your time
- Visualizing analytics in a dashboard with charts and insights
| Feature | Description |
|---|---|
| Session Management | Start and end coding sessions with a single click |
| Tab Tracking | Browser extension monitors active tabs and URL changes |
| Website Categorization | Automatic classification (GitHub, Stack Overflow = productive; YouTube, Instagram = distracting) |
| Focus Score | (Productive Time / Total Time) × 100 |
| Analytics Dashboard | View session history, pie charts, and recent activity |
┌─────────────────────┐
│ Browser Extension │ Chrome (Manifest v3)
│ Track Tab Activity │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Backend API │ Node.js + Express
│ Store & Calculate │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Supabase │ PostgreSQL
│ (Database) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Frontend Dashboard │ React + Tailwind + Chart.js
│ View Analytics │
└─────────────────────┘
| Layer | Technology |
|---|---|
| Frontend | React, Tailwind CSS, Chart.js, React Router |
| Backend | Node.js, Express.js |
| Database | Supabase (PostgreSQL) |
| Extension | Chrome Extension API (Manifest v3) |
DevFocus/
├── backend/ # Express API server
│ ├── server.js
│ ├── config/
│ │ └── supabase.js
│ ├── controllers/
│ │ └── sessionController.js
│ └── routes/
│ └── sessionRoutes.js
│
├── frontend/ # React dashboard
│ └── src/
│ ├── components/
│ ├── pages/
│ └── App.jsx
│
├── extension/ # Chrome extension
│ ├── manifest.json
│ ├── background.js
│ ├── popup.html
│ └── popup.js
│
├── SETUP_GUIDE.md # Detailed implementation guide
└── README.md
- Node.js (v18+)
- npm or yarn
- Chrome browser
- Supabase account (supabase.com)
git clone https://github.com/vishnandaman/DevFocus.git
cd DevFocus- Create a project at supabase.com
- Run the SQL from SETUP_GUIDE.md to create
sessionsandactivitiestables - Copy your Project URL and anon key from Settings → API
cd backend
npm install
cp .env.example .env # Create .env and add SUPABASE_URL, SUPABASE_ANON_KEY, PORT
node server.jsServer runs at http://localhost:5000.
cd frontend
npm install
npm run devDashboard runs at http://localhost:5173 (or your Vite port).
- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the
extensionfolder - Click Start Session in the popup to begin tracking
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/session/start |
Start a new coding session |
POST |
/api/activity |
Track browsing activity |
POST |
/api/session/end |
End session & calculate focus score |
GET |
/api/session/:id |
Get session analytics |
GET |
/api/session/:id/activities |
Get activities for a session |
See SETUP_GUIDE.md for request/response formats.
Productive: GitHub, Stack Overflow, MDN, LeetCode, ChatGPT, etc.
Distracting: YouTube, Instagram, Twitter, Netflix, Reddit, etc.
Neutral: Everything else
Focus Score = (Productive Time / Total Time) × 100
Example: 90 min productive + 30 min distracting → Score = 75%
- SETUP_GUIDE.md – Step-by-step implementation, database schema, troubleshooting
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source. See LICENSE for details.
Built with ❤️ for developers who want to stay focused.