# dinhducquan/genoffice architecture

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

- Interactive diagram: https://gitdiagram.com/dinhducquan/genoffice
- Repository: https://github.com/dinhducquan/genoffice

## Overview

GenOffice is a desktop AI office suite for editing Word, spreadsheet, presentation, PDF, Markdown, and HTML documents in their native or supported formats. Users open or find a local file, edit it directly or request an AI-assisted change, review and undo edits, then save or export. The graph emphasizes the documented cross-product workflow and the sampled HTML/PDF internals; unsampled product branches are represented at their source directories. The README documents capabilities that are not all visible in the excerpts, so those relationships cite the README.

Main entry points: [`apps/shell/src/main/tab-manager.ts`](https://github.com/dinhducquan/genoffice/blob/main/apps/shell/src/main/tab-manager.ts) (Tab manager), [`apps/html/src/renderer/App.tsx`](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/App.tsx) (HTML editor), [`apps/markdown/src/renderer/App.tsx`](https://github.com/dinhducquan/genoffice/blob/main/apps/markdown/src/renderer/App.tsx) (Markdown editor), [`apps/sheets/src/renderer/App.tsx`](https://github.com/dinhducquan/genoffice/blob/main/apps/sheets/src/renderer/App.tsx) (Spreadsheet editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Desktop shell"]
  node_shellui["Home and tabs<br/>[main.tsx]"]
  node_tabmgr["Tab manager<br/>[tab-manager.ts]"]
  node_fileindex[("Local file search")]
end

subgraph group_editors["Document editors"]
  node_htmlapp["HTML editor<br/>[App.tsx]"]
  node_htmlmain["HTML file services<br/>[html-main.ts]"]
  node_htmlpreview["Live preview<br/>[PreviewFrame.tsx]"]
  node_htmldoc["HTML document model<br/>[parse-map.ts]"]
  node_mdapp["Markdown editor<br/>[App.tsx]"]
  node_mdops["Markdown editing<br/>[ops.ts]"]
  node_pdfapp["PDF editor<br/>[App.tsx]"]
  node_pdfmain["PDF file services<br/>[pdf-main.ts]"]
  node_sheetsapp["Spreadsheet editor<br/>[App.tsx]"]
  node_slidesapp["Slides editor<br/>[App.tsx]"]
end

subgraph group_ai["AI assistance"]
  node_aiassistant["AI document agent<br/>[AiPanel.tsx]"]
  node_aitransport["AI provider transport<br/>[transport.ts]"]
end

subgraph group_formats["Format services"]
  node_xlsxengine["XLSX engine<br/>[main.rs]"]
  node_pdfconvert["PDF conversion pipeline<br/>[pipeline.ts]"]
end

subgraph group_automation["Search and automation"]
  node_cli["Command-line tools<br/>[preview.ts]"]
  node_mcp["MCP server<br/>[server.ts]"]
end

node_person(("User"))
node_provider{{"Chosen AI provider"}}
node_localfiles["Local documents"]

node_person -->|"opens suite"| node_shellui
node_shellui -->|"manages tabs"| node_tabmgr
node_person -->|"searches files"| node_fileindex
node_fileindex -->|"returns matches"| node_shellui
node_person -->|"opens document"| node_tabmgr
node_tabmgr -->|"creates HTML view"| node_htmlmain
node_tabmgr -->|"opens Markdown"| node_mdapp
node_tabmgr -->|"creates PDF view"| node_pdfmain
node_tabmgr -->|"queues workbook"| node_sheetsapp
node_tabmgr -->|"opens slides"| node_slidesapp
node_localfiles -->|"opens and edits"| node_htmlapp
node_localfiles -->|"opens and edits"| node_mdapp
node_localfiles -->|"opens and edits"| node_pdfapp
node_localfiles -->|"opens and edits"| node_sheetsapp
node_localfiles -->|"opens and edits"| node_slidesapp
node_htmlapp -->|"parses document"| node_htmldoc
node_htmlapp -->|"updates preview"| node_htmlpreview
node_htmlapp -->|"saves document"| node_htmlmain
node_mdapp -->|"applies edits"| node_mdops
node_mdapp -->|"saves document"| node_localfiles
node_pdfapp -->|"saves PDF"| node_pdfmain
node_sheetsapp -->|"uses workbook engine"| node_xlsxengine
node_sheetsapp -->|"saves workbook"| node_localfiles
node_slidesapp -->|"saves presentation"| node_localfiles
node_person -->|"requests edits"| node_aiassistant
node_htmlapp -->|"hosts panel"| node_aiassistant
node_aiassistant -.->|"sends request"| node_aitransport
node_aitransport -->|"calls provider"| node_provider
node_aiassistant -->|"proposes changes"| node_htmlapp
node_person -->|"converts PDF"| node_pdfconvert
node_pdfconvert -->|"writes converted file"| node_localfiles
node_person -->|"runs commands"| node_cli
node_cli -->|"reads or edits"| node_localfiles
node_person -->|"connects agent"| node_mcp
node_mcp -->|"runs registered tools"| node_cli

click node_shellui "https://github.com/dinhducquan/genoffice/blob/main/apps/shell/src/renderer/src/main.tsx"
click node_tabmgr "https://github.com/dinhducquan/genoffice/blob/main/apps/shell/src/main/tab-manager.ts"
click node_fileindex "https://github.com/dinhducquan/genoffice/tree/main/apps/shell/src/main/file-index"
click node_htmlapp "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/App.tsx"
click node_htmlmain "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/main/html-main.ts"
click node_htmlpreview "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/preview/PreviewFrame.tsx"
click node_htmldoc "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/document/parse-map.ts"
click node_mdapp "https://github.com/dinhducquan/genoffice/blob/main/apps/markdown/src/renderer/App.tsx"
click node_mdops "https://github.com/dinhducquan/genoffice/blob/main/apps/markdown/src/renderer/editor/ops.ts"
click node_pdfapp "https://github.com/dinhducquan/genoffice/blob/main/apps/pdf/src/renderer/App.tsx"
click node_pdfmain "https://github.com/dinhducquan/genoffice/blob/main/apps/pdf/src/main/pdf-main.ts"
click node_sheetsapp "https://github.com/dinhducquan/genoffice/blob/main/apps/sheets/src/renderer/App.tsx"
click node_xlsxengine "https://github.com/dinhducquan/genoffice/blob/main/apps/sheets/native/xlsx-engine/src/main.rs"
click node_slidesapp "https://github.com/dinhducquan/genoffice/blob/main/apps/slides/src/renderer/App.tsx"
click node_aiassistant "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/ai/AiPanel.tsx"
click node_aitransport "https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/ai/transport.ts"
click node_pdfconvert "https://github.com/dinhducquan/genoffice/blob/main/packages/pdf2docx/src/pipeline.ts"
click node_cli "https://github.com/dinhducquan/genoffice/blob/main/packages/cli/src/preview.ts"
click node_mcp "https://github.com/dinhducquan/genoffice/blob/main/packages/cli/src/mcp/server.ts"

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_shellui,node_tabmgr,node_fileindex,node_person toneBlue
class node_htmlapp,node_htmlmain,node_htmlpreview,node_htmldoc,node_mdapp,node_mdops,node_pdfapp,node_pdfmain,node_sheetsapp,node_slidesapp toneAmber
class node_aiassistant,node_aitransport toneMint
class node_xlsxengine,node_pdfconvert toneRose
class node_cli,node_mcp,node_provider,node_localfiles toneIndigo
```

## Components

### Desktop shell

- [Home and tabs](https://github.com/dinhducquan/genoffice/blob/main/apps/shell/src/renderer/src/main.tsx): `apps/shell/src/renderer/src/main.tsx`
- [Tab manager](https://github.com/dinhducquan/genoffice/blob/main/apps/shell/src/main/tab-manager.ts): `apps/shell/src/main/tab-manager.ts`
- [Local file search](https://github.com/dinhducquan/genoffice/tree/main/apps/shell/src/main/file-index): `apps/shell/src/main/file-index`

### Document editors

- [HTML editor](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/App.tsx): `apps/html/src/renderer/App.tsx`
- [HTML file services](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/main/html-main.ts): `apps/html/src/main/html-main.ts`
- [Live preview](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/preview/PreviewFrame.tsx): `apps/html/src/renderer/preview/PreviewFrame.tsx`
- [HTML document model](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/document/parse-map.ts): `apps/html/src/renderer/document/parse-map.ts`
- [Markdown editor](https://github.com/dinhducquan/genoffice/blob/main/apps/markdown/src/renderer/App.tsx): `apps/markdown/src/renderer/App.tsx`
- [Markdown editing](https://github.com/dinhducquan/genoffice/blob/main/apps/markdown/src/renderer/editor/ops.ts): `apps/markdown/src/renderer/editor/ops.ts`
- [PDF editor](https://github.com/dinhducquan/genoffice/blob/main/apps/pdf/src/renderer/App.tsx): `apps/pdf/src/renderer/App.tsx`
- [PDF file services](https://github.com/dinhducquan/genoffice/blob/main/apps/pdf/src/main/pdf-main.ts): `apps/pdf/src/main/pdf-main.ts`
- [Spreadsheet editor](https://github.com/dinhducquan/genoffice/blob/main/apps/sheets/src/renderer/App.tsx): `apps/sheets/src/renderer/App.tsx`
- [Slides editor](https://github.com/dinhducquan/genoffice/blob/main/apps/slides/src/renderer/App.tsx): `apps/slides/src/renderer/App.tsx`

### AI assistance

- [AI document agent](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/ai/AiPanel.tsx): `apps/html/src/renderer/ai/AiPanel.tsx`
- [AI provider transport](https://github.com/dinhducquan/genoffice/blob/main/apps/html/src/renderer/ai/transport.ts): `apps/html/src/renderer/ai/transport.ts`

### Format services

- [XLSX engine](https://github.com/dinhducquan/genoffice/blob/main/apps/sheets/native/xlsx-engine/src/main.rs): `apps/sheets/native/xlsx-engine/src/main.rs`
- [PDF conversion pipeline](https://github.com/dinhducquan/genoffice/blob/main/packages/pdf2docx/src/pipeline.ts): `packages/pdf2docx/src/pipeline.ts`

### Search and automation

- [Command-line tools](https://github.com/dinhducquan/genoffice/blob/main/packages/cli/src/preview.ts): `packages/cli/src/preview.ts`
- [MCP server](https://github.com/dinhducquan/genoffice/blob/main/packages/cli/src/mcp/server.ts): `packages/cli/src/mcp/server.ts`

### Other components

- **User**
- **Chosen AI provider**
- **Local documents**

## Connections

- User → Home and tabs: opens suite (evidence: `README.md`)
- Home and tabs → Tab manager: manages tabs (evidence: `apps/shell/src/main/tab-manager.ts`)
- User → Local file search: searches files (evidence: `README.md`)
- Local file search → Home and tabs: returns matches (evidence: `README.md`)
- User → Tab manager: opens document (evidence: `README.md`)
- Tab manager → HTML file services: creates HTML view (evidence: `apps/shell/src/main/tab-manager.ts`)
- Tab manager → Markdown editor: opens Markdown (evidence: `apps/shell/src/main/tab-manager.ts`)
- Tab manager → PDF file services: creates PDF view (evidence: `apps/shell/src/main/tab-manager.ts`)
- Tab manager → Spreadsheet editor: queues workbook (evidence: `apps/shell/src/main/tab-manager.ts`)
- Tab manager → Slides editor: opens slides (evidence: `apps/shell/src/main/tab-manager.ts`)
- Local documents → HTML editor: opens and edits (evidence: `README.md`)
- Local documents → Markdown editor: opens and edits (evidence: `README.md`)
- Local documents → PDF editor: opens and edits (evidence: `README.md`)
- Local documents → Spreadsheet editor: opens and edits (evidence: `README.md`)
- Local documents → Slides editor: opens and edits (evidence: `README.md`)
- HTML editor → HTML document model: parses document (evidence: `apps/html/src/renderer/App.tsx`)
- HTML editor → Live preview: updates preview (evidence: `apps/html/src/renderer/App.tsx`)
- HTML editor → HTML file services: saves document (evidence: `apps/html/src/renderer/App.tsx`)
- Markdown editor → Markdown editing: applies edits (evidence: `apps/markdown/src/renderer/App.tsx`)
- Markdown editor → Local documents: saves document (evidence: `README.md`)
- PDF editor → PDF file services: saves PDF (evidence: `README.md`)
- Spreadsheet editor → XLSX engine: uses workbook engine (evidence: `README.md`)
- Spreadsheet editor → Local documents: saves workbook (evidence: `README.md`)
- Slides editor → Local documents: saves presentation (evidence: `README.md`)
- User → AI document agent: requests edits (evidence: `README.md`)
- HTML editor → AI document agent: hosts panel (evidence: `apps/html/src/renderer/App.tsx`)
- AI document agent → AI provider transport: sends request (evidence: `apps/html/src/renderer/ai/AiPanel.tsx`)
- AI provider transport → Chosen AI provider: calls provider (evidence: `README.md`)
- AI document agent → HTML editor: proposes changes (evidence: `README.md`)
- User → PDF conversion pipeline: converts PDF (evidence: `README.md`)
- PDF conversion pipeline → Local documents: writes converted file (evidence: `README.md`)
- User → Command-line tools: runs commands (evidence: `README.md`)
- Command-line tools → Local documents: reads or edits (evidence: `README.md`)
- User → MCP server: connects agent (evidence: `README.md`)
- MCP server → Command-line tools: runs registered tools (evidence: `packages/cli/src/mcp/server.ts`)
