# ttdiang2/tt_automanga architecture

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

- Interactive diagram: https://gitdiagram.com/ttdiang2/tt_automanga
- Repository: https://github.com/ttdiang2/tt_automanga

## Overview

TT_AutoManga is a local-first comic-production app: users turn story text into editable panels, enhance prompts, create or upload art, compose manga pages, then manage and export projects. The graph preserves the documented feature branches, including characters, templates, settings and archives. Backend route coverage and several frontend features are identified from the README/tree or the app’s tab dispatch; their internal calls were not sampled, so uncertain connections are omitted. Optional AI services are shown as integrations.

Main entry points: [`backend/main.py`](https://github.com/ttdiang2/tt_automanga/blob/master/backend/main.py) (FastAPI server), [`frontend/src/App.tsx`](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/App.tsx) (Workspace tabs), [`frontend/src/store/projectStore.ts`](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/store/projectStore.ts) (Project state), [`frontend/src/components/composer/ComposerTab.tsx`](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/ComposerTab.tsx) (Visual Composer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Frontend workspace"]
  node_app["Workspace tabs<br/>[App.tsx]"]
  node_showcase_ui["Showcase<br/>[ShowcaseTab.tsx]"]
  node_settings_ui["Settings<br/>[SettingsTab.tsx]"]
end

subgraph group_creation["Story and art"]
  node_storyboard_ui["Storyboard editor<br/>[StoryboardTab.tsx]"]
  node_prompt_ui["Prompt Lab<br/>[PromptLabTab.tsx]"]
  node_assets_ui["Asset manager"]
  node_characters_ui["Characters<br/>[CharacterTab.tsx]"]
end

subgraph group_composition["Page composition"]
  node_composer_ui["Visual Composer<br/>[ComposerTab.tsx]"]
  node_canvas["Canvas editor<br/>[Canvas.tsx]"]
  node_properties["Element properties"]
  node_image_picker["Image picker<br/>[ImagePicker.tsx]"]
  node_page_render["Page renderer<br/>[pageRenderer.ts]"]
end

subgraph group_backend["API and services"]
  node_storyboard_api["Storyboard API<br/>[storyboard.py]"]
  node_prompt_api["Prompt API<br/>[prompt.py]"]
  node_assets_api["Assets API<br/>[assets.py]"]
  node_characters_api["Character API<br/>[characters.py]"]
  node_character_templates["Character templates"]
  node_layouts_api["Layout templates<br/>[layouts.py]"]
  node_archive_api["Image archive<br/>[archive.py]"]
  node_project_api["Project API<br/>[project.py]"]
  node_export_api["Export API<br/>[export.py]"]
  node_settings_api["Settings API<br/>[settings.py]"]
  node_server["FastAPI server<br/>[main.py]"]
  node_llm_client["LLM client<br/>[openai_client.py]"]
  node_swarm_client["SwarmUI client<br/>[swarmui_client.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_state["Project data"]
  node_project_store["Project state<br/>[projectStore.ts]"]
  node_composer_store["Composer state<br/>[composerStore.ts]"]
  node_storage[("File storage<br/>[manager.py]")]
end

node_user(("Creator"))
node_llm_service{{"OpenAI-compatible LLM"}}
node_swarm_service{{"SwarmUI"}}

node_user -->|"uses"| node_app
node_app -->|"dispatches"| node_storyboard_ui
node_app -->|"dispatches"| node_prompt_ui
node_app -->|"dispatches"| node_composer_ui
node_app -->|"dispatches"| node_showcase_ui
node_app -->|"dispatches"| node_settings_ui
node_app -->|"dispatches"| node_characters_ui
node_storyboard_ui -->|"edits"| node_project_store
node_prompt_ui -->|"reads state"| node_project_store
node_characters_ui -->|"reads state"| node_project_store
node_composer_ui -->|"updates"| node_composer_store
node_composer_ui -->|"autosaves"| node_project_store
node_composer_ui -->|"renders"| node_canvas
node_composer_ui -->|"renders"| node_properties
node_composer_ui -->|"exports image"| node_page_render
node_canvas -->|"reads state"| node_composer_store
node_canvas -->|"opens"| node_image_picker
node_properties -->|"updates"| node_composer_store
node_image_picker -->|"updates"| node_composer_store
node_showcase_ui -->|"manages projects"| node_project_store
node_showcase_ui -->|"reads pages"| node_composer_store
node_showcase_ui -->|"renders pages"| node_page_render
node_project_store -->|"loads and saves"| node_project_api
node_app -->|"fetches settings"| node_settings_api
node_settings_ui -->|"updates settings"| node_project_store
node_storyboard_api -->|"decomposes text"| node_llm_client
node_prompt_api -->|"enhances prompts"| node_llm_client
node_assets_api -->|"generates images"| node_swarm_client
node_assets_api -->|"stores uploads"| node_storage
node_project_api -->|"reads and writes"| node_storage
node_llm_client -.->|"calls"| node_llm_service
node_swarm_client -.->|"calls"| node_swarm_service
node_server -->|"registers"| node_storyboard_api
node_server -->|"registers"| node_prompt_api
node_server -->|"registers"| node_assets_api
node_server -->|"registers"| node_project_api
node_server -.->|"registers"| node_export_api
node_server -->|"registers"| node_settings_api
node_server -.->|"registers"| node_layouts_api
node_server -.->|"registers"| node_archive_api
node_server -.->|"registers"| node_characters_api
node_server -.->|"registers"| node_character_templates
node_assets_api -->|"uses settings"| node_config
node_character_templates -->|"uses"| node_swarm_client
node_llm_client -->|"loads settings"| node_config
node_swarm_client -->|"loads settings"| node_config
node_storage -->|"uses paths"| node_config

click node_app "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/App.tsx"
click node_storyboard_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/storyboard/StoryboardTab.tsx"
click node_prompt_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/prompt/PromptLabTab.tsx"
click node_assets_ui "https://github.com/ttdiang2/tt_automanga/tree/master/frontend/src"
click node_characters_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/characters/CharacterTab.tsx"
click node_composer_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/ComposerTab.tsx"
click node_canvas "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/Canvas.tsx"
click node_properties "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/PropertiesPanel.tsx"
click node_image_picker "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/ImagePicker.tsx"
click node_page_render "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/pageRenderer.ts"
click node_showcase_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/showcase/ShowcaseTab.tsx"
click node_settings_ui "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/settings/SettingsTab.tsx"
click node_project_store "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/store/projectStore.ts"
click node_composer_store "https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/store/composerStore.ts"
click node_storyboard_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/storyboard.py"
click node_prompt_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/prompt.py"
click node_assets_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/assets.py"
click node_characters_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/characters.py"
click node_character_templates "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/character_templates.py"
click node_layouts_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/layouts.py"
click node_archive_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/archive.py"
click node_project_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/project.py"
click node_export_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/export.py"
click node_settings_api "https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/settings.py"
click node_server "https://github.com/ttdiang2/tt_automanga/blob/master/backend/main.py"
click node_llm_client "https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/openai_client.py"
click node_swarm_client "https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/swarmui_client.py"
click node_config "https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/config.py"
click node_storage "https://github.com/ttdiang2/tt_automanga/blob/master/backend/storage/manager.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_showcase_ui,node_settings_ui,node_swarm_service toneBlue
class node_storyboard_ui,node_prompt_ui,node_assets_ui,node_characters_ui toneAmber
class node_composer_ui,node_canvas,node_properties,node_image_picker,node_page_render toneMint
class node_storyboard_api,node_prompt_api,node_assets_api,node_characters_api,node_character_templates,node_layouts_api,node_archive_api,node_project_api,node_export_api,node_settings_api,node_server,node_llm_client,node_swarm_client,node_config toneRose
class node_project_store,node_composer_store,node_storage,node_user,node_llm_service toneIndigo
```

## Components

### Frontend workspace

- [Workspace tabs](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Showcase](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/showcase/ShowcaseTab.tsx): `frontend/src/components/showcase/ShowcaseTab.tsx`
- [Settings](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/settings/SettingsTab.tsx): `frontend/src/components/settings/SettingsTab.tsx`

### Story and art

- [Storyboard editor](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/storyboard/StoryboardTab.tsx): `frontend/src/components/storyboard/StoryboardTab.tsx`
- [Prompt Lab](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/prompt/PromptLabTab.tsx): `frontend/src/components/prompt/PromptLabTab.tsx`
- [Asset manager](https://github.com/ttdiang2/tt_automanga/tree/master/frontend/src): `frontend/src`
- [Characters](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/characters/CharacterTab.tsx): `frontend/src/components/characters/CharacterTab.tsx`

### Page composition

- [Visual Composer](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/ComposerTab.tsx): `frontend/src/components/composer/ComposerTab.tsx`
- [Canvas editor](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/Canvas.tsx): `frontend/src/components/composer/Canvas.tsx`
- [Element properties](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/PropertiesPanel.tsx): `frontend/src/components/composer/PropertiesPanel.tsx`
- [Image picker](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/ImagePicker.tsx): `frontend/src/components/composer/ImagePicker.tsx`
- [Page renderer](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/components/composer/pageRenderer.ts): `frontend/src/components/composer/pageRenderer.ts`

### API and services

- [Storyboard API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/storyboard.py): `backend/api/storyboard.py`
- [Prompt API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/prompt.py): `backend/api/prompt.py`
- [Assets API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/assets.py): `backend/api/assets.py`
- [Character API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/characters.py): `backend/api/characters.py`
- [Character templates](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/character_templates.py): `backend/api/character_templates.py`
- [Layout templates](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/layouts.py): `backend/api/layouts.py`
- [Image archive](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/archive.py): `backend/api/archive.py`
- [Project API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/project.py): `backend/api/project.py`
- [Export API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/export.py): `backend/api/export.py`
- [Settings API](https://github.com/ttdiang2/tt_automanga/blob/master/backend/api/settings.py): `backend/api/settings.py`
- [FastAPI server](https://github.com/ttdiang2/tt_automanga/blob/master/backend/main.py): `backend/main.py`
- [LLM client](https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/openai_client.py): `backend/core/openai_client.py`
- [SwarmUI client](https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/swarmui_client.py): `backend/core/swarmui_client.py`
- [Runtime configuration](https://github.com/ttdiang2/tt_automanga/blob/master/backend/core/config.py): `backend/core/config.py`

### Project data

- [Project state](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/store/projectStore.ts): `frontend/src/store/projectStore.ts`
- [Composer state](https://github.com/ttdiang2/tt_automanga/blob/master/frontend/src/store/composerStore.ts): `frontend/src/store/composerStore.ts`
- [File storage](https://github.com/ttdiang2/tt_automanga/blob/master/backend/storage/manager.py): `backend/storage/manager.py`

### Other components

- **Creator**
- **OpenAI-compatible LLM**
- **SwarmUI**

## Connections

- Creator → Workspace tabs: uses (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Storyboard editor: dispatches (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Prompt Lab: dispatches (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Visual Composer: dispatches (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Showcase: dispatches (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Settings: dispatches (evidence: `frontend/src/App.tsx`)
- Workspace tabs → Characters: dispatches (evidence: `frontend/src/App.tsx`)
- Storyboard editor → Project state: edits (evidence: `frontend/src/components/storyboard/StoryboardTab.tsx`)
- Prompt Lab → Project state: reads state (evidence: `frontend/src/components/prompt/PromptLabTab.tsx`)
- Characters → Project state: reads state (evidence: `frontend/src/components/characters/CharacterTab.tsx`)
- Visual Composer → Composer state: updates (evidence: `frontend/src/components/composer/ComposerTab.tsx`)
- Visual Composer → Project state: autosaves (evidence: `frontend/src/components/composer/ComposerTab.tsx`)
- Visual Composer → Canvas editor: renders (evidence: `frontend/src/components/composer/ComposerTab.tsx`)
- Visual Composer → Element properties: renders (evidence: `frontend/src/components/composer/ComposerTab.tsx`)
- Visual Composer → Page renderer: exports image (evidence: `frontend/src/components/composer/ComposerTab.tsx`)
- Canvas editor → Composer state: reads state (evidence: `frontend/src/components/composer/Canvas.tsx`)
- Canvas editor → Image picker: opens (evidence: `frontend/src/components/composer/Canvas.tsx`)
- Element properties → Composer state: updates (evidence: `frontend/src/components/composer/PropertiesPanel.tsx`)
- Image picker → Composer state: updates (evidence: `frontend/src/components/composer/ImagePicker.tsx`)
- Showcase → Project state: manages projects (evidence: `frontend/src/components/showcase/ShowcaseTab.tsx`)
- Showcase → Composer state: reads pages (evidence: `frontend/src/components/showcase/ShowcaseTab.tsx`)
- Showcase → Page renderer: renders pages (evidence: `frontend/src/components/showcase/ShowcaseTab.tsx`)
- Project state → Project API: loads and saves (evidence: `frontend/src/store/projectStore.ts`)
- Workspace tabs → Settings API: fetches settings (evidence: `frontend/src/App.tsx`)
- Settings → Project state: updates settings (evidence: `frontend/src/components/settings/SettingsTab.tsx`)
- Storyboard API → LLM client: decomposes text (evidence: `backend/api/storyboard.py`)
- Prompt API → LLM client: enhances prompts (evidence: `backend/api/prompt.py`)
- Assets API → SwarmUI client: generates images (evidence: `backend/api/assets.py`)
- Assets API → File storage: stores uploads (evidence: `backend/api/assets.py`)
- Project API → File storage: reads and writes (evidence: `backend/api/project.py`)
- LLM client → OpenAI-compatible LLM: calls
- SwarmUI client → SwarmUI: calls
- FastAPI server → Storyboard API: registers (evidence: `backend/main.py`)
- FastAPI server → Prompt API: registers (evidence: `backend/main.py`)
- FastAPI server → Assets API: registers (evidence: `backend/main.py`)
- FastAPI server → Project API: registers (evidence: `backend/main.py`)
- FastAPI server → Export API: registers (evidence: `backend/main.py`)
- FastAPI server → Settings API: registers (evidence: `backend/main.py`)
- FastAPI server → Layout templates: registers (evidence: `backend/main.py`)
- FastAPI server → Image archive: registers (evidence: `backend/main.py`)
- FastAPI server → Character API: registers (evidence: `backend/main.py`)
- FastAPI server → Character templates: registers (evidence: `backend/main.py`)
- Assets API → Runtime configuration: uses settings (evidence: `backend/api/assets.py`)
- Character templates → SwarmUI client: uses (evidence: `backend/api/character_templates.py`)
- LLM client → Runtime configuration: loads settings (evidence: `backend/core/openai_client.py`)
- SwarmUI client → Runtime configuration: loads settings (evidence: `backend/core/swarmui_client.py`)
- File storage → Runtime configuration: uses paths (evidence: `backend/storage/manager.py`)
