How patilninad18/timeboard works
TimeBoard is a local-first Electron desktop app for tracking application use and helping users understand focus. The main flow is OS activity and idle sampling into SQLite, followed by classification and analytics; the Electron IPC bridge serves onboarding, dashboard, activity, analytics, reports, and settings in the React renderer. README documents midnight splitting, theme persistence, and CSV export; those capabilities are represented, though their internal wiring is not fully shown in the excerpts. Several backend services and UI pages are indexed but unsampled, so their detailed internal calls are omitted.
Main entry points: main.js Electron main and IPC · App.jsx Onboarding and routes · database.js SQLite activity store · classificationService.js App classification
Components 27
Activity capture
- Usage tracker
backend/services/appTracker.js - Idle detection
backend/services/idleService.js - Browser domain mapping
backend/services/domainExtractor.js
Local analysis
- SQLite activity store
backend/db/database.js - App classification
backend/services/classificationService.js - Productivity and block rules
backend/services/productivityService.js - Focus statistics
backend/services/statsService.js - Daily usage rollup
backend/services/dataAggregator.js - Usage analytics
backend/services/analyticsService.js - Session timeline
backend/services/activityService.js - Reports and CSV
backend/services/reportsService.js - Productivity insights
backend/services/aiInsightsService.js - Data management
backend/services/dataCleanup.js
Desktop bridge
- Electron main and IPC
backend/main.js - Safe renderer API
backend/preload.cjs
User experience
- React application
frontend/src/main.jsx - Onboarding and routes
frontend/src/App.jsx - User settings context
frontend/src/context/UserContext.jsx - Theme preferences
frontend/src/context/ThemeContext.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Activity timeline
frontend/src/pages/Activity.jsx - Analytics views
frontend/src/pages/Analytics.jsx - Reports view
frontend/src/pages/Reports.jsx - Settings view
frontend/src/pages/Settings.jsx - Landing and onboarding
frontend/src/pages/Landing.jsx
Other components
- Desktop user
- Active window and idle state
Connections 37
- Desktop user → React application: uses
- Active window and idle state → Usage tracker: sampled by
- Usage tracker → SQLite activity store: records sessions
- Idle detection → Usage tracker: reports idle
- Browser domain mapping → Usage tracker: maps titles
- Electron main and IPC → Usage tracker: starts tracking
backend/main.js - Electron main and IPC → Focus statistics: dispatches stats
backend/main.js - Electron main and IPC → Daily usage rollup: dispatches usage
backend/main.js - Electron main and IPC → Usage analytics: dispatches queries
backend/main.js - Electron main and IPC → Session timeline: dispatches sessions
backend/main.js - Electron main and IPC → Reports and CSV: dispatches reports
backend/main.js - Electron main and IPC → Productivity insights: dispatches insights
backend/main.js - Electron main and IPC → Data management: dispatches cleanup
backend/main.js - Electron main and IPC → Productivity and block rules: updates rules
backend/main.js - Electron main and IPC → App classification: sets classification
backend/main.js - Focus statistics → SQLite activity store: queries
backend/services/statsService.js - Focus statistics → App classification: uses joins
backend/services/statsService.js - Session timeline → SQLite activity store: queries sessions
backend/services/activityService.js - Session timeline → App classification: uses joins
backend/services/activityService.js - Reports and CSV → SQLite activity store: queries aggregates
backend/services/reportsService.js - Reports and CSV → App classification: uses joins
backend/services/reportsService.js - Productivity insights → SQLite activity store: queries activity
backend/services/aiInsightsService.js - Productivity insights → App classification: uses joins
backend/services/aiInsightsService.js - App classification → SQLite activity store: reads rules
backend/services/classificationService.js - Productivity and block rules → SQLite activity store: stores rules
backend/services/productivityService.js - React application → Onboarding and routes: renders
frontend/src/main.jsx - React application → User settings context: provides context
frontend/src/main.jsx - React application → Theme preferences: provides theme
frontend/src/main.jsx - Onboarding and routes → Dashboard: routes to
frontend/src/App.jsx - Onboarding and routes → Activity timeline: routes to
frontend/src/App.jsx - Onboarding and routes → Analytics views: routes to
frontend/src/App.jsx - Onboarding and routes → Reports view: routes to
frontend/src/App.jsx - Onboarding and routes → Settings view: routes to
frontend/src/App.jsx - Onboarding and routes → Landing and onboarding: shows onboarding
frontend/src/App.jsx - User settings context → Safe renderer API: calls API
- Safe renderer API → Electron main and IPC: bridges IPC
- Theme preferences → Desktop user: persists preference