# laofeng-mouse/flyingmouse-format architecture

> Architecture diagram of the GitHub repository laofeng-mouse/flyingmouse-format, 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/laofeng-mouse/flyingmouse-format
- Repository: https://github.com/laofeng-mouse/flyingmouse-format

## Overview

FlyingMouse Format is an offline desktop file-conversion application with a CLI. The main user workflow is selecting files and target formats in the UI, submitting conversion work, monitoring progress, then previewing or saving results. The graph preserves major README capabilities as domain branches, including advanced PDF processing, ebooks, media, and image conversion. Source excerpts are partial, so links between the server and specialized converters are shown only at the subsystem level; unsampled internal call chains are omitted.

Main entry points: [`server.js`](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/server.js) (Local server), [`public/app.js`](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/public/app.js) (Desktop UI), [`preload.js`](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/preload.js) (Secure bridge), [`pdf-structure-engine.js`](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf-structure-engine.js) (PDF structure engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_desktop["Electron app<br/>[electron-main.js]"]
  node_preload["Secure bridge<br/>[preload.js]"]
  node_ui["Desktop UI<br/>[app.js]"]
  node_cli["CLI<br/>[cli.js]"]
end

subgraph group_runtime["Conversion runtime"]
  node_server["Local server<br/>[server.js]"]
  node_progress["Progress tracking"]
  node_downloads["Result delivery"]
end

subgraph group_formats["Format conversion"]
  node_office["Office conversion<br/>[office-convert.js]"]
  node_office_engine["Office engine<br/>[office-engine.js]"]
  node_text["Text conversion<br/>[text-conversion.js]"]
  node_markdown["Markdown documents"]
  node_ebook["Ebook conversion<br/>[ebook.js]"]
  node_media["Media conversion<br/>[media.js]"]
  node_images["Image conversion"]
end

subgraph group_pdf["PDF processing"]
  node_pdf["PDF operations<br/>[pdf.js]"]
  node_pdf_tables["PDF tables<br/>[pdf-table.js]"]
  node_pdf_structure["PDF structure engine"]
  node_docstructure["Document structure engine<br/>[pipeline.py]"]
end

subgraph group_support["Preferences and access"]
  node_settings[("Settings store<br/>[settings-store.js]")]
  node_agent["Agent skill setup"]
end

node_user(("User"))
node_agent_dirs[("Agent directories")]
node_office_bundle["LibreOffice runtime"]

node_user -->|"selects files"| node_ui
node_user -->|"runs commands"| node_cli
node_desktop -->|"exposes bridge"| node_preload
node_ui -->|"requests settings"| node_preload
node_ui -->|"submits conversions"| node_server
node_cli -->|"requests conversion"| node_server
node_server -->|"reports progress"| node_progress
node_server -->|"dispatches work"| node_office
node_server -->|"dispatches work"| node_text
node_server -->|"dispatches work"| node_ebook
node_server -->|"dispatches work"| node_media
node_server -->|"dispatches work"| node_images
node_server -->|"dispatches work"| node_pdf
node_server -->|"dispatches work"| node_pdf_tables
node_office -->|"runs engine"| node_office_engine
node_office_engine -->|"invokes"| node_office_bundle
node_pdf -->|"requests structure"| node_pdf_structure
node_pdf_tables -->|"requests extraction"| node_pdf_structure
node_pdf_structure -->|"invokes engine"| node_docstructure
node_server -->|"registers results"| node_downloads
node_ui -->|"fetches results"| node_server
node_preload -->|"reads and writes"| node_settings
node_ui -->|"renders documents"| node_markdown
node_ui -->|"starts setup"| node_agent
node_agent -->|"installs skill"| node_agent_dirs

click node_desktop "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/electron-main.js"
click node_preload "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/preload.js"
click node_ui "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/public/app.js"
click node_cli "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/cli.js"
click node_server "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/server.js"
click node_progress "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/conversion-progress.js"
click node_downloads "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/save-converted-result.js"
click node_office "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/office-convert.js"
click node_office_engine "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/office-engine.js"
click node_text "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/text-conversion.js"
click node_markdown "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/markdown-document.js"
click node_ebook "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/ebook.js"
click node_media "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/media.js"
click node_images "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/image-conversion.js"
click node_pdf "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf.js"
click node_pdf_tables "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf-table.js"
click node_pdf_structure "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf-structure-engine.js"
click node_docstructure "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/tools/docstructure-engine/flyingmouse_docstructure/pipeline.py"
click node_settings "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/settings-store.js"
click node_agent "https://github.com/laofeng-mouse/flyingmouse-format/blob/main/agent-skill-installer.js"

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_desktop,node_preload,node_ui,node_cli,node_user toneBlue
class node_server,node_progress,node_downloads,node_agent_dirs toneAmber
class node_office,node_office_engine,node_text,node_markdown,node_ebook,node_media,node_images toneMint
class node_pdf,node_pdf_tables,node_pdf_structure,node_docstructure toneRose
class node_settings,node_agent,node_office_bundle toneIndigo
```

## Components

### User interfaces

- [Electron app](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/electron-main.js): `electron-main.js`
- [Secure bridge](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/preload.js): `preload.js`
- [Desktop UI](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/public/app.js): `public/app.js`
- [CLI](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/cli.js): `cli.js`

### Conversion runtime

- [Local server](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/server.js): `server.js`
- [Progress tracking](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/conversion-progress.js): `conversion-progress.js`
- [Result delivery](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/save-converted-result.js): `save-converted-result.js`

### Format conversion

- [Office conversion](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/office-convert.js): `office-convert.js`
- [Office engine](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/office-engine.js): `office-engine.js`
- [Text conversion](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/text-conversion.js): `text-conversion.js`
- [Markdown documents](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/markdown-document.js): `markdown-document.js`
- [Ebook conversion](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/ebook.js): `ebook.js`
- [Media conversion](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/media.js): `media.js`
- [Image conversion](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/image-conversion.js): `image-conversion.js`

### PDF processing

- [PDF operations](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf.js): `pdf.js`
- [PDF tables](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf-table.js): `pdf-table.js`
- [PDF structure engine](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/pdf-structure-engine.js): `pdf-structure-engine.js`
- [Document structure engine](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/tools/docstructure-engine/flyingmouse_docstructure/pipeline.py): `tools/docstructure-engine/flyingmouse_docstructure/pipeline.py`

### Preferences and access

- [Settings store](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/settings-store.js): `settings-store.js`
- [Agent skill setup](https://github.com/laofeng-mouse/flyingmouse-format/blob/main/agent-skill-installer.js): `agent-skill-installer.js`

### Other components

- **User**
- **Agent directories**
- **LibreOffice runtime**

## Connections

- User → Desktop UI: selects files
- User → CLI: runs commands
- Electron app → Secure bridge: exposes bridge
- Desktop UI → Secure bridge: requests settings
- Desktop UI → Local server: submits conversions
- CLI → Local server: requests conversion
- Local server → Progress tracking: reports progress
- Local server → Office conversion: dispatches work
- Local server → Text conversion: dispatches work
- Local server → Ebook conversion: dispatches work
- Local server → Media conversion: dispatches work
- Local server → Image conversion: dispatches work
- Local server → PDF operations: dispatches work
- Local server → PDF tables: dispatches work
- Office conversion → Office engine: runs engine
- Office engine → LibreOffice runtime: invokes
- PDF operations → PDF structure engine: requests structure
- PDF tables → PDF structure engine: requests extraction
- PDF structure engine → Document structure engine: invokes engine
- Local server → Result delivery: registers results
- Desktop UI → Local server: fetches results
- Secure bridge → Settings store: reads and writes
- Desktop UI → Markdown documents: renders documents
- Desktop UI → Agent skill setup: starts setup
- Agent skill setup → Agent directories: installs skill
