FocusFlow

Plan meaningful work. Protect your attention. Ente

Visit Repo
FocusFlow banner

About

## The problem it solves

The Problem It Solves

Deep work today is fragmented across half a dozen disconnected tools—a timer in one tab, a to-do list in another, YouTube or Spotify open for background noise (which itself becomes a distraction), and separate browser extensions for blocking distracting sites. Worse, many productivity apps require mandatory sign-ups, upload sensitive browsing and work habits to third-party servers, or stop working the moment your internet connection drops.

FocusFlow solves this by unifying structured focus timing, distraction shielding, task planning, procedural ambient audio, and habit analytics into a single offline-first, privacy-respecting workspace—paired with a Manifest V3 Chrome Extension.

What People Can Use FocusFlow For

Deep Work & Coding Sessions: Set a concrete session goal, pick a focus profile, block distracting domains (like social media or news feeds), and work uninterrupted with a live countdown and gentle drift check-ins. Studying & Exam Preparation: Plan daily focus blocks, break large assignments into tasks and subtasks, and review 10-week consistency heatmaps and weekly reports to build a steady study routine. Writing, Research & Creative Flow: Capture sudden ideas in the in-session scratchpad without leaving your workspace or losing focus—then convert those notes directly into actionable tasks afterward. Distraction-Free Acoustic Masking: Mask background noise using locally synthesized procedural soundscapes (Rain & Soft Thunder, 40Hz Gamma Binaural, Brown Noise, and custom mixes) generated via the Web Audio API. How FocusFlow Makes Existing Tasks Easier & Safer Eliminates Tab Switching & Audio Temptation: Instead of opening YouTube or streaming sites for study music—where one click leads to a 20-minute detour—FocusFlow synthesizes ambient audio directly in your browser with zero ads, buffering, or external requests. Gentle Shielding Without Rigid Lockouts: Website blocking supports subdomain matching, whitelisting, master toggles, gentle nudges when you drift, and an emergency override so you stay in control during urgent situations. Privacy-First & Offline-First by Default: No forced accounts and zero telemetry. Your tasks, session history, and blocker rules stay locally on your machine (via IndexedDB / Chrome Storage), with versioned backup/restore validation so your data is portable and safe. Optional Cloud Sync with Row-Level Security: When Supabase is configured, users can optionally sync their workspace across devices protected by PostgreSQL Row-Level Security (RLS) policies. Unified Web App + Chrome Extension: Use the full web workspace (installable as a standalone PWA) for planning and analytics, while the lightweight Chrome Extension enforces blocking rules and tracks timers in the background.

## Challenges we ran into

Challenges I Ran Into

1. Deterministic Timer State Across Browser & Service Worker Suspensions The Hurdle: Standard setInterval-based timers drift or freeze whenever a laptop goes to sleep or a Chrome Manifest V3 background service worker suspends. In early testing, resuming after a long pause or suspension risked negative remaining times, missed expiries, or duplicate session-completion rewards.

How I Solved It:

Rebuilt the core timer around wall-clock timestamps rather than tick counters, adding non-negative clamping, clock-skew safety, concurrency guards against rapid double-clicks, and idempotent completion checks. All edge cases—including pausing at 1 second left and expiring during suspension—are covered by a 16-stage automated test suite (tests/engine.test.ts).

2. Web Audio Procedural Soundscape Lifecycle (Map vs. Set Runtime Bug) The Hurdle: FocusFlow synthesizes ambient audio (rain, 40Hz gamma binaural beats, brown noise) locally using the Web Audio API instead of streaming MP3s. While wiring up multi-track mixing in src/services/audio.ts, switching presets threw a runtime TypeError: this.activeTracks.add is not a function because activeTracks was a Map storing active audio nodes while a helper called .add().

How I Solved It:

Unified track registration and teardown around Map.set() / Map.delete(), ensuring every Web Audio oscillator and noise buffer is cleanly disconnected and garbage-collected when muted or switched.

3. Dual-Target Bundling (PWA Web App + Chrome Extension MV3) The Hurdle: Sharing one codebase between a modern React/Vite web app and a Chrome Manifest V3 extension introduced bundling conflicts—specifically, MV3 content scripts cannot load ES module chunks the way a normal web page does. On top of that, deploying on newer npm (v11+) environments flagged esbuild postinstall scripts used by both vite and tsx.

How I Solved It:

Split the build into a two-step pipeline (vite build for the web app, dashboard, popup, and background worker, followed by vite build --config vite.content.config.ts to emit a self-contained dist/content.js), and configured allowScripts in package.json for clean CI/Vercel builds.

Screenshots

FocusFlow screenshot 1FocusFlow screenshot 2FocusFlow screenshot 3FocusFlow screenshot 4FocusFlow screenshot 5

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

FocusFlow

Build better habits. Stay focused. Transform your routine with FocusFlow — the ultimate digital habit builder.