# ah23333/starmarkdesktop architecture

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

- Interactive diagram: https://gitdiagram.com/ah23333/starmarkdesktop
- Repository: https://github.com/ah23333/starmarkdesktop

## Overview

StarMarkDesktop is a Windows desktop hub for searching and managing locally stored items gathered from several sources. The principal workflow is a user search in the main window, coordinated across SQLite full-text search and available live sources, then merged and shown as results. Separate branches cover source synchronization, desktop widgets, capture/OCR, and supporting capabilities such as feeds, AI classification, and backup. Edges rely on the README’s architecture and capability descriptions or shown source references; unsampled implementation details are not inferred.

Main entry points: [`src/StarMark.Core/Sync/SyncCoordinator.cs`](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Sync/SyncCoordinator.cs) (Source synchronization), [`src/StarMark.Data/ItemRepository.Search.cs`](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Data/ItemRepository.Search.cs) (Item repository), [`src/StarMark.UI/Services/WidgetManager.cs`](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/WidgetManager.cs) (Widget manager), [`src/StarMark.Core/Search/SearchService.cs`](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Search/SearchService.cs) (Search orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_mainui["Main window<br/>[MainWindow.xaml.cs]"]
  node_searchui["Search page<br/>[SearchPage.xaml.cs]"]
  node_results["Result cards<br/>[ItemCard.xaml.cs]"]
end

subgraph group_searchdata["Search and storage"]
  node_search["Search orchestration<br/>[SearchService.cs]"]
  node_repository["Item repository"]
  node_sqlite[("SQLite and FTS5")]
  node_sync["Source synchronization<br/>[SyncCoordinator.cs]"]
end

subgraph group_sources["Sources and integrations"]
  node_github["GitHub Stars<br/>[GitHubSource.cs]"]
  node_bookmarks["Browser bookmarks"]
  node_everything["Local file search"]
  node_clipboard["Clipboard history"]
  node_ditto["Ditto import<br/>[DittoSource.cs]"]
end

subgraph group_desktop["Desktop features"]
  node_widgets["Widget manager<br/>[WidgetManager.cs]"]
  node_widgetstore["Widget persistence<br/>[WidgetStorage.cs]"]
  node_weather["Weather widget<br/>[OpenMeteoClient.cs]"]
  node_media["Media controls"]
  node_capture["Screen capture"]
  node_ocr["OCR pipeline<br/>[OcrPipeline.cs]"]
  node_ocrengine["Screen OCR reader<br/>[ScreenOcrReader.cs]"]
end

subgraph group_support["Supporting services"]
  node_feeds["RSS feeds<br/>[RssAggregator.cs]"]
  node_trending["Trending repositories<br/>[TrendingService.cs]"]
  node_ai["AI classification"]
  node_backup["Backup and restore<br/>[BackupService.cs]"]
end

node_user(("User"))

node_user -->|"uses"| node_mainui
node_mainui -->|"opens"| node_searchui
node_searchui -->|"searches"| node_search
node_search -->|"queries"| node_repository
node_search -->|"dispatches"| node_everything
node_repository -.->|"reads and writes"| node_sqlite
node_repository -.->|"returns items"| node_results
node_sync -->|"upserts"| node_repository
node_sync -->|"syncs stars"| node_github
node_sync -->|"reads sources"| node_bookmarks
node_sync -.->|"imports history"| node_clipboard
node_sync -->|"reads history"| node_ditto
node_widgets -->|"persists layout"| node_widgetstore
node_widgets -->|"shows weather"| node_weather
node_widgets -->|"controls playback"| node_media
node_ocr -->|"recognizes text"| node_ocrengine
node_capture -.->|"supplies pixels"| node_ocr

click node_mainui "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/MainWindow.xaml.cs"
click node_searchui "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Views/SearchPage.xaml.cs"
click node_results "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Controls/ItemCard.xaml.cs"
click node_search "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Search/SearchService.cs"
click node_repository "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Data/ItemRepository.Search.cs"
click node_sqlite "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Data/DbConnectionFactory.cs"
click node_sync "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Sync/SyncCoordinator.cs"
click node_github "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/GitHub/GitHubSource.cs"
click node_bookmarks "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Bookmarks/BrowserBookmarksSource.cs"
click node_everything "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Everything/EverythingQueryQueue.cs"
click node_clipboard "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Clipboard/ClipboardWatcher.cs"
click node_ditto "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Ditto/DittoSource.cs"
click node_widgets "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/WidgetManager.cs"
click node_widgetstore "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Widgets/WidgetStorage.cs"
click node_weather "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Weather/OpenMeteoClient.cs"
click node_media "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/MediaSessionService.cs"
click node_capture "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/ScreenshotService.cs"
click node_ocr "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Ocr/OcrPipeline.cs"
click node_ocrengine "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Ocr/ScreenOcrReader.cs"
click node_feeds "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Feed/RssAggregator.cs"
click node_trending "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Trending/TrendingService.cs"
click node_ai "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/AiClassifyService.cs"
click node_backup "https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Backup/BackupService.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_mainui,node_searchui,node_results,node_user toneBlue
class node_search,node_repository,node_sqlite,node_sync toneAmber
class node_github,node_bookmarks,node_everything,node_clipboard,node_ditto toneMint
class node_widgets,node_widgetstore,node_weather,node_media,node_capture,node_ocr,node_ocrengine toneRose
class node_feeds,node_trending,node_ai,node_backup toneIndigo
```

## Components

### Desktop interface

- [Main window](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/MainWindow.xaml.cs): `src/StarMark.UI/MainWindow.xaml.cs`
- [Search page](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Views/SearchPage.xaml.cs): `src/StarMark.UI/Views/SearchPage.xaml.cs`
- [Result cards](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Controls/ItemCard.xaml.cs): `src/StarMark.UI/Controls/ItemCard.xaml.cs`

### Search and storage

- [Search orchestration](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Search/SearchService.cs): `src/StarMark.Core/Search/SearchService.cs`
- [Item repository](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Data/ItemRepository.Search.cs): `src/StarMark.Data/ItemRepository.Search.cs`
- [SQLite and FTS5](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Data/DbConnectionFactory.cs): `src/StarMark.Data/DbConnectionFactory.cs`
- [Source synchronization](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Sync/SyncCoordinator.cs): `src/StarMark.Core/Sync/SyncCoordinator.cs`

### Sources and integrations

- [GitHub Stars](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/GitHub/GitHubSource.cs): `src/StarMark.Integrations/GitHub/GitHubSource.cs`
- [Browser bookmarks](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Bookmarks/BrowserBookmarksSource.cs): `src/StarMark.Integrations/Bookmarks/BrowserBookmarksSource.cs`
- [Local file search](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Everything/EverythingQueryQueue.cs): `src/StarMark.Integrations/Everything/EverythingQueryQueue.cs`
- [Clipboard history](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Clipboard/ClipboardWatcher.cs): `src/StarMark.Integrations/Clipboard/ClipboardWatcher.cs`
- [Ditto import](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Ditto/DittoSource.cs): `src/StarMark.Integrations/Ditto/DittoSource.cs`

### Desktop features

- [Widget manager](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/WidgetManager.cs): `src/StarMark.UI/Services/WidgetManager.cs`
- [Widget persistence](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Widgets/WidgetStorage.cs): `src/StarMark.Core/Widgets/WidgetStorage.cs`
- [Weather widget](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Weather/OpenMeteoClient.cs): `src/StarMark.Integrations/Weather/OpenMeteoClient.cs`
- [Media controls](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/MediaSessionService.cs): `src/StarMark.UI/Services/MediaSessionService.cs`
- [Screen capture](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/ScreenshotService.cs): `src/StarMark.UI/Services/ScreenshotService.cs`
- [OCR pipeline](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Ocr/OcrPipeline.cs): `src/StarMark.Core/Ocr/OcrPipeline.cs`
- [Screen OCR reader](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Integrations/Ocr/ScreenOcrReader.cs): `src/StarMark.Integrations/Ocr/ScreenOcrReader.cs`

### Supporting services

- [RSS feeds](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Feed/RssAggregator.cs): `src/StarMark.Core/Feed/RssAggregator.cs`
- [Trending repositories](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Trending/TrendingService.cs): `src/StarMark.Core/Trending/TrendingService.cs`
- [AI classification](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.UI/Services/AiClassifyService.cs): `src/StarMark.UI/Services/AiClassifyService.cs`
- [Backup and restore](https://github.com/ah23333/starmarkdesktop/blob/main/src/StarMark.Core/Backup/BackupService.cs): `src/StarMark.Core/Backup/BackupService.cs`

### Other components

- **User**

## Connections

- User → Main window: uses
- Main window → Search page: opens
- Search page → Search orchestration: searches
- Search orchestration → Item repository: queries (evidence: `src/StarMark.Core/Search/SearchService.cs`)
- Search orchestration → Local file search: dispatches (evidence: `src/StarMark.Core/Search/SearchService.cs`)
- Item repository → SQLite and FTS5: reads and writes
- Item repository → Result cards: returns items
- Source synchronization → Item repository: upserts
- Source synchronization → GitHub Stars: syncs stars
- Source synchronization → Browser bookmarks: reads sources
- Source synchronization → Clipboard history: imports history
- Source synchronization → Ditto import: reads history
- Widget manager → Widget persistence: persists layout
- Widget manager → Weather widget: shows weather
- Widget manager → Media controls: controls playback
- OCR pipeline → Screen OCR reader: recognizes text (evidence: `src/StarMark.Core/Ocr/OcrPipeline.cs`)
- Screen capture → OCR pipeline: supplies pixels
