# hosseinhayati128/stopwatch architecture

> Architecture diagram of the GitHub repository hosseinhayati128/stopwatch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hosseinhayati128/stopwatch
- Repository: https://github.com/hosseinhayati128/stopwatch

## Overview

Stopwatch Overlay is a desktop timer overlay and project time tracker. The main workflow is to create and control independent timers, associate them with projects, record work sessions, and inspect or edit those records in the dashboard. Notes capture, periodic reviews, monitoring, and third-party sync are substantial adjacent capabilities. The graph reflects README-described features where implementation excerpts were unavailable; those edges are dashed and uncited rather than asserting inspected call paths.

Main entry points: [`StopwatchOverlay/ControllerWindow.xaml.cs`](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/ControllerWindow.xaml.cs) (Timer controller), [`StopwatchOverlay.Core/ObsidianNotesSync.cs`](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ObsidianNotesSync.cs) (Obsidian notes), [`StopwatchOverlay.Core/AppSettings.cs`](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/AppSettings.cs) (App settings), [`StopwatchOverlay.Core/ProjectTimeHistory.cs`](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ProjectTimeHistory.cs) (Work history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_timer["Timers and overlays"]
  node_controller["Timer controller"]
  node_sessions["Timer sessions<br/>[TimerSession.cs]"]
  node_session_manager["Workspace manager"]
  node_workspace_store[("Workspace recovery")]
  node_overlay["Floating overlays"]
end

subgraph group_tracking["Project tracking"]
  node_project_history[("Work history")]
  node_project_store[("Project store")]
  node_dashboard["Project dashboard"]
end

subgraph group_capture["Notes and review"]
  node_notes_entry["Quick capture"]
  node_notes_sync["Obsidian notes"]
  node_notes_viewer["Notes viewer"]
  node_review["Periodic review"]
  node_review_ui["Review interface"]
end

subgraph group_integrations["Monitoring and sync"]
  node_internet["Internet monitor"]
  node_activitywatch["ActivityWatch sync"]
  node_habitica["Habitica sync"]
  node_telegram["Telegram notes"]
end

subgraph group_desktop["Desktop experience"]
  node_settings[("App settings<br/>[AppSettings.cs]")]
  node_platform["Platform services"]
  node_appearance["Page appearance"]
  node_themes["Theme catalog<br/>[AppThemeCatalog.cs]"]
end

node_user(("User"))
node_obsidian_vault[("Obsidian vault")]
node_habitica_service["Habitica"]
node_telegram_service["Telegram"]
node_activitywatch_service["ActivityWatch"]

node_user -->|"controls"| node_controller
node_controller -->|"manages timers"| node_session_manager
node_session_manager -->|"creates sessions"| node_sessions
node_controller -->|"restores workspace"| node_workspace_store
node_controller -->|"shows timers"| node_overlay
node_controller -.->|"records work"| node_project_history
node_controller -.->|"persists projects"| node_project_store
node_dashboard -.->|"reads history"| node_project_history
node_user -.->|"reviews records"| node_dashboard
node_user -.->|"captures notes"| node_notes_entry
node_notes_entry -.->|"saves entries"| node_notes_sync
node_notes_sync -->|"writes dated notes"| node_obsidian_vault
node_notes_viewer -.->|"reads entries"| node_notes_sync
node_controller -.->|"schedules reviews"| node_review
node_review -->|"requests prompt"| node_review_ui
node_review_ui -.->|"aggregates activity"| node_project_history
node_controller -->|"starts monitoring"| node_internet
node_internet -.->|"syncs activity"| node_activitywatch
node_activitywatch -.->|"transfers activity"| node_activitywatch_service
node_notes_sync -.->|"syncs tasks"| node_habitica
node_habitica -.->|"updates tasks"| node_habitica_service
node_notes_sync -.->|"syncs notes"| node_telegram
node_telegram -.->|"forwards notes"| node_telegram_service
node_controller -.->|"uses preferences"| node_settings
node_settings -.->|"configures pages"| node_appearance
node_settings -.->|"selects theme"| node_themes
node_controller -.->|"uses desktop services"| node_platform

click node_controller "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/ControllerWindow.xaml.cs"
click node_sessions "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerSession.cs"
click node_session_manager "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerSessionManager.cs"
click node_workspace_store "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerWorkspaceStore.cs"
click node_overlay "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/OverlayWindow.xaml.cs"
click node_project_history "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ProjectTimeHistory.cs"
click node_project_store "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ProjectTimeStore.cs"
click node_dashboard "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/ProjectDashboardWindow.xaml.cs"
click node_notes_entry "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/NoteEntryWindow.xaml.cs"
click node_notes_sync "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ObsidianNotesSync.cs"
click node_notes_viewer "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/NotesViewerWindow.xaml.cs"
click node_review "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/PeriodicReview/PeriodicReviewService.cs"
click node_review_ui "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/PeriodicReview/PeriodicReviewWindow.xaml.cs"
click node_internet "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Internet/InternetMonitorService.cs"
click node_activitywatch "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ActivityWatch/ActivityWatchSyncService.cs"
click node_habitica "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Habitica/HabiticaSyncWorker.cs"
click node_telegram "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TelegramNotesSync.cs"
click node_settings "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/AppSettings.cs"
click node_platform "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Platform/PlatformServices.cs"
click node_appearance "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Desktop/DesktopPageAppearance.cs"
click node_themes "https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/AppThemeCatalog.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_sessions,node_session_manager,node_workspace_store,node_overlay,node_user toneBlue
class node_project_history,node_project_store,node_dashboard,node_obsidian_vault toneAmber
class node_notes_entry,node_notes_sync,node_notes_viewer,node_review,node_review_ui toneMint
class node_internet,node_activitywatch,node_habitica,node_telegram toneRose
class node_settings,node_platform,node_appearance,node_themes,node_habitica_service,node_telegram_service,node_activitywatch_service toneIndigo
```

## Components

### Timers and overlays

- [Timer controller](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/ControllerWindow.xaml.cs): `StopwatchOverlay/ControllerWindow.xaml.cs`
- [Timer sessions](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerSession.cs): `StopwatchOverlay.Core/TimerSession.cs`
- [Workspace manager](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerSessionManager.cs): `StopwatchOverlay.Core/TimerSessionManager.cs`
- [Workspace recovery](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TimerWorkspaceStore.cs): `StopwatchOverlay.Core/TimerWorkspaceStore.cs`
- [Floating overlays](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/OverlayWindow.xaml.cs): `StopwatchOverlay/OverlayWindow.xaml.cs`

### Project tracking

- [Work history](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ProjectTimeHistory.cs): `StopwatchOverlay.Core/ProjectTimeHistory.cs`
- [Project store](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ProjectTimeStore.cs): `StopwatchOverlay.Core/ProjectTimeStore.cs`
- [Project dashboard](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/ProjectDashboardWindow.xaml.cs): `StopwatchOverlay/ProjectDashboardWindow.xaml.cs`

### Notes and review

- [Quick capture](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/NoteEntryWindow.xaml.cs): `StopwatchOverlay/NoteEntryWindow.xaml.cs`
- [Obsidian notes](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ObsidianNotesSync.cs): `StopwatchOverlay.Core/ObsidianNotesSync.cs`
- [Notes viewer](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/NotesViewerWindow.xaml.cs): `StopwatchOverlay/NotesViewerWindow.xaml.cs`
- [Periodic review](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/PeriodicReview/PeriodicReviewService.cs): `StopwatchOverlay.Core/PeriodicReview/PeriodicReviewService.cs`
- [Review interface](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay/PeriodicReview/PeriodicReviewWindow.xaml.cs): `StopwatchOverlay/PeriodicReview/PeriodicReviewWindow.xaml.cs`

### Monitoring and sync

- [Internet monitor](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Internet/InternetMonitorService.cs): `StopwatchOverlay.Core/Internet/InternetMonitorService.cs`
- [ActivityWatch sync](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/ActivityWatch/ActivityWatchSyncService.cs): `StopwatchOverlay.Core/ActivityWatch/ActivityWatchSyncService.cs`
- [Habitica sync](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Habitica/HabiticaSyncWorker.cs): `StopwatchOverlay.Core/Habitica/HabiticaSyncWorker.cs`
- [Telegram notes](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/TelegramNotesSync.cs): `StopwatchOverlay.Core/TelegramNotesSync.cs`

### Desktop experience

- [App settings](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/AppSettings.cs): `StopwatchOverlay.Core/AppSettings.cs`
- [Platform services](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/Platform/PlatformServices.cs): `StopwatchOverlay.Core/Platform/PlatformServices.cs`
- [Page appearance](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Desktop/DesktopPageAppearance.cs): `StopwatchOverlay.Desktop/DesktopPageAppearance.cs`
- [Theme catalog](https://github.com/hosseinhayati128/stopwatch/blob/main/StopwatchOverlay.Core/AppThemeCatalog.cs): `StopwatchOverlay.Core/AppThemeCatalog.cs`

### Other components

- **User**
- **Obsidian vault**
- **Habitica**
- **Telegram**
- **ActivityWatch**

## Connections

- User → Timer controller: controls
- Timer controller → Workspace manager: manages timers (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Workspace manager → Timer sessions: creates sessions (evidence: `StopwatchOverlay.Core/TimerSessionManager.cs`)
- Timer controller → Workspace recovery: restores workspace (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Timer controller → Floating overlays: shows timers (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Timer controller → Work history: records work (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Timer controller → Project store: persists projects (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Project dashboard → Work history: reads history
- User → Project dashboard: reviews records
- User → Quick capture: captures notes
- Quick capture → Obsidian notes: saves entries
- Obsidian notes → Obsidian vault: writes dated notes (evidence: `StopwatchOverlay.Core/ObsidianNotesSync.cs`)
- Notes viewer → Obsidian notes: reads entries
- Timer controller → Periodic review: schedules reviews (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Periodic review → Review interface: requests prompt
- Review interface → Work history: aggregates activity (evidence: `StopwatchOverlay/PeriodicReview/PeriodicReviewWindow.xaml.cs`)
- Timer controller → Internet monitor: starts monitoring (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- Internet monitor → ActivityWatch sync: syncs activity
- ActivityWatch sync → ActivityWatch: transfers activity
- Obsidian notes → Habitica sync: syncs tasks (evidence: `StopwatchOverlay.Core/Habitica/HabiticaSyncWorker.cs`)
- Habitica sync → Habitica: updates tasks
- Obsidian notes → Telegram notes: syncs notes (evidence: `StopwatchOverlay.Core/ObsidianNotesSync.cs`)
- Telegram notes → Telegram: forwards notes
- Timer controller → App settings: uses preferences (evidence: `StopwatchOverlay/ControllerWindow.xaml.cs`)
- App settings → Page appearance: configures pages (evidence: `StopwatchOverlay.Desktop/DesktopPageAppearance.cs`)
- App settings → Theme catalog: selects theme (evidence: `StopwatchOverlay.Core/AppSettings.cs`)
- Timer controller → Platform services: uses desktop services
