DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Project 1: The Performance-First Dashboard
  • Project 2: Accessible Video Player
  • Project 3: Markdown Blog Engine
  • Project 4: Browser-Based Code Editor
  • Project 5: Multi-Tab Whiteboard
  • Project 6: Infinite Scroll Image Gallery
  • Project 7: Recipe Optimizer & Converter
  • Project 8: Budget Tracker with Charts
  • Project 9: Typing Speed Test
  • Project 10: Weather App with Time-Travel
  • Project 11: CSS Grid Layout Builder
  • Project 12: Password Vault (Frontend Only)
  • Project 13: Kanban Board (Trello Clone)
  • Project 14: Quiz App with Leaderboard
  • Project 15: Habit Tracker (GitHub Style)
  • Project 16: E-commerce Product Page
  • Project 17: Unit Converter (Expert Mode)
  • Project 18: Music Visualizer
  • Project 19: Flashcard Learning App
  • Project 20: Custom Form Validator
  • Project 21: Virtual Terminal
  • Project 22: Pomodoro Timer (Focus Pro)
  • Project 23: SVG Path Editor
  • Project 24: Movie Database Matchmaker
  • Project 25: Interactive Resume / Portfolio
  • Project 26: Recipe Scraper UI
  • Project 27: Crypto Tracker (Real-Time)
  • Project 28: Find My Pet (PWA)
  • Project 29: Markdown-to-Slide Tool
  • Project 30: Browser Health Dashboard
← From Beginner to Expert in Fundamentals of Frontend

Project 22: Pomodoro Timer (Focus Pro)

35 min read
Notification APITimer PrecisionState MachinesAudio PlaybackSession AnalyticsProductivity UX

📋 Project Brief

Build a Pomodoro productivity timer with browser notifications, ambient sound integration, session logging, and a distraction counter. This project focuses on timer precision, the Notification API, and building tools that support the "flow state."

✅ Feature Requirements

Feature 1: Browser Notifications

Acceptance Criteria:

  • When a Pomodoro ends, trigger a browser notification even if the tab is in the background
  • Request notification permission on first use
  • Notification title: "⏰ Time's Up!"; body: "Take a 5-minute break" (or "15-minute break")
  • Handle "Permission Denied" gracefully — fall back to an in-page alert + sound

Feature 2: Session Logs

Acceptance Criteria:

  • Track how many Pomodoros were completed today, this week, and all-time
  • A daily log shows: start time, end time, duration, and task label for each session
  • A weekly bar chart visualizes Pomodoros per day
  • Data persists in localStorage

Feature 3: Ambient Sound

Acceptance Criteria:

  • Built-in ambient sounds: Rain, Coffee Shop, White Noise, Forest, Lo-fi Beats
  • Sound plays during work sessions and auto-pauses during breaks (configurable)
  • Volume slider independent of system volume
  • Sound loops seamlessly without audible gaps

Feature 4: Custom Intervals

Acceptance Criteria:

  • Default: 25-min work / 5-min short break / 15-min long break (every 4 Pomodoros)
  • All intervals adjustable via a settings panel
  • Settings persist in localStorage
  • A "Preset" system: "Classic (25/5/15)", "Short (15/3/10)", "Long (50/10/20)"

Feature 5: Distraction Counter

Acceptance Criteria:

  • A floating "I got distracted" button the user clicks whenever they lose focus
  • Distractions are logged per session with timestamps
  • End-of-session summary shows: "Focus score: X distractions in 25 minutes"
  • Historical trend: "Your average distractions per session is decreasing 📉"

📊 Timer State Machine

StateDescriptionTransitions To
idleNo timer runningworking (on Start)
workingFocus timer counting downshort_break, long_break (on complete), idle (on Reset)
short_break5-min break timerworking (on complete or Skip)
long_break15-min break (every 4th cycle)working (on complete or Skip)
pausedTimer frozenPrevious state (on Resume)

🧪 Testing Checklist

  • Unit test timer accuracy (mock Date.now for predictable tests)
  • Unit test state machine transitions
  • Unit test session logging and statistics calculations
  • Integration test: completing 4 Pomodoros triggers a long break
  • A11y: timer value announced to screen readers; notification fallback works

🚀 Stretch Goals

  • Add task labels: associate each Pomodoro with a specific task
  • Implement "Focus Mode" that blocks distracting URLs (browser extension)
  • Add Spotify integration to play a focus playlist
  • Create a widget that floats on the desktop (PWA)

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.