Skip to content

PomoBreak (pomodoro-app) is a lightweight Pomodoro timer built with React and Redux. The project explores UI/UX design, routing, state management, custom audio management, and test coverage for robust front-end development.

License

Notifications You must be signed in to change notification settings

joshl26/pomodoro-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PomoBreak - Modern Pomodoro Timer

Test Status Coverage License React Redux Bundle Size

A lightweight, feature-rich Pomodoro timer built with modern React patterns, Redux Toolkit, and comprehensive testing. Optimized for performance with a focus on clean architecture and developer experience.


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

PomoBreak is a production-ready Pomodoro timer application that demonstrates modern React development practices. Built as both a functional productivity tool and a learning resource, it showcases:

  • Clean Architecture - Separation of concerns with custom hooks and services
  • State Management - Redux Toolkit with memoized selectors
  • Performance - Code splitting, lazy loading, optimized re-renders (87KB gzipped)
  • Testing - Comprehensive test coverage (>80%) with Jest and React Testing Library
  • Type Safety - JSDoc annotations for IntelliSense support
  • Developer Experience - ESLint, Prettier, pre-commit hooks, CI/CD

Whether you're looking for a productivity tool or a reference implementation of React best practices, PomoBreak has you covered.


โœจ Features

Core Functionality

  • โฑ๏ธ Customizable Timers - Set durations for work sessions (25min), short breaks (5min), and long breaks (15min)
  • ๐Ÿ”„ Smart Cycles - Automatic progression through pomodoro โ†’ break cycles with long breaks every N cycles
  • โ–ถ๏ธ Auto-Start - Optional auto-start for breaks and pomodoros
  • โญ๏ธ Quick Navigation - Forward/backward buttons to skip between modes
  • ๐Ÿ”” Audio Notifications - Multiple alarm sounds with volume control and preview
  • ๐ŸŽต Optional Sounds - Ticking sound and button click feedback

Technical Highlights

  • ๐Ÿš€ Lazy Loading - Routes split into separate bundles, loaded on-demand
  • ๐Ÿงช 80%+ Test Coverage - Unit, integration, and component tests
  • ๐Ÿ“ฆ Tiny Bundle - Only 87KB gzipped (excellent!)
  • โ™ฟ Accessible - WCAG AA compliant, keyboard navigation
  • ๐Ÿ“ฑ Responsive - Mobile-first design, works on all devices
  • ๐ŸŽจ Theme Support - Clean, modern UI with customizable colors

Developer Features

  • ๐Ÿ”ง Custom Hooks - Reusable logic for timers, audio, and state
  • ๐Ÿ—‚๏ธ Centralized State - Redux Toolkit with organized slices
  • ๐ŸŽต Custom Audio Service - Memory-efficient audio management
  • ๐Ÿ“ Comprehensive Docs - Architecture, API, setup, and troubleshooting guides
  • ๐Ÿค– CI/CD Pipeline - Automated testing and deployment with GitHub Actions

๐ŸŒ Live Demo

Try it now: https://joshlehman.ca/pomodor

Screenshots

Landing Page Timer
Landing Page Active Timer
Help Settings
Help Page Settings

๐Ÿš€ Quick Start

Prerequisites

  • Node.js >= 17.0.0 (recommended: 18.x or 20.x LTS)
  • npm >= 8.0.0
  • Git

Installation

# Clone the repository
git clone https://github.com/joshl26/pomodoro-app.git
cd pomodoro-app

# Install dependencies
npm install

# Start development server
npm start

The app will open automatically at http://localhost:3000

Package Manager Options

Using npm (default):

npm install
npm start

Using pnpm:

# Enable via Corepack (Node 16.10+)
corepack enable
corepack prepare pnpm@latest --activate

# Install and run
pnpm install
pnpm start

Note: If you encounter pnpm version mismatch errors, remove the packageManager field from package.json or update it to match your installed version.


๐Ÿ“š Documentation

Comprehensive documentation is available in the /docs directory:

