FocusFarm
A webcam-based focus app that rewards sustained attention with a growing pixel-art farm.
Why We Built This


Caught mid-game of Plants vs. Zombies in class — exhibit A for why this app needed to exist.
I get distracted constantly when I'm supposed to be working, ADHD-adjacent, if not full ADHD. But somehow I can lock in for hours on a farm game where I'm just collecting stuff.
SO — why can't we just gamify boring work and study, and make it rewarding by the end of the day?
Technical Stack
Frontend & Detection
- React
- Next.js
- MediaPipe / TensorFlow.js
- Webcam-based attention tracking
Data & Progression
- Coin economy
- Pixel farm rendering
- Local storage — MVP
- Supabase/Firebase — planned
Deployment & CI
- Vercel — auto-deploy on push
- GitHub Actions — CI on every PR
Detection Pipeline
How FocusFarm decides whether you're focused. Detection, scoring, and coin rewards all run client-side in the browser, with progress saved to local storage.
Sense
Face Landmarks
MediaPipe FaceLandmarker tracks the face on every new webcam frame.
Raw Signals
Head pose (yaw and pitch, corrected for tilt), eye openness, and iris gaze.
Decide
Calibration
A quick eye check sets each person's own "eyes closed" threshold, and a 3-second onboarding saves their neutral pose. Smoothing runs on time, not frame count, so 30 and 60 fps behave the same.
Soft Scoring
Eyes, head angle, and gaze each score 0 to 1. The focus score is the lowest of the three, which also names the reason: eyes closed, head turned, or looking away.
Focus State
Two thresholds instead of one, so the state doesn't flicker back and forth.
Reward
Coin Rewards
The focus score is added up every second, so half-focus earns half credit, then turned into coins with a tier multiplier from 0.5× to 2×.
Why the state doesn't flicker
What's Next
• Unlockable farmland — new plots open up as focus hours accumulate
• Tiered animals and buildings gated behind farm level, not just coins
• A progression system with milestones, not just a flat shop
• Seasonal or rotating decorations to keep long-term use engaging
• Streak-based multipliers that reward consistency, not just single sessions
• A leaderboard, once there's a real progression system worth comparing
































