Skip to content

Latest commit

Β 

History

63 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ… Pomodoro GitHub

A developer-focused Pomodoro timer Chrome extension with Google account cloud sync.

Features

  • Pomodoro Timer β€” 25/5/15 focus/break cycles, fully customizable
  • Google Cloud Sync β€” One-click Gmail login, data stored in your private Google Drive
  • Statistics β€” Daily/weekly/monthly stats, GitHub-style heatmap
  • Achievements β€” Unlock milestones as you build focus streaks
  • Keyboard Shortcuts β€” Space (start/pause), S (skip), R (reset)
  • Dark Theme β€” Easy on the eyes during long coding sessions
  • Offline-First β€” Works fully offline, syncs when connected
  • Sound Effects β€” Chimes on session complete (Web Audio API, no files)
  • Onboarding β€” Guided first-time experience

Quick Start

npm install
npm run build
  1. Open chrome://extensions/
  2. Enable Developer mode
  3. Click Load unpacked β†’ select the dist/ folder

Google Cloud Setup (for sync)

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Google Drive API (APIs & Services β†’ Library)
  4. Create OAuth 2.0 credential (APIs & Services β†’ Credentials)
    • Application type: Chrome Extension
    • Application ID: your extension ID (visible in chrome://extensions/)
  5. Copy the Client ID into src/manifest.json β†’ oauth2.client_id
  6. Rebuild: npm run build

Architecture

src/
β”œβ”€β”€ background/          # Service Worker (alarm-based timer)
β”œβ”€β”€ popup/               # React 18 UI
β”‚   β”œβ”€β”€ components/      # Timer, Stats, Settings, Heatmap, etc.
β”‚   └── hooks/           # useTimer β€” bridge to background
β”œβ”€β”€ lib/                 # Core logic (no side-effects)
β”‚   β”œβ”€β”€ timer-engine.ts  # Pure state machine
β”‚   β”œβ”€β”€ storage.ts       # chrome.storage wrapper
β”‚   β”œβ”€β”€ google-auth.ts   # OAuth via chrome.identity
β”‚   β”œβ”€β”€ google-drive-sync.ts  # Drive AppData sync
β”‚   β”œβ”€β”€ sounds.ts        # Web Audio API tones
β”‚   └── notifications.ts # Chrome notifications
β”œβ”€β”€ stores/              # Zustand state management
β”œβ”€β”€ types/               # TypeScript definitions
└── styles/              # Tailwind CSS

Key Design Decisions

Decision Choice Why
Build Vite + CRXJS HMR, Manifest V3 native
UI React 18 + Tailwind Component reuse, fast styling
State Zustand Lightweight, storage persistence
Timer chrome.alarms Survives Service Worker termination
Sync Google Drive AppData Hidden folder, user-only access
Auth chrome.identity Native Chrome OAuth, no redirects

Timer Reliability

Chrome MV3 Service Workers are terminated after ~30s of inactivity. This extension uses chrome.alarms for the tick mechanism instead of setInterval, ensuring the timer survives SW restarts. The timer state is persisted to chrome.storage.local on every tick.

Testing

npx vitest run        # Run all tests
npx vitest run --ui   # Interactive UI

54 unit tests covering:

  • Timer engine: all state transitions, edge cases, cycle logic
  • Storage: read/write, concurrent safety, default fallbacks
  • Pure functions: formatTime, getProgress

Publishing to Chrome Web Store

  1. Create a ZIP of the dist/ folder
  2. Go to Chrome Web Store Developer Dashboard
  3. Pay the one-time $5 registration fee
  4. Upload the ZIP, fill in store listing details
  5. Submit for review (typically 1-3 business days)

Privacy

  • All data stored locally in chrome.storage.local
  • Google token managed by chrome.identity (never exposed to the extension)
  • Sync uses your private Google Drive AppData folder
  • No analytics, no tracking, no third-party servers

License

MIT

About

πŸ… Developer-focused Pomodoro timer Chrome extension with GitHub Gist cloud sync

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages