# qingbird1983/qingbird-md architecture

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

- Interactive diagram: https://gitdiagram.com/qingbird1983/qingbird-md
- Repository: https://github.com/qingbird1983/qingbird-md

## Overview

Qingbird Markdown is a Tauri desktop Markdown editor and reader with streaming translation, document/workspace management, translation review, and screen-capture OCR. The primary workflow is opening or editing a Markdown document, rendering its preview, then translating selected text or the document and reviewing/exporting results. The graph also covers workspace browsing, settings, and background capture/hibernate capabilities documented in the README. Sampled source is partial; some subsystem links therefore rely on README architecture descriptions, and uncertain internal wiring is omitted.

Main entry points: [`src-tauri/src/bridge/commands.rs`](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/bridge/commands.rs) (Tauri command bridge), [`src/lib/ipc.ts`](https://github.com/qingbird1983/qingbird-md/blob/main/src/lib/ipc.ts) (Typed IPC client), [`src/components/MainArea.tsx`](https://github.com/qingbird1983/qingbird-md/blob/main/src/components/MainArea.tsx) (Editor and panels), [`src/stores/useTranslationStore.ts`](https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useTranslationStore.ts) (Translation interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Desktop interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_ui["Editor and panels<br/>[MainArea.tsx]"]
  node_stores["UI state stores<br/>[useDocStore.ts]"]
  node_ipc["Typed IPC client<br/>[ipc.ts]"]
end

subgraph group_documents["Documents and preview"]
  node_workspace_ui["Workspace browser"]
  node_editor["Document operations<br/>[editor.rs]"]
  node_workspace["Workspace operations<br/>[workspace.rs]"]
  node_markdown["Markdown renderer<br/>[mod.rs]"]
end

subgraph group_translation["Translation and review"]
  node_translation_ui["Translation interface"]
  node_review["Translation review"]
  node_export["Translation export<br/>[export.rs]"]
  node_worker["Translation worker<br/>[worker.rs]"]
  node_engine["Streaming engine<br/>[engine.rs]"]
  node_providers["Translation providers<br/>[mod.rs]"]
  node_cache[("Translation cache<br/>[cache_sqlite.rs]")]
end

subgraph group_desktop["Desktop services"]
  node_bridge["Tauri command bridge<br/>[commands.rs]"]
  node_settings[("Settings storage<br/>[storage.rs]")]
  node_capture["Screen capture OCR<br/>[orchestrate.rs]"]
  node_hotkeys["Global hotkeys<br/>[hotkeys.rs]"]
  node_hibernate["Window hibernation<br/>[mod.rs]"]
end

node_user(("User"))
node_service{{"Translation services"}}
node_os{{"Operating system"}}

node_user -->|"uses"| node_app
node_app -->|"renders"| node_ui
node_ui -->|"reads and updates"| node_stores
node_ui -->|"invokes"| node_ipc
node_workspace_ui -->|"requests workspace"| node_ipc
node_ipc -->|"sends commands"| node_bridge
node_bridge -->|"dispatches edits"| node_editor
node_bridge -->|"dispatches workspace"| node_workspace
node_workspace -->|"reads files"| node_os
node_bridge -->|"requests rendering"| node_markdown
node_translation_ui -->|"starts translation"| node_ipc
node_bridge -->|"spawns worker"| node_worker
node_worker -->|"runs translation"| node_engine
node_engine -->|"reads and writes"| node_cache
node_engine -->|"requests translation"| node_providers
node_providers -->|"sends requests"| node_service
node_worker -->|"emits progress and results"| node_translation_ui
node_review -->|"checks and applies"| node_ipc
node_translation_ui -->|"exports translations"| node_export
node_ui -->|"loads and saves settings"| node_settings
node_hotkeys -->|"starts capture"| node_capture
node_capture -->|"captures screen"| node_os
node_capture -->|"requests OCR"| node_service
node_os -->|"dispatches shortcuts"| node_hotkeys
node_hibernate -->|"manages webview"| node_os

click node_app "https://github.com/qingbird1983/qingbird-md/blob/main/src/App.tsx"
click node_ui "https://github.com/qingbird1983/qingbird-md/blob/main/src/components/MainArea.tsx"
click node_stores "https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useDocStore.ts"
click node_ipc "https://github.com/qingbird1983/qingbird-md/blob/main/src/lib/ipc.ts"
click node_workspace_ui "https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useWorkspaceStore.ts"
click node_editor "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/editor.rs"
click node_workspace "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/workspace.rs"
click node_markdown "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/markdown/mod.rs"
click node_translation_ui "https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useTranslationStore.ts"
click node_review "https://github.com/qingbird1983/qingbird-md/blob/main/src/hooks/useSemanticReview.ts"
click node_export "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/export.rs"
click node_bridge "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/bridge/commands.rs"
click node_worker "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/bridge/worker.rs"
click node_engine "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/engine.rs"
click node_providers "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/providers/mod.rs"
click node_cache "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/cache_sqlite.rs"
click node_settings "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/storage.rs"
click node_capture "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/capture/orchestrate.rs"
click node_hotkeys "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/hotkeys.rs"
click node_hibernate "https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/hibernate/mod.rs"

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_app,node_ui,node_stores,node_ipc,node_user toneBlue
class node_workspace_ui,node_editor,node_workspace,node_markdown toneAmber
class node_translation_ui,node_review,node_export,node_worker,node_engine,node_providers,node_cache toneMint
class node_bridge,node_settings,node_capture,node_hotkeys,node_hibernate toneRose
class node_service,node_os toneIndigo
```

## Components

### Desktop interface

- [Application shell](https://github.com/qingbird1983/qingbird-md/blob/main/src/App.tsx): `src/App.tsx`
- [Editor and panels](https://github.com/qingbird1983/qingbird-md/blob/main/src/components/MainArea.tsx): `src/components/MainArea.tsx`
- [UI state stores](https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useDocStore.ts): `src/stores/useDocStore.ts`
- [Typed IPC client](https://github.com/qingbird1983/qingbird-md/blob/main/src/lib/ipc.ts): `src/lib/ipc.ts`

### Documents and preview

- [Workspace browser](https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useWorkspaceStore.ts): `src/stores/useWorkspaceStore.ts`
- [Document operations](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/editor.rs): `src-tauri/src/editor.rs`
- [Workspace operations](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/workspace.rs): `src-tauri/src/workspace.rs`
- [Markdown renderer](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/markdown/mod.rs): `src-tauri/src/markdown/mod.rs`

### Translation and review

- [Translation interface](https://github.com/qingbird1983/qingbird-md/blob/main/src/stores/useTranslationStore.ts): `src/stores/useTranslationStore.ts`
- [Translation review](https://github.com/qingbird1983/qingbird-md/blob/main/src/hooks/useSemanticReview.ts): `src/hooks/useSemanticReview.ts`
- [Translation export](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/export.rs): `src-tauri/src/translate/export.rs`
- [Translation worker](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/bridge/worker.rs): `src-tauri/src/bridge/worker.rs`
- [Streaming engine](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/engine.rs): `src-tauri/src/translate/engine.rs`
- [Translation providers](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/providers/mod.rs): `src-tauri/src/translate/providers/mod.rs`
- [Translation cache](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/translate/cache_sqlite.rs): `src-tauri/src/translate/cache_sqlite.rs`

### Desktop services

- [Tauri command bridge](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/bridge/commands.rs): `src-tauri/src/bridge/commands.rs`
- [Settings storage](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/storage.rs): `src-tauri/src/storage.rs`
- [Screen capture OCR](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/capture/orchestrate.rs): `src-tauri/src/capture/orchestrate.rs`
- [Global hotkeys](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/hotkeys.rs): `src-tauri/src/hotkeys.rs`
- [Window hibernation](https://github.com/qingbird1983/qingbird-md/blob/main/src-tauri/src/hibernate/mod.rs): `src-tauri/src/hibernate/mod.rs`

### Other components

- **User**
- **Translation services**
- **Operating system**

## Connections

- User → Application shell: uses
- Application shell → Editor and panels: renders
- Editor and panels → UI state stores: reads and updates
- Editor and panels → Typed IPC client: invokes
- Workspace browser → Typed IPC client: requests workspace
- Typed IPC client → Tauri command bridge: sends commands
- Tauri command bridge → Document operations: dispatches edits
- Tauri command bridge → Workspace operations: dispatches workspace
- Workspace operations → Operating system: reads files
- Tauri command bridge → Markdown renderer: requests rendering
- Translation interface → Typed IPC client: starts translation
- Tauri command bridge → Translation worker: spawns worker
- Translation worker → Streaming engine: runs translation
- Streaming engine → Translation cache: reads and writes
- Streaming engine → Translation providers: requests translation
- Translation providers → Translation services: sends requests
- Translation worker → Translation interface: emits progress and results
- Translation review → Typed IPC client: checks and applies
- Translation interface → Translation export: exports translations
- Editor and panels → Settings storage: loads and saves settings
- Global hotkeys → Screen capture OCR: starts capture
- Screen capture OCR → Operating system: captures screen
- Screen capture OCR → Translation services: requests OCR
- Operating system → Global hotkeys: dispatches shortcuts
- Window hibernation → Operating system: manages webview
