Focus. Track. Achieve.
LockIn is a browser extension that helps you stay focused during work sessions. It passively tracks your browsing, uses AI to classify each page visit as on-task or distraction, nudges you when you drift, and generates a detailed focus report when your session ends.
Focus score ring, metrics cards, color-coded session timeline, site breakdown, and AI-generated insights
+------------------+ +------------------+ +----------+
| Chrome Extension | <---> | FastAPI Backend | <---> | Neo4j |
| (Manifest V3) | HTTP | (Python 3.12) | Bolt | Graph DB |
+------------------+ +--------+---------+ +----------+
|
| HTTP
v
+------------------+
| RocketRide + |
| GPT-4o |
+------------------+
- Chrome Extension captures page visits, shows nudge overlays, manages session lifecycle
- FastAPI Backend ingests events, orchestrates classification and report generation
- Neo4j stores sessions, visits, sites, and their relationships as a graph
- RocketRide + GPT-4o classifies pages and analyzes focus patterns
- Start a focus session with a work goal
- Automatic page visit tracking on every tab load
- AI-powered classification: on-task, distraction, or ambiguous
- Nudge overlays when distracted (with "Go Back" to return to productive work)
- Focus report dashboard with score ring, timeline, site breakdown, and AI insights
- Natural language Q&A about your sessions
- Configurable API backend URL and nudge interval
| Component | Technology |
|---|---|
| Backend | Python 3.12, FastAPI |
| Database | Neo4j (graph DB with APOC + GDS) |
| AI/LLM | RocketRide, OpenAI GPT-4o |
| Frontend | Chrome Extension (Manifest V3) |
| Templates | Jinja2 |
| Deployment | Docker Compose |
- Python 3.12+
- Docker & Docker Compose
- Google Chrome
- RocketRide account (for AI classification)
- OpenAI API key
docker-compose up -dThis starts Neo4j on localhost:7474 (browser) and localhost:7687 (Bolt).
cd backend
cp .env.example .envEdit .env with your keys:
ROCKETRIDE_APIKEY=your-rocketride-key
ROCKETRIDE_OPENAI_KEY=your-openai-key
cd backend
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadBackend runs on http://localhost:8000. Verify with: curl http://localhost:8000/health
- Open
chrome://extensionsin Chrome - Enable Developer mode (toggle in top-right)
- Click Load unpacked and select the
frontend/directory - Pin the LockIn extension in the toolbar
Load the sample focus session to see the report dashboard without running a real session:
# From the project root
docker exec -i lockin-neo4j cypher-shell -u neo4j -p lockin2026 < backend/seed/mock_data.cypherOr open the Neo4j Browser at http://localhost:7474, log in with neo4j/lockin2026, and paste the contents of backend/seed/mock_data.cypher.
Then visit http://localhost:8000/report/demo-session-001 to see the sample report dashboard.
- Click the LockIn extension icon in Chrome
- Enter your work goal (e.g., "Fix auth bug in login flow")
- Click Start Task — tracking begins
- Browse normally. Every page load is captured and classified
- If you drift to a distraction, a nudge overlay appears after ~60 seconds
- Click End Session when done — a focus report opens in a new tab
- Review your focus score, timeline, top distractions, and AI insights
Click the gear icon in the popup header to open settings:
- API Base URL — Backend server address (default:
http://localhost:8000) - Nudge Interval — How often to check for distractions, 1-30 minutes (default: 1)
lockin/
backend/
app/
config.py # Environment settings
main.py # FastAPI app entry point
models/
events.py # Request/response Pydantic models
routers/
webhook.py # POST /webhook/save — event ingestion
nudge.py # GET /api/sessions/{id}/nudge
session.py # POST /end, GET /report (JSON)
report.py # GET /report/{id} (HTML dashboard)
query.py # POST /api/query — Q&A agent
services/
neo4j_service.py # Graph database operations
classifier.py # RocketRide classification pipeline
report_service.py# Metrics computation + AI patterns
query_service.py # RocketRide Q&A agent pipeline
templates/
report.html # Focus report dashboard template
pipelines/
classify_site.pipe # Site classification pipeline
query_agent.pipe # Q&A agent pipeline
seed/
mock_data.cypher # Demo session data
requirements.txt
frontend/
manifest.json # Chrome extension manifest (V3)
background.js # Service worker — event ingestion, nudges, sessions
content.js # Page scraper — extracts page context
overlay.js # Nudge overlay UI
popup.html # Extension popup UI
popup.js # Popup logic — idle/tracking states, timer
config.js # Shared configuration resolver
options.html # Settings page
options.js # Settings logic
docker-compose.yml # Neo4j service
| Method | Path | Description |
|---|---|---|
| POST | /webhook/save |
Ingest a page visit event |
| GET | /api/sessions/{id}/nudge |
Check if user is distracted |
| POST | /api/sessions/{id}/end |
End a focus session |
| GET | /api/sessions/{id}/report |
Get focus report (JSON) |
| GET | /report/{id} |
Focus report dashboard (HTML) |
| POST | /api/query |
Ask a question about sessions |
| GET | /health |
Service health check |
# 1. Start everything
docker-compose up -d
cd backend && cp .env.example .env # edit with your API keys
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload &
# 2. Load demo data
docker exec -i lockin-neo4j cypher-shell -u neo4j -p lockin2026 < seed/mock_data.cypher
# 3. View demo report
open http://localhost:8000/report/demo-session-001
# 4. Load extension: chrome://extensions → Developer Mode → Load Unpacked → select frontend/
# 5. Click LockIn icon → enter a task → Start Task → browse → End Session → see your reportHackathon project — HackWithChicago April 2026