Document Description
SETUP.md Installation, IDE setup, troubleshooting
ARCHITECTURE.md System design, component hierarchy, data flow
API.md Redux actions, selectors, hooks, utilities
DEPLOYMENT.md Deploy to GitHub Pages, Netlify, Vercel, AWS
TROUBLESHOOTING.md Common issues and solutions
FAQ.md Frequently asked questions
CHANGELOG.md Version history and release notes
CONTRIBUTING.md Contribution guidelines
ROADMAP.md Development roadmap and progress

๐Ÿ› ๏ธ Technology Stack

Core Technologies

{
  "React": "18.3.1",
  "Redux Toolkit": "2.3.0",
  "React Router": "6.28.0",
  "React Testing Library": "16.1.0",
  "Jest": "27.5.1"
}

Key Libraries & Tools

  • State Management: Redux Toolkit with custom hooks
  • Routing: React Router v6 with lazy loading
  • Testing: Jest + React Testing Library
  • Styling: CSS Modules with theme support
  • Audio: Custom audio service (no external library)
  • Build: Create React App with optimizations
  • Linting: ESLint + Prettier
  • CI/CD: GitHub Actions

Why These Choices?

React 18: Concurrent features, automatic batching, improved performance

Redux Toolkit: Reduced boilerplate, built-in best practices, DevTools integration

Custom Audio Service: Better memory management than libraries, easier testing, no extra dependencies

CRA: Zero-config setup, battle-tested build pipeline, easy ejection if needed

See ARCHITECTURE.md for detailed design decisions.


๐Ÿ“ Project Structure

pomodoro-app/
โ”œโ”€โ”€ public/                  # Static assets
โ”‚   โ”œโ”€โ”€ index.html          # HTML template
โ”‚   โ”œโ”€โ”€ favicon.ico         # App icon
โ”‚   โ””โ”€โ”€ sounds/             # Audio files (if not in src)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/             # Images, sounds, fonts
โ”‚   โ”‚   โ””โ”€โ”€ sounds/         # Audio files
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Timer.jsx       # Main timer component
โ”‚   โ”‚   โ”œโ”€โ”€ Settings.jsx    # Settings page
โ”‚   โ”‚   โ”œโ”€โ”€ SecondaryButtons.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Report.jsx
โ”‚   โ”‚   โ””โ”€โ”€ Help.jsx
โ”‚   โ”œโ”€โ”€ hooks/              # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useAudioManager.js
โ”‚   โ”‚   โ”œโ”€โ”€ useTimerMode.js
โ”‚   โ”‚   โ”œโ”€โ”€ useTimerControls.js
โ”‚   โ”‚   โ””โ”€โ”€ useAutoStartCycle.js
โ”‚   โ”œโ”€โ”€ services/           # Business logic
โ”‚   โ”‚   โ””โ”€โ”€ audioService.js # Audio management
โ”‚   โ”œโ”€โ”€ store/              # Redux state
โ”‚   โ”‚   โ”œโ”€โ”€ index.js        # Store configuration
โ”‚   โ”‚   โ”œโ”€โ”€ settingsSlice.js # Settings reducer
โ”‚   โ”‚   โ””โ”€โ”€ selectors.js    # Memoized selectors
โ”‚   โ”œโ”€โ”€ utilities/          # Helper functions
โ”‚   โ”‚   โ””โ”€โ”€ util.js         # Time formatting, etc.
โ”‚   โ”œโ”€โ”€ __tests__/          # Test files
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ store/
โ”‚   โ”‚   โ””โ”€โ”€ utilities/
โ”‚   โ”œโ”€โ”€ App.jsx             # Root component
โ”‚   โ”œโ”€โ”€ App.css             # Global styles
โ”‚   โ”œโ”€โ”€ index.jsx           # App entry point
โ”‚   โ””โ”€โ”€ setupTests.js       # Test configuration
โ”œโ”€โ”€ .eslintrc.json          # ESLint config
โ”œโ”€โ”€ .prettierrc             # Prettier config
โ”œโ”€โ”€ package.json            # Dependencies
โ”œโ”€โ”€ README.md               # This file
โ”œโ”€โ”€ ARCHITECTURE.md         # Architecture docs
โ”œโ”€โ”€ API.md                  # API reference
โ”œโ”€โ”€ ROADMAP.md              # Development plan
โ””โ”€โ”€ CHANGELOG.md            # Version history

