# satlasrohit/comiccraft architecture

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

- Interactive diagram: https://gitdiagram.com/satlasrohit/comiccraft
- Repository: https://github.com/satlasrohit/comiccraft

## Overview

ComicCraft is a FastAPI comic-creation app. A user submits story and style details; routes orchestrate outline generation, narration, image generation, layout assembly, and preview. The preview can be exported as a multi-page PDF. The graph also shows the form, JSON API, development image endpoint, and export-success/download flow. The main runtime modules are excerpted; some UI, storage, and integrations are represented from README documentation, so their internal details are not expanded.

Main entry points: [`app/routes.py`](https://github.com/satlasrohit/comiccraft/blob/main/app/routes.py) (HTTP routes), [`templates/comic_preview.html`](https://github.com/satlasrohit/comiccraft/blob/main/templates/comic_preview.html) (Comic preview), [`app/image_generator.py`](https://github.com/satlasrohit/comiccraft/blob/main/app/image_generator.py) (Panel images), [`static/panels`](https://github.com/satlasrohit/comiccraft/tree/main/static/panels) (Panel image files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["FastAPI app<br/>[main.py]"]
  node_routes["HTTP routes<br/>[routes.py]"]
  node_form["Creation form<br/>[index.html]"]
  node_preview["Comic preview<br/>[comic_preview.html]"]
  node_success["Export success"]
  node_styles["Shared styles<br/>[styles.css]"]
  node_comic_cache[("Comic store<br/>[routes.py]")]
end

subgraph group_story["Story generation"]
  node_flash["Outline generation<br/>[gemini_flash.py]"]
  node_pro["Story writing<br/>[gemini_pro.py]"]
  node_gemini{{"Google Gemini"}}
end

subgraph group_art["Illustration and layout"]
  node_illustrator["Panel images<br/>[image_generator.py]"]
  node_diffusers{{"Diffusers model"}}
  node_panel_files[("Panel image files")]
  node_layout["Layout builder<br/>[layout_builder.py]"]
end

subgraph group_export["PDF export"]
  node_pdf["PDF exporter<br/>[exporters.py]"]
  node_pdf_files[("Exported PDFs")]
end

node_user(("Comic creator"))

node_user -->|"enters details"| node_form
node_form -->|"submits prompt"| node_routes
node_app -->|"includes router"| node_routes
node_routes -->|"requests outline"| node_flash
node_flash -->|"generates outline"| node_gemini
node_routes -->|"requests story"| node_pro
node_pro -->|"generates script"| node_gemini
node_routes -->|"generates panels"| node_illustrator
node_illustrator -.->|"runs pipeline"| node_diffusers
node_illustrator -->|"writes images"| node_panel_files
node_routes -->|"assembles layout"| node_layout
node_layout -->|"checks image paths"| node_panel_files
node_routes -->|"registers comic"| node_comic_cache
node_routes -->|"renders preview"| node_preview
node_preview -->|"uses styles"| node_styles
node_preview -->|"shows images"| node_panel_files
node_routes -->|"loads comic"| node_comic_cache
node_routes -->|"requests PDF"| node_pdf
node_pdf -->|"writes PDF"| node_pdf_files
node_routes -->|"renders result"| node_success
node_success -->|"offers download"| node_user

click node_app "https://github.com/satlasrohit/comiccraft/blob/main/app/main.py"
click node_routes "https://github.com/satlasrohit/comiccraft/blob/main/app/routes.py"
click node_form "https://github.com/satlasrohit/comiccraft/blob/main/templates/index.html"
click node_preview "https://github.com/satlasrohit/comiccraft/blob/main/templates/comic_preview.html"
click node_success "https://github.com/satlasrohit/comiccraft/blob/main/templates/export_success.html"
click node_styles "https://github.com/satlasrohit/comiccraft/blob/main/static/css/styles.css"
click node_comic_cache "https://github.com/satlasrohit/comiccraft/blob/main/app/routes.py"
click node_flash "https://github.com/satlasrohit/comiccraft/blob/main/app/gemini_flash.py"
click node_pro "https://github.com/satlasrohit/comiccraft/blob/main/app/gemini_pro.py"
click node_illustrator "https://github.com/satlasrohit/comiccraft/blob/main/app/image_generator.py"
click node_panel_files "https://github.com/satlasrohit/comiccraft/tree/main/static/panels"
click node_layout "https://github.com/satlasrohit/comiccraft/blob/main/app/layout_builder.py"
click node_pdf "https://github.com/satlasrohit/comiccraft/blob/main/app/exporters.py"
click node_pdf_files "https://github.com/satlasrohit/comiccraft/tree/main/static/exports"

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_routes,node_form,node_preview,node_success,node_styles,node_comic_cache toneBlue
class node_flash,node_pro,node_gemini toneAmber
class node_illustrator,node_diffusers,node_panel_files,node_layout toneMint
class node_pdf,node_pdf_files toneRose
class node_user toneIndigo
```

## Components

### Web experience

- [FastAPI app](https://github.com/satlasrohit/comiccraft/blob/main/app/main.py): `app/main.py`
- [HTTP routes](https://github.com/satlasrohit/comiccraft/blob/main/app/routes.py): `app/routes.py`
- [Creation form](https://github.com/satlasrohit/comiccraft/blob/main/templates/index.html): `templates/index.html`
- [Comic preview](https://github.com/satlasrohit/comiccraft/blob/main/templates/comic_preview.html): `templates/comic_preview.html`
- [Export success](https://github.com/satlasrohit/comiccraft/blob/main/templates/export_success.html): `templates/export_success.html`
- [Shared styles](https://github.com/satlasrohit/comiccraft/blob/main/static/css/styles.css): `static/css/styles.css`
- [Comic store](https://github.com/satlasrohit/comiccraft/blob/main/app/routes.py): `app/routes.py`

### Story generation

- [Outline generation](https://github.com/satlasrohit/comiccraft/blob/main/app/gemini_flash.py): `app/gemini_flash.py`
- [Story writing](https://github.com/satlasrohit/comiccraft/blob/main/app/gemini_pro.py): `app/gemini_pro.py`
- **Google Gemini**

### Illustration and layout

- [Panel images](https://github.com/satlasrohit/comiccraft/blob/main/app/image_generator.py): `app/image_generator.py`
- **Diffusers model**
- [Panel image files](https://github.com/satlasrohit/comiccraft/tree/main/static/panels): `static/panels`
- [Layout builder](https://github.com/satlasrohit/comiccraft/blob/main/app/layout_builder.py): `app/layout_builder.py`

### PDF export

- [PDF exporter](https://github.com/satlasrohit/comiccraft/blob/main/app/exporters.py): `app/exporters.py`
- [Exported PDFs](https://github.com/satlasrohit/comiccraft/tree/main/static/exports): `static/exports`

### Other components

- **Comic creator**

## Connections

- Comic creator → Creation form: enters details (evidence: `README.md`)
- Creation form → HTTP routes: submits prompt (evidence: `README.md`)
- FastAPI app → HTTP routes: includes router (evidence: `app/main.py`)
- HTTP routes → Outline generation: requests outline (evidence: `app/routes.py`)
- Outline generation → Google Gemini: generates outline (evidence: `app/gemini_flash.py`)
- HTTP routes → Story writing: requests story (evidence: `app/routes.py`)
- Story writing → Google Gemini: generates script (evidence: `app/gemini_pro.py`)
- HTTP routes → Panel images: generates panels (evidence: `app/routes.py`)
- Panel images → Diffusers model: runs pipeline (evidence: `README.md`)
- Panel images → Panel image files: writes images (evidence: `README.md`)
- HTTP routes → Layout builder: assembles layout (evidence: `app/routes.py`)
- Layout builder → Panel image files: checks image paths (evidence: `app/layout_builder.py`)
- HTTP routes → Comic store: registers comic (evidence: `app/routes.py`)
- HTTP routes → Comic preview: renders preview (evidence: `README.md`)
- Comic preview → Shared styles: uses styles (evidence: `README.md`)
- Comic preview → Panel image files: shows images (evidence: `README.md`)
- HTTP routes → Comic store: loads comic (evidence: `app/routes.py`)
- HTTP routes → PDF exporter: requests PDF (evidence: `app/routes.py`)
- PDF exporter → Exported PDFs: writes PDF (evidence: `README.md`)
- HTTP routes → Export success: renders result (evidence: `app/routes.py`)
- Export success → Comic creator: offers download (evidence: `README.md`)
