# mhgolkar/arrow architecture

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

- Interactive diagram: https://gitdiagram.com/mhgolkar/arrow
- Repository: https://github.com/mhgolkar/arrow

## Overview

Arrow is a visual game-narrative design editor whose projects define interconnected scenes, macros, characters, variables, and built-in logic nodes. The principal workflow is authoring a project in the editor, then playing it through the HTML-JS runtime or exporting a playable HTML build; the README also documents CSV localization export and VCS-friendly files. The tree and excerpts establish the editor/runtime areas and several runtime behaviors, but do not show most editor wiring or runtime registration, so those links are left unverified.

Main entry points: [`runtimes/html-js/arrow.js`](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/arrow.js) (Runtime interpreter), [`scripts/editor/editor.gd`](https://github.com/mhgolkar/arrow/blob/main/scripts/editor/editor.gd) (Editor interface), [`scripts/core/project_management.gd`](https://github.com/mhgolkar/arrow/blob/main/scripts/core/project_management.gd) (Project management), [`runtimes/html-js/modules/condition.js`](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/condition.js) (Conditions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Visual editor"]
  node_editor_ui["Editor interface<br/>[editor.gd]"]
  node_graph_editor["Graph canvas<br/>[grid_graph_edit.gd]"]
  node_inspector["Project inspector<br/>[inspector.gd]"]
  node_project_management["Project management"]
  node_node_types["Node type registry"]
end

subgraph group_model["Narrative nodes"]
  node_flow_nodes["Flow and dialogue<br/>[node.gd]"]
  node_condition["Conditions<br/>[condition.js]"]
  node_variables["Variable updates<br/>[variable_update.js]"]
  node_user_input["Player input<br/>[user_input.js]"]
  node_generation["Random generation<br/>[generator.js]"]
  node_character_tags["Character tags<br/>[tag_edit.js]"]
  node_tag_matching["Tag branching<br/>[tag_match.js]"]
  node_tag_pass["Tag checks<br/>[tag_pass.js]"]
  node_macros["Macro calls<br/>[macro_use.js]"]
end

subgraph group_runtime["Playable runtime"]
  node_runtime_interpreter["Runtime interpreter<br/>[arrow.js]"]
  node_runtime_content["Content rendering<br/>[content.js]"]
  node_runtime_parser["BBCode rendering"]
end

subgraph group_project["Project capabilities"]
  node_project_data["Project data<br/>[project.js]"]
  node_html_export["Playable HTML runtime<br/>[index.html]"]
  node_localization["Localization resources<br/>[en.po]"]
end

node_author(("Narrative designer"))

node_author -->|"authors in"| node_editor_ui
node_editor_ui -.->|"edits graph"| node_graph_editor
node_editor_ui -.->|"configures"| node_inspector
node_editor_ui -.->|"manages projects"| node_project_management
node_editor_ui -.->|"offers node types"| node_node_types
node_runtime_interpreter -.->|"evaluates"| node_condition
node_runtime_interpreter -.->|"updates state"| node_variables
node_runtime_interpreter -.->|"collects input"| node_user_input
node_runtime_interpreter -.->|"generates values"| node_generation
node_runtime_interpreter -.->|"edits tags"| node_character_tags
node_runtime_interpreter -.->|"branches on tags"| node_tag_matching
node_runtime_interpreter -.->|"checks tags"| node_tag_pass
node_runtime_interpreter -.->|"plays macros"| node_macros
node_runtime_interpreter -.->|"plays dialogue"| node_flow_nodes
node_condition -->|"routes playback"| node_runtime_interpreter
node_user_input -->|"continues playback"| node_runtime_interpreter
node_runtime_interpreter -.->|"reads project"| node_project_data
node_runtime_interpreter -.->|"renders content"| node_runtime_content
node_runtime_content -.->|"parses BBCode"| node_runtime_parser
node_project_management -->|"exports playable"| node_html_export
node_editor_ui -->|"exports CSV"| node_localization

click node_editor_ui "https://github.com/mhgolkar/arrow/blob/main/scripts/editor/editor.gd"
click node_graph_editor "https://github.com/mhgolkar/arrow/blob/main/scripts/editor/grid_graph_edit.gd"
click node_inspector "https://github.com/mhgolkar/arrow/blob/main/scripts/editor/panels/inspector.gd"
click node_project_management "https://github.com/mhgolkar/arrow/blob/main/scripts/core/project_management.gd"
click node_node_types "https://github.com/mhgolkar/arrow/blob/main/scripts/core/node_types_handler.gd"
click node_flow_nodes "https://github.com/mhgolkar/arrow/blob/main/nodes/dialog/node.gd"
click node_condition "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/condition.js"
click node_variables "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/variable_update.js"
click node_user_input "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/user_input.js"
click node_generation "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/generator.js"
click node_character_tags "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_edit.js"
click node_tag_matching "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_match.js"
click node_tag_pass "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_pass.js"
click node_macros "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/macro_use.js"
click node_runtime_interpreter "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/arrow.js"
click node_runtime_content "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/content.js"
click node_runtime_parser "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/shared-bbcode-parser.js"
click node_project_data "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/project.js"
click node_html_export "https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/index.html"
click node_localization "https://github.com/mhgolkar/arrow/blob/main/assets/translations/en.po"

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_editor_ui,node_graph_editor,node_inspector,node_project_management,node_node_types toneBlue
class node_flow_nodes,node_condition,node_variables,node_user_input,node_generation,node_character_tags,node_tag_matching,node_tag_pass,node_macros toneAmber
class node_runtime_interpreter,node_runtime_content,node_runtime_parser toneMint
class node_project_data,node_html_export,node_localization toneRose
class node_author toneIndigo
```

## Components

### Visual editor

- [Editor interface](https://github.com/mhgolkar/arrow/blob/main/scripts/editor/editor.gd): `scripts/editor/editor.gd`
- [Graph canvas](https://github.com/mhgolkar/arrow/blob/main/scripts/editor/grid_graph_edit.gd): `scripts/editor/grid_graph_edit.gd`
- [Project inspector](https://github.com/mhgolkar/arrow/blob/main/scripts/editor/panels/inspector.gd): `scripts/editor/panels/inspector.gd`
- [Project management](https://github.com/mhgolkar/arrow/blob/main/scripts/core/project_management.gd): `scripts/core/project_management.gd`
- [Node type registry](https://github.com/mhgolkar/arrow/blob/main/scripts/core/node_types_handler.gd): `scripts/core/node_types_handler.gd`

### Narrative nodes

- [Flow and dialogue](https://github.com/mhgolkar/arrow/blob/main/nodes/dialog/node.gd): `nodes/dialog/node.gd`
- [Conditions](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/condition.js): `runtimes/html-js/modules/condition.js`
- [Variable updates](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/variable_update.js): `runtimes/html-js/modules/variable_update.js`
- [Player input](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/user_input.js): `runtimes/html-js/modules/user_input.js`
- [Random generation](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/generator.js): `runtimes/html-js/modules/generator.js`
- [Character tags](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_edit.js): `runtimes/html-js/modules/tag_edit.js`
- [Tag branching](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_match.js): `runtimes/html-js/modules/tag_match.js`
- [Tag checks](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/tag_pass.js): `runtimes/html-js/modules/tag_pass.js`
- [Macro calls](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/macro_use.js): `runtimes/html-js/modules/macro_use.js`

### Playable runtime

- [Runtime interpreter](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/arrow.js): `runtimes/html-js/arrow.js`
- [Content rendering](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/content.js): `runtimes/html-js/modules/content.js`
- [BBCode rendering](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/modules/shared-bbcode-parser.js): `runtimes/html-js/modules/shared-bbcode-parser.js`

### Project capabilities

- [Project data](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/project.js): `runtimes/html-js/project.js`
- [Playable HTML runtime](https://github.com/mhgolkar/arrow/blob/main/runtimes/html-js/index.html): `runtimes/html-js/index.html`
- [Localization resources](https://github.com/mhgolkar/arrow/blob/main/assets/translations/en.po): `assets/translations/en.po`

### Other components

- **Narrative designer**

## Connections

- Narrative designer → Editor interface: authors in (evidence: `readme.md`)
- Editor interface → Graph canvas: edits graph
- Editor interface → Project inspector: configures
- Editor interface → Project management: manages projects
- Editor interface → Node type registry: offers node types
- Runtime interpreter → Conditions: evaluates
- Runtime interpreter → Variable updates: updates state
- Runtime interpreter → Player input: collects input
- Runtime interpreter → Random generation: generates values
- Runtime interpreter → Character tags: edits tags
- Runtime interpreter → Tag branching: branches on tags
- Runtime interpreter → Tag checks: checks tags
- Runtime interpreter → Macro calls: plays macros
- Runtime interpreter → Flow and dialogue: plays dialogue
- Conditions → Runtime interpreter: routes playback (evidence: `runtimes/html-js/modules/condition.js`)
- Player input → Runtime interpreter: continues playback (evidence: `runtimes/html-js/modules/user_input.js`)
- Runtime interpreter → Project data: reads project
- Runtime interpreter → Content rendering: renders content
- Content rendering → BBCode rendering: parses BBCode
- Project management → Playable HTML runtime: exports playable (evidence: `readme.md`)
- Editor interface → Localization resources: exports CSV (evidence: `readme.md`)
