# rtadewald/neo-stitch architecture

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

- Interactive diagram: https://gitdiagram.com/rtadewald/neo-stitch
- Repository: https://github.com/rtadewald/neo-stitch

## Overview

Neo Stitch is a local visual-interface design canvas: users branch ideas into image generations, animate approved images as videos, then turn approved motion into live HTML. The graph preserves the canvas, visualization and history capabilities, along with the documented Claude queue workflow and generation, video, and implementation stages. Source excerpts are partial; links among unsampled subsystems are included only where documented in the README or supported by the source index.

Main entry points: [`app/src/Canvas.tsx`](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Canvas.tsx) (Idea canvas), [`app/src/api.ts`](https://github.com/rtadewald/neo-stitch/blob/main/app/src/api.ts) (API client), [`ferramentas/base.py`](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/base.py) (Project storage), [`app/src/App.tsx`](https://github.com/rtadewald/neo-stitch/blob/main/app/src/App.tsx) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_canvas["Canvas and review"]
  node_app["App routing<br/>[App.tsx]"]
  node_canvas_ui["Idea canvas<br/>[Canvas.tsx]"]
  node_nodes["Canvas nodes<br/>[nodes.tsx]"]
  node_layout["Tree layout<br/>[layout.ts]"]
  node_viewer["Media viewer<br/>[Viewer.tsx]"]
  node_config["Settings<br/>[Config.tsx]"]
  node_home["Project home<br/>[Home.tsx]"]
  node_trail["History sidebar<br/>[Trilho.tsx]"]
  node_panel["Project panel<br/>[Painel.tsx]"]
end

subgraph group_state["Project and storage"]
  node_api_client["API client<br/>[api.ts]"]
  node_project_hook["Project sync<br/>[useProjeto.ts]"]
  node_history_hook["Undo history<br/>[useHistorico.ts]"]
  node_server["Local server<br/>[servidor.py]"]
  node_storage[("Project storage<br/>[base.py]")]
end

subgraph group_generation["Image and video generation"]
  node_image_gen["Image generation<br/>[gerar.py]"]
  node_video_gen["Video generation<br/>[gerar_video.py]"]
  node_openrouter_client["OpenRouter client<br/>[openrouter.py]"]
end

subgraph group_delivery["HTML and integrations"]
  node_implementation["HTML implementation<br/>[impl.py]"]
  node_video_pages["Video pages<br/>[pagina_videos.py]"]
end

node_user(("Designer"))
node_claude(("Claude Code"))
node_openrouter(("OpenRouter"))

node_user -->|"opens app"| node_app
node_app -->|"routes to"| node_canvas_ui
node_app -->|"routes to"| node_home
node_canvas_ui -->|"renders"| node_nodes
node_canvas_ui -->|"uses layout"| node_layout
node_canvas_ui -.->|"opens viewer"| node_viewer
node_canvas_ui -->|"opens settings"| node_config
node_canvas_ui -->|"shows history"| node_trail
node_canvas_ui -->|"shows panel"| node_panel
node_canvas_ui -.->|"syncs project"| node_project_hook
node_canvas_ui -->|"records changes"| node_history_hook
node_project_hook -->|"requests state"| node_api_client
node_history_hook -->|"undoes via API"| node_api_client
node_config -->|"reads settings"| node_api_client
node_home -->|"loads projects"| node_api_client
node_api_client -.->|"calls API"| node_server
node_server -->|"reads and writes"| node_storage
node_claude -->|"monitors queue"| node_server
node_claude -->|"fulfills image requests"| node_image_gen
node_claude -->|"fulfills video requests"| node_video_gen
node_claude -->|"builds approved HTML"| node_implementation
node_image_gen -->|"calls client"| node_openrouter_client
node_video_gen -->|"calls client"| node_openrouter_client
node_openrouter_client -->|"sends requests"| node_openrouter
node_image_gen -->|"uses project data"| node_storage
node_video_gen -->|"uses project data"| node_storage
node_implementation -->|"uses project data"| node_storage
node_video_pages -.->|"reads project data"| node_storage

click node_app "https://github.com/rtadewald/neo-stitch/blob/main/app/src/App.tsx"
click node_canvas_ui "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Canvas.tsx"
click node_nodes "https://github.com/rtadewald/neo-stitch/blob/main/app/src/nodes.tsx"
click node_layout "https://github.com/rtadewald/neo-stitch/blob/main/app/src/layout.ts"
click node_viewer "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Viewer.tsx"
click node_config "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Config.tsx"
click node_home "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Home.tsx"
click node_trail "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Trilho.tsx"
click node_panel "https://github.com/rtadewald/neo-stitch/blob/main/app/src/Painel.tsx"
click node_api_client "https://github.com/rtadewald/neo-stitch/blob/main/app/src/api.ts"
click node_project_hook "https://github.com/rtadewald/neo-stitch/blob/main/app/src/useProjeto.ts"
click node_history_hook "https://github.com/rtadewald/neo-stitch/blob/main/app/src/useHistorico.ts"
click node_server "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/servidor.py"
click node_storage "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/base.py"
click node_image_gen "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/gerar.py"
click node_video_gen "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/gerar_video.py"
click node_openrouter_client "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/openrouter.py"
click node_implementation "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/impl.py"
click node_video_pages "https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/pagina_videos.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_app,node_canvas_ui,node_nodes,node_layout,node_viewer,node_config,node_home,node_trail,node_panel toneBlue
class node_api_client,node_project_hook,node_history_hook,node_server,node_storage toneAmber
class node_image_gen,node_video_gen,node_openrouter_client,node_openrouter toneMint
class node_implementation,node_video_pages toneRose
class node_user,node_claude toneIndigo
```

## Components

### Canvas and review

- [App routing](https://github.com/rtadewald/neo-stitch/blob/main/app/src/App.tsx): `app/src/App.tsx`
- [Idea canvas](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Canvas.tsx): `app/src/Canvas.tsx`
- [Canvas nodes](https://github.com/rtadewald/neo-stitch/blob/main/app/src/nodes.tsx): `app/src/nodes.tsx`
- [Tree layout](https://github.com/rtadewald/neo-stitch/blob/main/app/src/layout.ts): `app/src/layout.ts`
- [Media viewer](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Viewer.tsx): `app/src/Viewer.tsx`
- [Settings](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Config.tsx): `app/src/Config.tsx`
- [Project home](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Home.tsx): `app/src/Home.tsx`
- [History sidebar](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Trilho.tsx): `app/src/Trilho.tsx`
- [Project panel](https://github.com/rtadewald/neo-stitch/blob/main/app/src/Painel.tsx): `app/src/Painel.tsx`

### Project and storage

- [API client](https://github.com/rtadewald/neo-stitch/blob/main/app/src/api.ts): `app/src/api.ts`
- [Project sync](https://github.com/rtadewald/neo-stitch/blob/main/app/src/useProjeto.ts): `app/src/useProjeto.ts`
- [Undo history](https://github.com/rtadewald/neo-stitch/blob/main/app/src/useHistorico.ts): `app/src/useHistorico.ts`
- [Local server](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/servidor.py): `ferramentas/servidor.py`
- [Project storage](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/base.py): `ferramentas/base.py`

### Image and video generation

- [Image generation](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/gerar.py): `ferramentas/gerar.py`
- [Video generation](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/gerar_video.py): `ferramentas/gerar_video.py`
- [OpenRouter client](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/openrouter.py): `ferramentas/openrouter.py`

### HTML and integrations

- [HTML implementation](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/impl.py): `ferramentas/impl.py`
- [Video pages](https://github.com/rtadewald/neo-stitch/blob/main/ferramentas/pagina_videos.py): `ferramentas/pagina_videos.py`

### Other components

- **Designer**
- **Claude Code**
- **OpenRouter**

## Connections

- Designer → App routing: opens app (evidence: `README.md`)
- App routing → Idea canvas: routes to (evidence: `app/src/App.tsx`)
- App routing → Project home: routes to (evidence: `app/src/App.tsx`)
- Idea canvas → Canvas nodes: renders (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Tree layout: uses layout (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Media viewer: opens viewer (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Settings: opens settings (evidence: `app/src/Canvas.tsx`)
- Idea canvas → History sidebar: shows history (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Project panel: shows panel (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Project sync: syncs project (evidence: `app/src/Canvas.tsx`)
- Idea canvas → Undo history: records changes (evidence: `app/src/Canvas.tsx`)
- Project sync → API client: requests state (evidence: `app/src/useProjeto.ts`)
- Undo history → API client: undoes via API (evidence: `app/src/useHistorico.ts`)
- Settings → API client: reads settings (evidence: `app/src/Config.tsx`)
- Project home → API client: loads projects (evidence: `app/src/Home.tsx`)
- API client → Local server: calls API
- Local server → Project storage: reads and writes (evidence: `ferramentas/servidor.py`)
- Claude Code → Local server: monitors queue (evidence: `README.md`)
- Claude Code → Image generation: fulfills image requests (evidence: `README.md`)
- Claude Code → Video generation: fulfills video requests (evidence: `README.md`)
- Claude Code → HTML implementation: builds approved HTML (evidence: `README.md`)
- Image generation → OpenRouter client: calls client (evidence: `ferramentas/gerar.py`)
- Video generation → OpenRouter client: calls client (evidence: `ferramentas/gerar_video.py`)
- OpenRouter client → OpenRouter: sends requests (evidence: `ferramentas/openrouter.py`)
- Image generation → Project storage: uses project data (evidence: `ferramentas/gerar.py`)
- Video generation → Project storage: uses project data (evidence: `ferramentas/gerar_video.py`)
- HTML implementation → Project storage: uses project data (evidence: `ferramentas/impl.py`)
- Video pages → Project storage: reads project data
