# vastnext/glancemd-ultra architecture

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

- Interactive diagram: https://gitdiagram.com/vastnext/glancemd-ultra
- Repository: https://github.com/vastnext/glancemd-ultra

## Overview

GlanceMD Ultra is a native Markdown workspace editor. The principal workflow is opening a local folder, browsing and editing its files, then saving changes while the workspace provides file operations, search, watching, and recovery. The frontend also provides preview, outline, settings, keybindings, and translation features. Rust starts the WebView and dispatches frontend IPC into command handlers and workspace services. The graph preserves README-documented capabilities; some frontend wiring and unsampled subsystem links are shown only as unverified or omitted.

Main entry points: [`src/commands.rs`](https://github.com/vastnext/glancemd-ultra/blob/main/src/commands.rs) (Command handlers), [`src/ipc.rs`](https://github.com/vastnext/glancemd-ultra/blob/main/src/ipc.rs) (IPC bridge), [`src/main.rs`](https://github.com/vastnext/glancemd-ultra/blob/main/src/main.rs) (Native WebView app), [`src/frontend/editor.js`](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/editor.js) (Editor and tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_runtime["Native WebView app<br/>[main.rs]"]
  node_ipc["IPC bridge<br/>[ipc.rs]"]
  node_commands["Command handlers<br/>[commands.rs]"]
end

subgraph group_frontend["Editor frontend"]
  node_editor["Editor and tabs<br/>[editor.js]"]
  node_preview["Markdown preview<br/>[preview.js]"]
  node_tree["Project tree UI<br/>[project-tree.js]"]
  node_searchui["Search panel<br/>[search-panel.js]"]
  node_outline["Outline navigation<br/>[outline.js]"]
  node_settingsui["Settings and keys<br/>[settings.js]"]
  node_translateui["Translation UI<br/>[translate.js]"]
end

subgraph group_workspace["Workspace services"]
  node_workspace["Workspace core<br/>[mod.rs]"]
  node_operations["File operations<br/>[operations.rs]"]
  node_treecore["Tree scanning<br/>[tree.rs]"]
  node_search["Project search<br/>[search.rs]"]
  node_session["Workspace session<br/>[session.rs]"]
  node_watcher["File watcher<br/>[watcher.rs]"]
  node_recovery["Crash recovery<br/>[recovery.rs]"]
  node_settings["Settings storage<br/>[settings.rs]"]
  node_codec["Text file codec<br/>[file_codec.rs]"]
  node_atomic["Atomic saving<br/>[atomic_save.rs]"]
end

subgraph group_translation["Translation"]
  node_translator["Translation engines<br/>[translate.rs]"]
  node_network["Network utilities<br/>[net.rs]"]
  node_providers(("Translation providers"))
end

subgraph group_system["System integration"]
  node_platform["Platform services<br/>[mod.rs]"]
  node_terminal["Terminal opener<br/>[terminal.rs]"]
  node_pandoc["Document export<br/>[pandoc.rs]"]
end

node_user(("Editor user"))

node_user -->|"opens workspace"| node_runtime
node_runtime -->|"routes IPC"| node_ipc
node_ipc -->|"dispatches commands"| node_commands
node_commands -->|"opens workspace"| node_workspace
node_commands -->|"runs operations"| node_operations
node_commands -->|"requests tree"| node_treecore
node_commands -->|"starts search"| node_search
node_commands -->|"uses session"| node_session
node_commands -->|"uses watcher"| node_watcher
node_commands -->|"uses recovery"| node_recovery
node_commands -->|"loads settings"| node_settings
node_commands -->|"reads and writes"| node_codec
node_commands -->|"saves atomically"| node_atomic
node_commands -->|"requests translation"| node_translator
node_commands -->|"uses network tools"| node_network
node_translator -.->|"sends translation requests"| node_providers
node_user -->|"edits documents"| node_editor
node_user -->|"browses files"| node_tree
node_user -->|"reads preview"| node_preview
node_user -->|"searches project"| node_searchui
node_user -->|"jumps headings"| node_outline
node_user -->|"configures editor"| node_settingsui
node_user -->|"translates text"| node_translateui
node_editor -.->|"sends commands"| node_ipc
node_tree -.->|"sends commands"| node_ipc
node_searchui -.->|"sends commands"| node_ipc
node_settingsui -.->|"sends commands"| node_ipc
node_translateui -.->|"sends commands"| node_ipc
node_operations -.->|"uses platform operations"| node_platform
node_platform -->|"selects terminal"| node_terminal
node_runtime -.->|"supports export"| node_pandoc

click node_runtime "https://github.com/vastnext/glancemd-ultra/blob/main/src/main.rs"
click node_ipc "https://github.com/vastnext/glancemd-ultra/blob/main/src/ipc.rs"
click node_commands "https://github.com/vastnext/glancemd-ultra/blob/main/src/commands.rs"
click node_editor "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/editor.js"
click node_preview "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/preview.js"
click node_tree "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/project-tree.js"
click node_searchui "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/search-panel.js"
click node_outline "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/outline.js"
click node_settingsui "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/settings.js"
click node_translateui "https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/translate.js"
click node_workspace "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/mod.rs"
click node_operations "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/operations.rs"
click node_treecore "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/tree.rs"
click node_search "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/search.rs"
click node_session "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/session.rs"
click node_watcher "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/watcher.rs"
click node_recovery "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/recovery.rs"
click node_settings "https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/settings.rs"
click node_codec "https://github.com/vastnext/glancemd-ultra/blob/main/src/file_codec.rs"
click node_atomic "https://github.com/vastnext/glancemd-ultra/blob/main/src/atomic_save.rs"
click node_translator "https://github.com/vastnext/glancemd-ultra/blob/main/src/translate.rs"
click node_network "https://github.com/vastnext/glancemd-ultra/blob/main/src/net.rs"
click node_platform "https://github.com/vastnext/glancemd-ultra/blob/main/src/platform/mod.rs"
click node_terminal "https://github.com/vastnext/glancemd-ultra/blob/main/src/platform/terminal.rs"
click node_pandoc "https://github.com/vastnext/glancemd-ultra/blob/main/src/pandoc.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_runtime,node_ipc,node_commands,node_user toneBlue
class node_editor,node_preview,node_tree,node_searchui,node_outline,node_settingsui,node_translateui toneAmber
class node_workspace,node_operations,node_treecore,node_search,node_session,node_watcher,node_recovery,node_settings,node_codec,node_atomic toneMint
class node_translator,node_network,node_providers toneRose
class node_platform,node_terminal,node_pandoc toneIndigo
```

## Components

### Application shell

- [Native WebView app](https://github.com/vastnext/glancemd-ultra/blob/main/src/main.rs): `src/main.rs`
- [IPC bridge](https://github.com/vastnext/glancemd-ultra/blob/main/src/ipc.rs): `src/ipc.rs`
- [Command handlers](https://github.com/vastnext/glancemd-ultra/blob/main/src/commands.rs): `src/commands.rs`

### Editor frontend

- [Editor and tabs](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/editor.js): `src/frontend/editor.js`
- [Markdown preview](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/preview.js): `src/frontend/preview.js`
- [Project tree UI](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/project-tree.js): `src/frontend/project-tree.js`
- [Search panel](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/search-panel.js): `src/frontend/search-panel.js`
- [Outline navigation](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/outline.js): `src/frontend/outline.js`
- [Settings and keys](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/settings.js): `src/frontend/settings.js`
- [Translation UI](https://github.com/vastnext/glancemd-ultra/blob/main/src/frontend/translate.js): `src/frontend/translate.js`

### Workspace services

- [Workspace core](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/mod.rs): `src/workspace/mod.rs`
- [File operations](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/operations.rs): `src/workspace/operations.rs`
- [Tree scanning](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/tree.rs): `src/workspace/tree.rs`
- [Project search](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/search.rs): `src/workspace/search.rs`
- [Workspace session](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/session.rs): `src/workspace/session.rs`
- [File watcher](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/watcher.rs): `src/workspace/watcher.rs`
- [Crash recovery](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/recovery.rs): `src/workspace/recovery.rs`
- [Settings storage](https://github.com/vastnext/glancemd-ultra/blob/main/src/workspace/settings.rs): `src/workspace/settings.rs`
- [Text file codec](https://github.com/vastnext/glancemd-ultra/blob/main/src/file_codec.rs): `src/file_codec.rs`
- [Atomic saving](https://github.com/vastnext/glancemd-ultra/blob/main/src/atomic_save.rs): `src/atomic_save.rs`

### Translation

- [Translation engines](https://github.com/vastnext/glancemd-ultra/blob/main/src/translate.rs): `src/translate.rs`
- [Network utilities](https://github.com/vastnext/glancemd-ultra/blob/main/src/net.rs): `src/net.rs`
- **Translation providers**

### System integration

- [Platform services](https://github.com/vastnext/glancemd-ultra/blob/main/src/platform/mod.rs): `src/platform/mod.rs`
- [Terminal opener](https://github.com/vastnext/glancemd-ultra/blob/main/src/platform/terminal.rs): `src/platform/terminal.rs`
- [Document export](https://github.com/vastnext/glancemd-ultra/blob/main/src/pandoc.rs): `src/pandoc.rs`

### Other components

- **Editor user**

## Connections

- Editor user → Native WebView app: opens workspace (evidence: `README.md`)
- Native WebView app → IPC bridge: routes IPC (evidence: `src/main.rs`)
- IPC bridge → Command handlers: dispatches commands (evidence: `src/ipc.rs`)
- Command handlers → Workspace core: opens workspace (evidence: `src/commands.rs`)
- Command handlers → File operations: runs operations (evidence: `src/commands.rs`)
- Command handlers → Tree scanning: requests tree (evidence: `src/commands.rs`)
- Command handlers → Project search: starts search (evidence: `src/commands.rs`)
- Command handlers → Workspace session: uses session (evidence: `src/commands.rs`)
- Command handlers → File watcher: uses watcher (evidence: `src/commands.rs`)
- Command handlers → Crash recovery: uses recovery (evidence: `src/commands.rs`)
- Command handlers → Settings storage: loads settings (evidence: `src/commands.rs`)
- Command handlers → Text file codec: reads and writes (evidence: `src/commands.rs`)
- Command handlers → Atomic saving: saves atomically (evidence: `src/commands.rs`)
- Command handlers → Translation engines: requests translation (evidence: `src/commands.rs`)
- Command handlers → Network utilities: uses network tools (evidence: `src/commands.rs`)
- Translation engines → Translation providers: sends translation requests
- Editor user → Editor and tabs: edits documents (evidence: `README.md`)
- Editor user → Project tree UI: browses files (evidence: `README.md`)
- Editor user → Markdown preview: reads preview (evidence: `README.md`)
- Editor user → Search panel: searches project (evidence: `README.md`)
- Editor user → Outline navigation: jumps headings (evidence: `README.md`)
- Editor user → Settings and keys: configures editor (evidence: `README.md`)
- Editor user → Translation UI: translates text (evidence: `README.md`)
- Editor and tabs → IPC bridge: sends commands
- Project tree UI → IPC bridge: sends commands
- Search panel → IPC bridge: sends commands
- Settings and keys → IPC bridge: sends commands
- Translation UI → IPC bridge: sends commands
- File operations → Platform services: uses platform operations
- Platform services → Terminal opener: selects terminal (evidence: `src/platform/mod.rs`)
- Native WebView app → Document export: supports export (evidence: `src/main.rs`)
