# krod7/mod-manus architecture

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

- Interactive diagram: https://gitdiagram.com/krod7/mod-manus
- Repository: https://github.com/krod7/mod-manus

## Overview

Modulo is a browser-first flowchart workspace that imports or edits explicit logic, validates it, and produces pseudocode, executable Python/JavaScript, and node-to-code trace maps. The static browser engine supports graph editing, simulation, local project storage, and export; the optional Flask API adds structured-file parsing and local raster/PDF recognition. The graph preserves documented product branches; some frontend wiring is supported by the SOURCE INDEX and README rather than complete source excerpts.

Main entry points: [`frontend/js/app.js`](https://github.com/krod7/mod-manus/blob/main/frontend/js/app.js) (Workspace controller), [`backend/pipeline.py`](https://github.com/krod7/mod-manus/blob/main/backend/pipeline.py) (API pipeline), [`backend/services/logic_service.py`](https://github.com/krod7/mod-manus/blob/main/backend/services/logic_service.py) (Operation interpretation), [`frontend/js/api.js`](https://github.com/krod7/mod-manus/blob/main/frontend/js/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser workspace"]
  node_workspace["Workspace controller<br/>[app.js]"]
  node_graph_editor["Graph editor<br/>[flowchart-view.js]"]
  node_code_view["Code and trace views<br/>[code-view.js]"]
  node_compiler["Static compiler<br/>[engine.js]"]
  node_guide["Usage guidance<br/>[guide.js]"]
  node_examples["Example library<br/>[samples.js]"]
  node_local_storage[("Browser project storage")]
  node_export["File export<br/>[app.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_upload["Upload handling<br/>[upload.js]"]
end

subgraph group_api["Recognition API"]
  node_flask_api["Flask API<br/>[app.py]"]
  node_pipeline["API pipeline<br/>[pipeline.py]"]
  node_intake["Upload intake<br/>[intake_service.py]"]
  node_vision["Raster PDF recognition<br/>[vision_service.py]"]
end

subgraph group_conversion["Graph conversion"]
  node_graph_parser["Graph file parsing<br/>[graph_service.py]"]
  node_graph_model["Graph model<br/>[models.py]"]
  node_validation["Graph validation"]
  node_logic["Operation interpretation<br/>[logic_service.py]"]
  node_pseudocode["Pseudocode generation"]
  node_codegen["Code generation<br/>[codegen_service.py]"]
  node_trace["Trace map generation<br/>[trace_service.py]"]
end

node_user(("Flowchart author"))

node_user -->|"edits flow"| node_workspace
node_workspace -->|"renders graph"| node_graph_editor
node_workspace -->|"renders artifacts"| node_code_view
node_workspace -->|"validates and compiles"| node_compiler
node_workspace -->|"saves projects"| node_local_storage
node_workspace -->|"loads examples"| node_examples
node_workspace -->|"exports artifacts"| node_export
node_workspace -->|"imports file"| node_upload
node_upload -->|"requests recognition"| node_api_client
node_api_client -->|"calls API"| node_flask_api
node_workspace -->|"checks connection"| node_api_client
node_flask_api -->|"routes requests"| node_pipeline
node_pipeline -->|"reads upload"| node_intake
node_pipeline -->|"parses structured graph"| node_graph_parser
node_pipeline -->|"recognizes raster PDF"| node_vision
node_pipeline -->|"validates graph"| node_validation
node_pipeline -->|"interprets operations"| node_logic
node_pipeline -->|"generates pseudocode"| node_pseudocode
node_pipeline -->|"generates source"| node_codegen
node_pipeline -->|"builds trace map"| node_trace
node_graph_parser -->|"creates graph"| node_graph_model
node_logic -->|"interprets graph"| node_graph_model
node_codegen -->|"uses instructions"| node_logic
node_pseudocode -->|"uses instructions"| node_logic
node_trace -->|"maps graph nodes"| node_graph_model
node_compiler -->|"simulates execution"| node_user
node_workspace -->|"shows guidance"| node_guide

click node_workspace "https://github.com/krod7/mod-manus/blob/main/frontend/js/app.js"
click node_graph_editor "https://github.com/krod7/mod-manus/blob/main/frontend/js/flowchart-view.js"
click node_code_view "https://github.com/krod7/mod-manus/blob/main/frontend/js/code-view.js"
click node_compiler "https://github.com/krod7/mod-manus/blob/main/frontend/js/engine.js"
click node_guide "https://github.com/krod7/mod-manus/blob/main/frontend/js/guide.js"
click node_examples "https://github.com/krod7/mod-manus/blob/main/frontend/js/samples.js"
click node_export "https://github.com/krod7/mod-manus/blob/main/frontend/js/app.js"
click node_api_client "https://github.com/krod7/mod-manus/blob/main/frontend/js/api.js"
click node_upload "https://github.com/krod7/mod-manus/blob/main/frontend/js/upload.js"
click node_flask_api "https://github.com/krod7/mod-manus/blob/main/backend/app.py"
click node_pipeline "https://github.com/krod7/mod-manus/blob/main/backend/pipeline.py"
click node_intake "https://github.com/krod7/mod-manus/blob/main/backend/services/intake_service.py"
click node_vision "https://github.com/krod7/mod-manus/blob/main/backend/services/vision_service.py"
click node_graph_parser "https://github.com/krod7/mod-manus/blob/main/backend/services/graph_service.py"
click node_graph_model "https://github.com/krod7/mod-manus/blob/main/backend/models.py"
click node_validation "https://github.com/krod7/mod-manus/blob/main/backend/services/validation_service.py"
click node_logic "https://github.com/krod7/mod-manus/blob/main/backend/services/logic_service.py"
click node_pseudocode "https://github.com/krod7/mod-manus/blob/main/backend/services/pseudocode_service.py"
click node_codegen "https://github.com/krod7/mod-manus/blob/main/backend/services/codegen_service.py"
click node_trace "https://github.com/krod7/mod-manus/blob/main/backend/services/trace_service.py"

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_graph_editor,node_code_view,node_compiler,node_guide,node_examples,node_local_storage,node_export,node_api_client,node_upload toneBlue
class node_flask_api,node_pipeline,node_intake,node_vision toneAmber
class node_graph_parser,node_graph_model,node_validation,node_logic,node_pseudocode,node_codegen,node_trace toneMint
class node_user toneIndigo
```

## Components

### Browser workspace

- [Workspace controller](https://github.com/krod7/mod-manus/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Graph editor](https://github.com/krod7/mod-manus/blob/main/frontend/js/flowchart-view.js): `frontend/js/flowchart-view.js`
- [Code and trace views](https://github.com/krod7/mod-manus/blob/main/frontend/js/code-view.js): `frontend/js/code-view.js`
- [Static compiler](https://github.com/krod7/mod-manus/blob/main/frontend/js/engine.js): `frontend/js/engine.js`
- [Usage guidance](https://github.com/krod7/mod-manus/blob/main/frontend/js/guide.js): `frontend/js/guide.js`
- [Example library](https://github.com/krod7/mod-manus/blob/main/frontend/js/samples.js): `frontend/js/samples.js`
- **Browser project storage**
- [File export](https://github.com/krod7/mod-manus/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [API client](https://github.com/krod7/mod-manus/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Upload handling](https://github.com/krod7/mod-manus/blob/main/frontend/js/upload.js): `frontend/js/upload.js`

### Recognition API

- [Flask API](https://github.com/krod7/mod-manus/blob/main/backend/app.py): `backend/app.py`
- [API pipeline](https://github.com/krod7/mod-manus/blob/main/backend/pipeline.py): `backend/pipeline.py`
- [Upload intake](https://github.com/krod7/mod-manus/blob/main/backend/services/intake_service.py): `backend/services/intake_service.py`
- [Raster PDF recognition](https://github.com/krod7/mod-manus/blob/main/backend/services/vision_service.py): `backend/services/vision_service.py`

### Graph conversion

- [Graph file parsing](https://github.com/krod7/mod-manus/blob/main/backend/services/graph_service.py): `backend/services/graph_service.py`
- [Graph model](https://github.com/krod7/mod-manus/blob/main/backend/models.py): `backend/models.py`
- [Graph validation](https://github.com/krod7/mod-manus/blob/main/backend/services/validation_service.py): `backend/services/validation_service.py`
- [Operation interpretation](https://github.com/krod7/mod-manus/blob/main/backend/services/logic_service.py): `backend/services/logic_service.py`
- [Pseudocode generation](https://github.com/krod7/mod-manus/blob/main/backend/services/pseudocode_service.py): `backend/services/pseudocode_service.py`
- [Code generation](https://github.com/krod7/mod-manus/blob/main/backend/services/codegen_service.py): `backend/services/codegen_service.py`
- [Trace map generation](https://github.com/krod7/mod-manus/blob/main/backend/services/trace_service.py): `backend/services/trace_service.py`

### Other components

- **Flowchart author**

## Connections

- Flowchart author → Workspace controller: edits flow (evidence: `README.md`)
- Workspace controller → Graph editor: renders graph (evidence: `frontend/js/app.js`)
- Workspace controller → Code and trace views: renders artifacts (evidence: `frontend/js/app.js`)
- Workspace controller → Static compiler: validates and compiles (evidence: `frontend/js/app.js`)
- Workspace controller → Browser project storage: saves projects (evidence: `README.md`)
- Workspace controller → Example library: loads examples (evidence: `frontend/js/app.js`)
- Workspace controller → File export: exports artifacts (evidence: `README.md`)
- Workspace controller → Upload handling: imports file (evidence: `frontend/js/app.js`)
- Upload handling → API client: requests recognition (evidence: `frontend/js/upload.js`)
- API client → Flask API: calls API (evidence: `README.md`)
- Workspace controller → API client: checks connection (evidence: `frontend/js/app.js`)
- Flask API → API pipeline: routes requests (evidence: `backend/app.py`)
- API pipeline → Upload intake: reads upload (evidence: `backend/pipeline.py`)
- API pipeline → Graph file parsing: parses structured graph (evidence: `backend/pipeline.py`)
- API pipeline → Raster PDF recognition: recognizes raster PDF (evidence: `backend/pipeline.py`)
- API pipeline → Graph validation: validates graph (evidence: `backend/pipeline.py`)
- API pipeline → Operation interpretation: interprets operations (evidence: `backend/pipeline.py`)
- API pipeline → Pseudocode generation: generates pseudocode (evidence: `backend/pipeline.py`)
- API pipeline → Code generation: generates source (evidence: `backend/pipeline.py`)
- API pipeline → Trace map generation: builds trace map (evidence: `backend/pipeline.py`)
- Graph file parsing → Graph model: creates graph (evidence: `backend/services/graph_service.py`)
- Operation interpretation → Graph model: interprets graph (evidence: `backend/services/logic_service.py`)
- Code generation → Operation interpretation: uses instructions (evidence: `backend/services/codegen_service.py`)
- Pseudocode generation → Operation interpretation: uses instructions (evidence: `backend/services/pseudocode_service.py`)
- Trace map generation → Graph model: maps graph nodes (evidence: `backend/services/trace_service.py`)
- Static compiler → Flowchart author: simulates execution (evidence: `README.md`)
- Workspace controller → Usage guidance: shows guidance (evidence: `README.md`)
