A comprehensive productivity tracking application that helps you monitor your focus sessions, analyze tab switching behavior, and gain insights into your work patterns. Built as a Progressive Web Application (PWA) with Chrome Extension integration for enhanced tab tracking capabilities.
Note:
- Chrome Extension: Currently pending Chrome Web Store review. The extension will provide enhanced tracking capabilities once approved.
- Cloud Integration: Server-side features for data backup and synchronization are currently in development.
- Login Functionality: It is currently in development.
- Current Status: The application operates in offline-first mode with local data storage and basic tracking capabilities.
- Focus Session Management: Start, track, and end focused work sessions
- Real-time Tab Tracking: Monitor tab switches and domain visits during sessions
- Detailed Analytics: Comprehensive insights with interactive charts and visualizations
- Session History: View and analyze past focus sessions
- Domain Management: Configure focus domains vs. distraction domains
- Dark/Light Theme: Toggle between light and dark modes
- Focus vs. Distraction Time: Pie chart showing time distribution
- Domain Activity Timeline: Gantt-style timeline of domain visits
- Tab Switch Analysis: Bar charts showing different types of tab switches
- Domain Distribution: Visual breakdown of time spent on different domains
- Performance Metrics: Focus percentage, total tab switches, session duration
- Offline Support: Works without internet connection
- Install on Device: Can be installed as a native-like app
- Responsive Design: Optimized for desktop and mobile devices
- Service Worker: Background sync and caching capabilities
- Framework: Angular 17 with SSR (Server-Side Rendering)
- Language: TypeScript
- Styling: Tailwind CSS with SCSS
- UI Components: Angular CDK (Component Dev Kit)
- State Management: RxJS with BehaviorSubjects
- Charts: Chart.js with ng2-charts
- PWA: Angular Service Worker
- Client-side Database: IndexedDB with Dexie.js
- Browser Storage: LocalStorage for preferences
- Data Persistence: Offline-first architecture
- Manifest Version: 3 (MV3)
- Architecture: Content Script + Background Service Worker
- Permissions: Tabs, Active Tab, Scripting, Storage, Alarms
- Communication: Message passing between extension and PWA
- Build System: Angular CLI
- Package Manager: npm
- Code Quality: TypeScript strict mode, ESLint configuration
- Testing: Jasmine and Karma
- Runtime: Node.js with Express
- Purpose: Future cloud backup and synchronization features
- Status: Currently in development for data backup and cross-device sync
time-to-focus-tracker/
├── client/ # Angular PWA Application
│ ├── src/
│ │ ├── app/
│ │ │ ├── models/ # TypeScript interfaces and enums
│ │ │ │ ├── focus-domain.model.ts
│ │ │ │ ├── focus-session.model.ts
│ │ │ │ └── tab-event.model.ts
│ │ │ ├── pages/ # Feature pages
│ │ │ │ ├── home/ # Main session control
│ │ │ │ ├── history/ # Session history view
│ │ │ │ └── insight/ # Analytics dashboard
│ │ │ ├── services/ # Core business logic
│ │ │ │ ├── db.service.ts # IndexedDB operations
│ │ │ │ ├── focus-session.service.ts
│ │ │ │ ├── tab-tracking.service.ts
│ │ │ │ └── focus-domains.service.ts
│ │ │ ├── shared/ # Reusable components
│ │ │ │ └── dark-mode-toggle/
│ │ │ ├── app.component.* # Root component
│ │ │ └── app.routes.ts # Application routing
│ │ ├── assets/ # Static assets
│ │ ├── environments/ # Environment configs
│ │ ├── index.html # Main HTML template
│ │ ├── main.ts # Client-side bootstrap
│ │ ├── main.server.ts # SSR bootstrap
│ │ ├── manifest.webmanifest # PWA manifest
│ │ └── styles.scss # Global styles
│ ├── angular.json # Angular CLI configuration
│ ├── package.json # Dependencies and scripts
│ ├── server.ts # SSR server configuration
│ ├── tailwind.config.js # Tailwind CSS config
│ └── tsconfig.json # TypeScript configuration
├── extension/ # Chrome Extension
│ ├── background.js # Service worker script
│ ├── content.js # Content script for page interaction
│ └── manifest.json # Extension manifest
├── server/ # Backend Server (In Progress)
│ ├── index.js # Express server
│ ├── package.json # Server dependencies
│ └── tsconfig.json # Server TypeScript config
└── LICENSE # MIT License
The Time To Focus Tracker includes a Chrome extension that enables advanced tab tracking capabilities. The extension seamlessly integrates with the PWA to provide real-time productivity insights.
🔄 Currently Under Review: The Chrome extension is pending review by the Chrome Web Store team. Once approved, it will be available for public installation.
- Background Script: Monitors tab switches and window focus changes using Chrome's Tabs API
- Content Script: Facilitates bidirectional communication between the extension and PWA
- Message Passing: Real-time event communication for instant tracking updates
- Service Worker: Efficient background processing with MV3 compliance
- Tab Activation: Switching between different browser tabs
- Window Focus Changes: Moving focus between different browser windows
- Domain Transitions: Navigation between different websites within tabs
- Session Events: Start and stop tracking events coordinated with PWA
- Real-time Tracking: Instant detection of tab switches and domain changes
- Smart Categorization: Automatic classification of domains as focused vs. distracted
- Privacy Protection: Zero data transmission to external servers
- Performance Optimized: Minimal resource usage with intelligent event handling
- Session Coordination: Seamless integration with PWA session management
- Local Data Only: All tracking data remains on the user's device
- Session-Based Activation: Extension only monitors activity during active focus sessions
- Minimal Permissions: Uses only essential Chrome permissions for core functionality
- No External Communication: Extension operates entirely offline
- User Control: Users can start/stop tracking at any time
Once approved by Chrome Web Store, users will be able to:
- Install the extension directly from the Chrome Web Store
- The PWA will automatically detect the extension presence
- Full tracking capabilities will be enabled seamlessly
While the extension is under review, users can still use the PWA with basic tracking capabilities that don't require extension permissions.
- Setup Focus Domains: Configure which domains count as "focused work"
- Install Extension: Install the Chrome extension (when available) for enhanced tracking
- Start Session: Begin a focus session with a task name and selected domains
- Work & Track: The extension monitors your tab activity in real-time
- End Session: Complete the session to save comprehensive analytics
- Review Insights: Analyze your productivity patterns with detailed interactive charts
- Productivity Awareness: Understand your distraction patterns and focus habits
- Data-Driven Insights: Make informed decisions about work environments and habits
- Privacy-First: All data stays on your device - no cloud storage or external transmission
- Offline Capable: Full functionality without internet connection
- Cross-Platform: Responsive design works on desktop, tablet, and mobile devices
- Non-Intrusive: Only tracks when sessions are active, respects user privacy
- Cloud Synchronization: Backup and sync data across devices (server development in progress)
- Advanced Analytics: Machine learning insights for productivity patterns
- Goal Setting: Set and track daily/weekly focus time goals
- Team Features: Share productivity insights with team members (optional)
- Mobile Extensions: Native mobile app with similar tracking capabilities
- Third-party Integrations: Connect with calendar, project management, and time tracking tools
- Productivity Recommendations: AI-powered suggestions for improving focus
- Node.js (v18 or higher)
- npm or yarn
- Chrome browser (for extension functionality)
-
Clone the repository
git clone https://github.com/your-username/time-to-focus-tracker.git cd time-to-focus-tracker -
Install dependencies
cd client npm install -
Start development server
npm start
-
Access the application Open your browser and navigate to
http://localhost:4200
# Build the PWA
npm run build
# Build with SSR
npm run build:ssr
# Serve SSR build locally
npm run serve:ssr-
Load extension in Chrome
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
extensionfolder
- Open Chrome and go to
-
Test integration
- Open the PWA in Chrome
- The extension should automatically connect
- Start a focus session to test tracking
The application provides comprehensive analytics through interactive charts:
- Pie Charts: Focus vs. distraction time distribution
- Timeline Charts: Domain activity over time (Gantt-style)
- Bar Charts: Tab switch frequency analysis
- Distribution Charts: Time spent per domain breakdown
- Total session duration
- Focus time percentage
- Tab switch frequency
- Domain transition patterns
- Productivity trends over time
- Local Only: All data stored in browser's IndexedDB
- No Cloud Storage: No data sent to external servers by default
- User Control: Complete control over data retention and deletion
- tabs: Monitor active tabs for tracking
- activeTab: Access current tab information
- scripting: Inject content scripts for communication
- storage: Store extension preferences locally
- alarms: Maintain service worker lifecycle
- Unit Tests: Individual component and service testing
- Integration Tests: Service interaction testing
- E2E Tests: Full user workflow testing
- Frontend: Angular 17 with standalone components
- State Management: RxJS BehaviorSubjects for reactive state
- Data Layer: IndexedDB with Dexie.js for offline storage
- Extension: Chrome MV3 with background service worker
- FocusSessionService: Manages focus session lifecycle
- TabTrackingService: Handles tab monitoring and event processing
- DbService: IndexedDB operations and data persistence
- FocusDomainsService: Domain configuration management
- Follow Angular style guide
- Use TypeScript strict mode
- Implement responsive design patterns
- Maintain offline-first approach
- Ensure privacy by design
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. Areas where contributions are especially appreciated:
- UI/UX improvements
- Additional analytics features
- Performance optimizations
- Mobile responsiveness enhancements
- Documentation improvements
- Fork the repository
- Create a feature branch
- Make your changes
- Write/update tests
- Submit a pull request
For questions, suggestions, or support, please:
- Open an issue on GitHub
- Contact the maintainers through the repository
- Check the documentation for common questions
Last Updated: August 2025"""