Skip to content

Repository files navigation

TimeFlow

TimeFlow

A privacy-first browser time tracker — built as a modern Chrome extension.
100% local in chrome.storage.local · Zero telemetry · Fully offline.

Getting Started Features

Chrome Extension Manifest V3 React 19 TypeScript Vite License

TimeFlow Analytics Dashboard — Total Time, Top Sites, Category Breakdown, and Browsing Trend

TimeFlow Popup UI with interactive pie chart and period selector
Compact Popup — interactive pie chart, period selector & live site bars
TimeFlow Analytics — Day-of-week and Hour-of-day activity charts
Deep Analytics — day-of-week patterns, hourly activity & category breakdown

Overview

TimeFlow is a Chrome extension that automatically tracks how much time you spend on every website. It runs as a background service worker and presents browsing analytics through a compact popup and a full-featured dashboard — all without sending any data to external servers.

All data stays in chrome.storage.local. Zero telemetry. Fully offline.


Features

Automatic Time Tracking

  • Tracks active browsing time per domain, per day
  • Idle detection (60-second threshold) with automatic pause
  • Pauses when the browser window loses focus
  • Periodic session flush every 5 seconds to prevent data loss
  • Live badge on the extension icon showing today's time on the current site

Popup Interface

  • Interactive pie chart with hover tooltips and favicon display
  • Period selector: Today | 7D | 30D | 90D | All
  • Top 15 sites ranked by time with gradient progress bars
  • Total time and site count summary
  • One-click navigation to the full dashboard

Analytics Dashboard

The dashboard consists of four pages:

Page What it shows
Overview Stat cards (total time, sites, visits, avg per site), top sites bar chart, category breakdown
Analytics Browsing trend line chart (14 days), hour-of-day heatmap, day-of-week analysis, searchable site list
Focus Mode Daily heatmap (96 slots × 15 min), activity-by-hour bar chart, per-site deep-dive
Settings Language selector, data import/export, theme configuration

Auto-Categorization

200+ popular domains are automatically classified into 12 categories:

Category Examples
AI Tools ChatGPT, Claude, Gemini, Perplexity
Development GitHub, Stack Overflow, VS Code Web, MDN
Gaming Steam, Twitch, IGN, PC Gamer
Social Media Twitter/X, Reddit, Instagram, Facebook
Entertainment YouTube, Netflix, Spotify
Work / Productivity Google Docs, Notion, Figma, Slack, Jira
Education Coursera, Khan Academy, Wikipedia, Udemy
Shopping Amazon, eBay, AliExpress
Communication Gmail, Outlook, Telegram, Discord
News NYTimes, BBC, CNN
Adult Auto-detected, hidden by default
Other Search engines, uncategorized

Click any category slice in the pie chart to drill down into the top sites within that category.

Theming

  • 6 color palettes: Indigo Night, Ocean, Aurora, Sunset, Rose, Amber
  • Dark mode with glassmorphism design
  • Smooth animations (Framer Motion)
  • Responsive layout for both popup (400px) and dashboard (full-width)

Internationalization

  • English and Russian
  • Powered by i18next + react-i18next
  • Language preference persists across sessions

Data Import & Export

  • Import from Time Tracker for Browser JSON backups
  • Export TimeFlow data as JSON
  • Full backward compatibility with Time Tracker data format

Tech Stack

Technology Role
React 19 UI framework
TypeScript 5.7 Type safety
Vite 6 Build tool
TailwindCSS 3 Styling
Recharts Charts and visualizations
Framer Motion Animations
date-fns Date utilities
i18next Internationalization
Chrome Manifest V3 Extension platform
Chrome Storage API Local-only data persistence

Getting Started

Prerequisites

  • Node.js 18+ and npm 9+
  • Google Chrome or any Chromium-based browser

Build

git clone https://github.com/Lemelson/timeflow-tracker.git
cd timeflow-tracker
npm install
npm run build

Load into Chrome

  1. Open chrome://extensions
  2. Enable Developer mode (top-right toggle)
  3. Click Load unpacked
  4. Select the dist/ folder
  5. TimeFlow appears in the toolbar — done.