Key Directories Explained

/components - Presentational and container components

  • Each component in its own file
  • Co-located styles (.css files)
  • Memoized with React.memo() where beneficial

/hooks - Custom React hooks for reusable logic

  • useTimerMode - Mode transitions (pomodoro/break)
  • useTimerControls - Start/pause/reset logic
  • useAudioManager - Audio playback interface

/services - Business logic and external integrations

  • audioService.js - Singleton audio manager

/store - Redux state management

  • settingsSlice.js - All app settings
  • selectors.js - Centralized state selectors

๐Ÿ’ป Development

Available Scripts

# Development
npm start              # Start dev server (http://localhost:3000)
npm run build          # Production build
npm test               # Run tests in watch mode
npm run lint           # Run ESLint
npm run format         # Format code with Prettier

# Testing
npm test -- --coverage               # Test with coverage report
npm test -- --watchAll=false         # Run tests once (CI mode)
npm test -- --testPathPattern=Timer  # Run specific test file

# Analysis
npm run analyze        # Analyze bundle size

Development Workflow

  1. Create Feature Branch

    git checkout -b feature/my-feature
  2. Make Changes

    • Write code following existing patterns
    • Add tests for new functionality
    • Update documentation if needed
  3. Test Changes

    npm test                    # Run all tests
    npm run lint                # Check for linting errors
    npm run format              # Auto-format code
  4. Commit Changes

    git add .
    git commit -m "feat: add my feature"

    Follow Conventional Commits:

    • feat: New feature
    • fix: Bug fix
    • docs: Documentation
    • test: Tests
    • refactor: Code refactoring
    • perf: Performance improvement
  5. Push and Create PR

    git push origin feature/my-feature

    Then open a Pull Request on GitHub.

Code Style Guidelines

Components:

import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { selectValue } from './store/selectors';
import './Component.css';

/**
 * Component description
 * @param {Object} props - Component props
 */
const Component = ({ prop1, prop2 }) => {
  const value = useSelector(selectValue);
  const dispatch = useDispatch();

  return (
    <div className="component">
      {/* JSX */}
    </div>
  );
};

export default React.memo(Component);

Custom Hooks:

import { useState, useEffect, useCallback } from 'react';

/**
 * Hook description
 * @returns {Object} Hook return value
 */
export const useCustomHook = () => {
  const [state, setState] = useState(null);

  const method = useCallback(() => {
    // Logic
  }, []);

  return { state, method };
};

๐Ÿงช Testing

Test Coverage

Current coverage: >80% across the codebase

# Run tests with coverage
npm test -- --coverage --watchAll=false

# Coverage by category:
# - Utilities: 95%+
# - Reducers: 95%+
# - Hooks: 80%+
# - Components: 70%+

Testing Stack

  • Jest - Test runner and assertions
  • React Testing Library - Component testing
  • @testing-library/user-event - User interaction simulation
  • @testing-library/react-hooks - Hook testing

Writing Tests

Component Test Example:

import { render, screen } from '@testing-library/react';
import { Provider } from 'react-redux';
import { configureStore } from '@reduxjs/toolkit';
import Timer from './Timer';
import settingsReducer from './store/settingsSlice';

const createMockStore = () => configureStore({
  reducer: { settings: settingsReducer }
});

test('renders timer display', () => {
  const store = createMockStore();
  render(
    <Provider store={store}>
      <Timer />
    </Provider>
  );
  expect(screen.getByText(/25:00/)).toBeInTheDocument();
});

Hook Test Example:

import { renderHook, act } from '@testing-library/react';
import { useTimerMode } from './useTimerMode';

test('advances to next mode', () => {
  const { result } = renderHook(() => useTimerMode());

  act(() => {
    result.current.advanceMode();
  });

  expect(result.current.timerMode).toBe('shortBreak');
});

See ARCHITECTURE.md - Testing Strategy for detailed patterns.


๐Ÿšข Deployment

Quick Deploy Options

GitHub Pages (Current):

npm run deploy

Netlify:

npm install -g netlify-cli
netlify deploy --prod

Vercel:

npm install -g vercel
vercel --prod

Platform-Specific Guides

Detailed deployment instructions for:

  • GitHub Pages (automated with GitHub Actions)
  • Netlify (with netlify.toml config)
  • Vercel (with vercel.json config)
  • AWS S3 + CloudFront
  • Docker containerization

See DEPLOYMENT.md for complete guides.

Environment Configuration

Create .env.production for production builds:

# Public URL (for subdirectory deployments)
PUBLIC_URL=/pomodor

# Disable source maps (security)
GENERATE_SOURCEMAP=false

# API endpoint (if backend added)
REACT_APP_API_URL=https://api.yourdomain.com

# Analytics (optional)
REACT_APP_GA_ID=G-XXXXXXXXXX

โšก Performance

Bundle Size

Main bundle:    ~250KB (uncompressed)
Main bundle:    ~87KB (gzipped) โœ…
CSS bundle:     ~15KB (gzipped)
Total load:     ~102KB (excellent!)

Lighthouse Scores

Performance:      95/100 โœ…
Accessibility:   100/100 โœ…
Best Practices:  100/100 โœ…
SEO:              92/100 โœ…

Optimization Techniques

  1. Code Splitting - Routes lazy-loaded with React.lazy()
  2. Memoization - React.memo(), useMemo(), useCallback()
  3. Selector Optimization - Memoized Redux selectors with Reselect
  4. Asset Optimization - Compressed images, optimized audio files
  5. Tree Shaking - Unused code eliminated in production
  6. Caching - Proper cache headers for static assets

Performance Monitoring

# Run Lighthouse audit
npm install -g lighthouse
lighthouse http://localhost:3000 --view

# Analyze bundle
npm run build
npx webpack-bundle-analyzer build/static/js/*.js

See ARCHITECTURE.md - Performance Optimizations for details.


๐Ÿค Contributing

We welcome contributions! Here's how to get started:

Quick Contribution Guide

  1. Fork the repository
  2. Clone your fork
  3. Create a feature branch
  4. Make changes with tests
  5. Submit a pull request

Contribution Opportunities

Good First Issues:

  • ๐Ÿ“ Documentation improvements
  • ๐Ÿ› Bug fixes
  • ๐ŸŽจ UI/UX enhancements
  • โœ… Additional tests

Advanced Contributions:

  • ๐Ÿš€ Performance optimizations
  • โš™๏ธ New features from roadmap
  • ๐Ÿ—๏ธ Architecture improvements
  • ๐Ÿ”ง Build/tooling enhancements

Guidelines

  • Follow existing code style (ESLint + Prettier enforced)
  • Write tests for new features
  • Update documentation as needed
  • Keep PRs focused and atomic
  • Link PRs to relevant issues

See CONTRIBUTING.md for detailed guidelines.


๐Ÿ—บ๏ธ Roadmap

Current Status

Progress: 97/147 tasks completed (66%)

Completed Phases:

  • โœ… Phase 1: Performance & Code Quality (13/13)
  • โœ… Phase 2: State Management (14/14)
  • โœ… Phase 3: Audio Management (11/11)
  • โœ… Phase 4: Modernization (36/36)
  • โœ… Phase 5: Testing & Quality (15/15)

In Progress:

  • โณ Phase 6: Performance Optimization (8/12)
  • โณ Phase 8: Developer Experience (8/14)

Planned:

  • ๐Ÿ“‹ Phase 7: Features & UX (0/16)
  • ๐Ÿ“‹ Phase 9: Documentation (8/8) โœ… COMPLETE
  • ๐Ÿ“‹ Phase 10: Maintenance & Monitoring (0/8)

Upcoming Features

Next Release (v2.1.0):

  • Keyboard shortcuts (Space, Escape, arrows)
  • Desktop notifications
  • CSS optimization
  • Performance profiling improvements

Future Releases:

  • localStorage persistence
  • Dark mode toggle
  • Session history and statistics
  • Export/import settings
  • PWA support (offline mode)
  • Multi-language support (i18n)

See ROADMAP.md for the complete development plan.


๐Ÿ“„ License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2025 Joshua Lehman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What this means:

  • โœ… Commercial use
  • โœ… Modification
  • โœ… Distribution
  • โœ… Private use
  • โŒ Liability
  • โŒ Warranty

See LICENSE file for full text.


๐Ÿ‘ค Author

Joshua Lehman

Support the Project

If you find PomoBreak helpful:

  • โญ Star this repository
  • ๐Ÿ› Report bugs and suggest features
  • ๐Ÿ’ป Contribute code or documentation
  • ๐Ÿ“ข Share with others
  • ๐Ÿ’ฌ Provide feedback

๐Ÿ™ Acknowledgments

Inspiration

  • The Pomodoro Technique by Francesco Cirillo
  • Open-source Pomodoro timer projects
  • React and Redux community best practices

Technologies & Resources

Community

Thanks to:

  • All contributors (past, present, and future)
  • Users who report bugs and suggest features
  • The open-source community for tools and inspiration
  • React/Redux communities for guidance and best practices

๐Ÿ“ž Support & Contact

Getting Help

  • ๐Ÿ“– Documentation: Check the docs folder for detailed guides
  • ๐Ÿ› Bug Reports: Open an issue
  • ๐Ÿ’ก Feature Requests: Open an issue
  • โ“ Questions: See FAQ.md or open a discussion

Stay Updated

  • Watch this repository for updates
  • Star to show support and bookmark
  • Check CHANGELOG.md for version updates

๐ŸŽ“ Learning Resources

New to React/Redux? This project can help you learn:

  • Modern React patterns (hooks, functional components)
  • Redux Toolkit state management
  • Custom hooks for reusable logic
  • Testing React applications
  • Project structure and architecture
  • Performance optimization techniques

Recommended Learning Path:

  1. Read ARCHITECTURE.md for system overview
  2. Explore components in src/components/
  3. Study custom hooks in src/hooks/
  4. Review tests in src/__tests__/
  5. Try making small changes and seeing results

๐Ÿ”ฎ Future Vision

PomoBreak aims to be:

  1. The reference implementation for modern React + Redux apps
  2. A learning resource for developers at all levels
  3. A production-ready tool for productivity
  4. An open-source community for collaboration

Long-term goals:

  • PWA with offline support
  • Mobile apps (React Native)
  • Cloud sync capabilities
  • Team collaboration features
  • Plugin/extension system

๐Ÿ“Š Project Stats

Lines of Code:    ~5,000
Test Coverage:    >80%
Bundle Size:      87KB (gzipped)
Dependencies:     25 (minimal!)
Dev Dependencies: 45
Contributors:     1+ (you?)
Stars:            โญ (add yours!)

๐Ÿ’– Show Your Support

If you like this project:

# Give it a star on GitHub โญ
# Fork it and try new ideas ๐Ÿด
# Share it with friends ๐Ÿ“ข
# Contribute improvements ๐Ÿ’ป
# Report bugs and suggest features ๐Ÿ›

Ready to boost your productivity? Try PomoBreak now!

Want to contribute? Check out CONTRIBUTING.md and ROADMAP.md

Need help? See TROUBLESHOOTING.md and FAQ.md


Made with โค๏ธ by Joshua Lehman

Live Demo โ€ข Documentation โ€ข Report Bug โ€ข Request Feature

โญ Star this repo if you find it helpful!

About

PomoBreak (pomodoro-app) is a lightweight Pomodoro timer built with React and Redux. The project explores UI/UX design, routing, state management, custom audio management, and test coverage for robust front-end development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published