# starautumn/astroknot architecture

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

- Interactive diagram: https://gitdiagram.com/starautumn/astroknot
- Repository: https://github.com/starautumn/astroknot

## Overview

AstroKnot is an Electron knowledge-management desktop app whose central workflow is to open a project, organize knowledge as connected nodes in a 2D mind map or 3D star map, edit node content, and persist project data. The README also documents an embedded IDE, browser capture, AI chat/agent, calendar, version graph, application library, and cloud sync; these are represented as distinct product capabilities. The graph follows documented structure and sampled call sites; unsampled subsystem wiring is intentionally left broad or omitted.

Main entry points: [`modules/module0_AppState.js`](https://github.com/starautumn/astroknot/blob/master/modules/module0_AppState.js) (Workspace State), [`preload.js`](https://github.com/starautumn/astroknot/blob/master/preload.js) (Preload Bridge), [`main/index.js`](https://github.com/starautumn/astroknot/blob/master/main/index.js) (Electron Main), [`AstroKnot.js`](https://github.com/starautumn/astroknot/blob/master/AstroKnot.js) (AstroKnot App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Knowledge Workspace"]
  node_workspace["Workspace State"]
  node_view3d["3D Star Map<br/>[index.js]"]
  node_links["Knowledge Links<br/>[LineManager.js]"]
  node_view2d["2D Mind Map<br/>[index.js]"]
end

subgraph group_content["Node Content"]
  node_nodeedit["Node Editing"]
  node_richtext["Rich Text Editor<br/>[index.js]"]
  node_calendar["Calendar and Diary<br/>[index.js]"]
end

subgraph group_tools["Embedded Tools"]
  node_ide["Sandbox IDE<br/>[index.js]"]
  node_apps["Application Library<br/>[AppManager.js]"]
  node_browser["Embedded Browser<br/>[index.js]"]
  node_ai["AI Chat Agent<br/>[index.js]"]
end

subgraph group_persistence["Data and Sync"]
  node_versions["Version Graph<br/>[versionGraph.js]"]
  node_projectio["Project I/O<br/>[project-io.js]"]
  node_filemanager["File Manager<br/>[file-manager.js]"]
  node_storage["System Storage<br/>[systemStorage.js]"]
  node_github["GitHub Sync<br/>[github.js]"]
end

subgraph group_runtime["Desktop Runtime"]
  node_app["AstroKnot App<br/>[AstroKnot.js]"]
  node_main["Electron Main<br/>[index.js]"]
  node_preload["Preload Bridge<br/>[preload.js]"]
end

node_user(("User"))
node_disk[("Local Data")]
node_githubservice(("GitHub"))

node_user -->|"opens"| node_app
node_app -->|"initializes"| node_workspace
node_workspace -->|"renders nodes"| node_view3d
node_workspace -->|"renders nodes"| node_view2d
node_workspace -->|"supplies graph"| node_links
node_user -->|"edits node"| node_nodeedit
node_nodeedit -->|"opens editor"| node_richtext
node_user -->|"manages schedule"| node_calendar
node_user -->|"opens sandbox"| node_ide
node_apps -->|"launches IDE"| node_ide
node_user -->|"browses pages"| node_browser
node_browser -->|"captures pages"| node_workspace
node_user -->|"chats or agents"| node_ai
node_workspace -->|"snapshots changes"| node_versions
node_app -->|"IPC requests"| node_main
node_main -->|"exposes bridge"| node_preload
node_preload -->|"storage calls"| node_storage
node_preload -->|"project calls"| node_projectio
node_preload -->|"file operations"| node_filemanager
node_preload -->|"sync requests"| node_github
node_projectio -->|"reads and writes"| node_disk
node_filemanager -->|"manages files"| node_disk
node_storage -->|"sync IPC"| node_main
node_main -->|"persists settings"| node_disk
node_github -->|"uploads and downloads"| node_githubservice
node_apps -->|"inserts app node"| node_workspace

click node_app "https://github.com/starautumn/astroknot/blob/master/AstroKnot.js"
click node_workspace "https://github.com/starautumn/astroknot/blob/master/modules/module0_AppState.js"
click node_view3d "https://github.com/starautumn/astroknot/blob/master/modules/VisualComponents/index.js"
click node_links "https://github.com/starautumn/astroknot/blob/master/modules/VisualComponents/LineManager.js"
click node_view2d "https://github.com/starautumn/astroknot/blob/master/modules/2DView/index.js"
click node_nodeedit "https://github.com/starautumn/astroknot/blob/master/modules/module5_SelectAndEdit.js"
click node_richtext "https://github.com/starautumn/astroknot/blob/master/modules/richEditor/index.js"
click node_calendar "https://github.com/starautumn/astroknot/blob/master/modules/calendar/index.js"
click node_ide "https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/ide/index.js"
click node_apps "https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/AppManager.js"
click node_browser "https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/browser/index.js"
click node_ai "https://github.com/starautumn/astroknot/blob/master/modules/AIChat/index.js"
click node_versions "https://github.com/starautumn/astroknot/blob/master/modules/versionGraph/versionGraph.js"
click node_projectio "https://github.com/starautumn/astroknot/blob/master/main/ipc-file/project-io.js"
click node_filemanager "https://github.com/starautumn/astroknot/blob/master/main/ipc-file/file-manager.js"
click node_storage "https://github.com/starautumn/astroknot/blob/master/modules/systemStorage.js"
click node_github "https://github.com/starautumn/astroknot/blob/master/main/ipc-file/github.js"
click node_main "https://github.com/starautumn/astroknot/blob/master/main/index.js"
click node_preload "https://github.com/starautumn/astroknot/blob/master/preload.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_workspace,node_view3d,node_links,node_view2d,node_user toneBlue
class node_nodeedit,node_richtext,node_calendar,node_disk toneAmber
class node_ide,node_apps,node_browser,node_ai toneMint
class node_versions,node_projectio,node_filemanager,node_storage,node_github toneRose
class node_app,node_main,node_preload,node_githubservice toneIndigo
```

## Components

### Knowledge Workspace

- [Workspace State](https://github.com/starautumn/astroknot/blob/master/modules/module0_AppState.js): `modules/module0_AppState.js`
- [3D Star Map](https://github.com/starautumn/astroknot/blob/master/modules/VisualComponents/index.js): `modules/VisualComponents/index.js`
- [Knowledge Links](https://github.com/starautumn/astroknot/blob/master/modules/VisualComponents/LineManager.js): `modules/VisualComponents/LineManager.js`
- [2D Mind Map](https://github.com/starautumn/astroknot/blob/master/modules/2DView/index.js): `modules/2DView/index.js`

### Node Content

- [Node Editing](https://github.com/starautumn/astroknot/blob/master/modules/module5_SelectAndEdit.js): `modules/module5_SelectAndEdit.js`
- [Rich Text Editor](https://github.com/starautumn/astroknot/blob/master/modules/richEditor/index.js): `modules/richEditor/index.js`
- [Calendar and Diary](https://github.com/starautumn/astroknot/blob/master/modules/calendar/index.js): `modules/calendar/index.js`

### Embedded Tools

- [Sandbox IDE](https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/ide/index.js): `modules/AppLibrary/ide/index.js`
- [Application Library](https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/AppManager.js): `modules/AppLibrary/AppManager.js`
- [Embedded Browser](https://github.com/starautumn/astroknot/blob/master/modules/AppLibrary/browser/index.js): `modules/AppLibrary/browser/index.js`
- [AI Chat Agent](https://github.com/starautumn/astroknot/blob/master/modules/AIChat/index.js): `modules/AIChat/index.js`

### Data and Sync

- [Version Graph](https://github.com/starautumn/astroknot/blob/master/modules/versionGraph/versionGraph.js): `modules/versionGraph/versionGraph.js`
- [Project I/O](https://github.com/starautumn/astroknot/blob/master/main/ipc-file/project-io.js): `main/ipc-file/project-io.js`
- [File Manager](https://github.com/starautumn/astroknot/blob/master/main/ipc-file/file-manager.js): `main/ipc-file/file-manager.js`
- [System Storage](https://github.com/starautumn/astroknot/blob/master/modules/systemStorage.js): `modules/systemStorage.js`
- [GitHub Sync](https://github.com/starautumn/astroknot/blob/master/main/ipc-file/github.js): `main/ipc-file/github.js`

### Desktop Runtime

- [AstroKnot App](https://github.com/starautumn/astroknot/blob/master/AstroKnot.js): `AstroKnot.js`
- [Electron Main](https://github.com/starautumn/astroknot/blob/master/main/index.js): `main/index.js`
- [Preload Bridge](https://github.com/starautumn/astroknot/blob/master/preload.js): `preload.js`

### Other components

- **User**
- **Local Data**
- **GitHub**

## Connections

- User → AstroKnot App: opens
- AstroKnot App → Workspace State: initializes
- Workspace State → 3D Star Map: renders nodes
- Workspace State → 2D Mind Map: renders nodes
- Workspace State → Knowledge Links: supplies graph
- User → Node Editing: edits node
- Node Editing → Rich Text Editor: opens editor
- User → Calendar and Diary: manages schedule
- User → Sandbox IDE: opens sandbox
- Application Library → Sandbox IDE: launches IDE
- User → Embedded Browser: browses pages
- Embedded Browser → Workspace State: captures pages
- User → AI Chat Agent: chats or agents
- Workspace State → Version Graph: snapshots changes
- AstroKnot App → Electron Main: IPC requests
- Electron Main → Preload Bridge: exposes bridge
- Preload Bridge → System Storage: storage calls
- Preload Bridge → Project I/O: project calls
- Preload Bridge → File Manager: file operations
- Preload Bridge → GitHub Sync: sync requests
- Project I/O → Local Data: reads and writes
- File Manager → Local Data: manages files
- System Storage → Electron Main: sync IPC
- Electron Main → Local Data: persists settings
- GitHub Sync → GitHub: uploads and downloads
- Application Library → Workspace State: inserts app node