Development

npm run dev

The dev server is useful for iterating on the dashboard UI. For full extension testing (popup, background worker, badge), use npm run build and reload the unpacked extension.


Project Structure

timeflow-tracker/
├── public/
│   ├── manifest.json              # Chrome Extension manifest (V3)
│   └── icons/                     # Extension icons (16, 32, 48, 128px)
├── src/
│   ├── background/
│   │   └── index.ts               # Service worker: tracking, idle, badge, alarms
│   ├── popup/
│   │   ├── App.tsx                # Popup UI with pie chart and period selector
│   │   ├── index.html
│   │   └── main.tsx
│   ├── dashboard/
│   │   ├── App.tsx                # Dashboard shell with sidebar navigation
│   │   ├── index.html
│   │   ├── main.tsx
│   │   ├── pages/
│   │   │   ├── OverviewPage.tsx
│   │   │   ├── AnalyticsPage.tsx
│   │   │   ├── FocusPage.tsx
│   │   │   └── SettingsPage.tsx
│   │   └── components/
│   │       ├── CategoryChart.tsx   # Category pie chart with drilldown
│   │       ├── TrendChart.tsx      # 14-day browsing trend
│   │       ├── HeatMap.tsx         # 96-slot daily heatmap
│   │       ├── HourOfDayChart.tsx
│   │       ├── DayOfWeekChart.tsx
│   │       ├── TopSitesChart.tsx
│   │       ├── AllSitesList.tsx    # Searchable site list
│   │       └── StatCard.tsx
│   ├── shared/
│   │   ├── types.ts               # TypeScript interfaces and types
│   │   ├── globals.css            # Global styles and Tailwind directives
│   │   ├── hooks/                 # Custom React hooks
│   │   ├── utils/
│   │   │   ├── time.ts            # Date and time helpers
│   │   │   ├── favicon.ts         # Favicon URL resolver
│   │   │   └── categories.ts     # Domain-to-category mapping (200+ entries)
│   │   └── components/
│   │       └── icons.tsx          # SVG icon components
│   ├── storage/
│   │   ├── tracker-store.ts       # Chrome Storage abstraction
│   │   └── import-export.ts       # JSON import/export
│   └── i18n/
│       ├── index.ts               # i18next configuration
│       ├── en.json
│       └── ru.json
├── vite.config.ts                 # Vite config (popup + dashboard)
├── vite.config.background.ts      # Vite config for service worker
├── tailwind.config.js
├── tsconfig.json
├── package.json
└── LICENSE

How It Works

  1. A background service worker listens for tab switches, URL changes, window focus events, and idle state via the Chrome APIs.
  2. When the active tab changes, the elapsed time for the previous domain is flushed to chrome.storage.local, keyed by date + domain.
  3. Time is also bucketed into 15-minute slots (96 per day) for the hourly heatmap visualization.
  4. An alarm fires every 5 seconds to persist in-progress sessions, protecting against unexpected browser closures.
  5. The extension badge shows a live counter of time spent on the current site today.
  6. All data remains in local storage — nothing is transmitted externally.

Storage Format

TimeFlow uses a storage key format compatible with Time Tracker for Browser:

{YYYYMMDD}{domain} → { focus: <milliseconds>, time: <visit_count> }

This allows seamless import and export between the two extensions.


License

This project is released under the TimeFlow Source Available License.

Permitted Not Permitted
View, study, and learn from the source code Publish to Chrome Web Store or any extension marketplace
Fork and modify for personal use Create paid or premium derivative works
Run locally Commercial distribution
Create and distribute free derivatives with attribution Use "TimeFlow" branding without attribution

See the full LICENSE file for details.


Contributing

Contributions are welcome. To get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'feat: add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

All contributions must remain free and open under the same license.


Roadmap

  • Firefox and Edge support
  • Custom domain categorization
  • Daily and weekly time limit alerts
  • Website blocking in Focus Mode
  • Productivity scoring
  • Additional language support

Built with React, TypeScript, and Vite.

Releases

Packages

Contributors

Languages