# ashishjamarkattel/animator architecture

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

- Interactive diagram: https://gitdiagram.com/ashishjamarkattel/animator
- Repository: https://github.com/ashishjamarkattel/animator

## Overview

Animator turns an idea into a narrated whiteboard video through storyboard, scene imagery, speech, region-to-beat planning, and local animation/rendering. It also accepts user-supplied images, audio, and region plans through the CLI or Python API. The HTTP service adds authenticated, credit-based generation jobs backed by Supabase. The README and source index establish the major workflows; unsampled API job internals and some implementation details are represented only where their references support a relationship.

Main entry points: [`animator/gemini/pipeline.py`](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/pipeline.py) (Prompt pipeline), [`animator/engine.py`](https://github.com/ashishjamarkattel/animator/blob/main/animator/engine.py) (Animation engine), [`animator/api/routers/generate.py`](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/routers/generate.py) (Generate route), [`animator/api/supabase.py`](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/supabase.py) (Supabase access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creation["AI content creation"]
  node_prompt_pipeline["Prompt pipeline<br/>[pipeline.py]"]
  node_storyboard["Storyboard<br/>[storyboard.py]"]
  node_scene_images["Scene images<br/>[images.py]"]
  node_narration["Beat narration<br/>[narration.py]"]
  node_beat_timing["Beat timing<br/>[beat_timing.py]"]
  node_region_detection["Region detection<br/>[detect_regions.py]"]
  node_gemini_client["Gemini client<br/>[client.py]"]
  node_prompts["Prompt templates<br/>[__init__.py]"]
end

subgraph group_rendering["Animation and rendering"]
  node_region_plans["Region plans<br/>[regions.py]"]
  node_renderer["Video renderer<br/>[render.py]"]
  node_animation_engine["Animation engine<br/>[engine.py]"]
  node_craft_detector["Text detection<br/>[craft_detector.py]"]
  node_component_ordering["Component ordering"]
  node_fill_painters["Fill painting<br/>[fill_painters.py]"]
  node_skeleton_paths["Stroke tracing<br/>[skeleton_paths.py]"]
  node_video_encoding["Video encoding<br/>[video_encoding.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["Command line<br/>[cli.py]"]
end

subgraph group_service["Web service and accounts"]
  node_api_app["HTTP application<br/>[app.py]"]
  node_generate_route["Generate route<br/>[generate.py]"]
  node_auth["User authentication<br/>[auth.py]"]
  node_jobs["Generation jobs<br/>[jobs.py]"]
  node_api_settings["Service settings<br/>[settings.py]"]
  node_supabase_client["Supabase access<br/>[supabase.py]"]
end

node_user(("User"))
node_supabase[("Supabase")]
node_gemini["Google Gemini"]
node_ffmpeg["FFmpeg"]

node_user -->|"runs"| node_cli
node_cli -->|"starts prompt flow"| node_prompt_pipeline
node_cli -->|"requests detection"| node_region_detection
node_cli -->|"renders scenes"| node_renderer
node_prompt_pipeline -->|"generates scenes"| node_storyboard
node_prompt_pipeline -->|"requests images"| node_scene_images
node_prompt_pipeline -->|"requests speech"| node_narration
node_prompt_pipeline -->|"plans regions"| node_region_detection
node_prompt_pipeline -->|"renders video"| node_renderer
node_narration -->|"measures beats"| node_beat_timing
node_storyboard -.->|"calls model"| node_gemini_client
node_scene_images -.->|"calls model"| node_gemini_client
node_narration -.->|"calls model"| node_gemini_client
node_region_detection -->|"calls model"| node_gemini_client
node_gemini_client -.->|"sends requests"| node_gemini
node_storyboard -->|"loads template"| node_prompts
node_scene_images -->|"loads template"| node_prompts
node_region_detection -->|"loads template"| node_prompts
node_prompt_pipeline -->|"sets beat windows"| node_region_plans
node_renderer -->|"uses timing plans"| node_region_plans
node_renderer -->|"renders scenes"| node_animation_engine
node_animation_engine -->|"detects text"| node_craft_detector
node_animation_engine -->|"orders components"| node_component_ordering
node_animation_engine -->|"paints fills"| node_fill_painters
node_animation_engine -->|"traces strokes"| node_skeleton_paths
node_animation_engine -->|"encodes frames"| node_video_encoding
node_video_encoding -->|"encodes video"| node_ffmpeg
node_user -.->|"sends requests"| node_api_app
node_api_app -->|"registers route"| node_generate_route
node_generate_route -->|"authenticates user"| node_auth
node_auth -->|"looks up user"| node_supabase_client
node_generate_route -->|"claims and charges"| node_supabase_client
node_generate_route -->|"schedules job"| node_jobs
node_generate_route -->|"reads pricing"| node_api_settings
node_api_app -->|"configures app"| node_api_settings
node_supabase_client -->|"reads credentials"| node_api_settings
node_supabase_client -->|"reads and updates"| node_supabase
node_jobs -.->|"updates job data"| node_supabase_client
node_jobs -.->|"runs generation"| node_prompt_pipeline

click node_cli "https://github.com/ashishjamarkattel/animator/blob/main/animator/cli.py"
click node_prompt_pipeline "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/pipeline.py"
click node_storyboard "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/storyboard.py"
click node_scene_images "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/images.py"
click node_narration "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/narration.py"
click node_beat_timing "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/beat_timing.py"
click node_region_detection "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/detect_regions.py"
click node_region_plans "https://github.com/ashishjamarkattel/animator/blob/main/animator/regions.py"
click node_gemini_client "https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/client.py"
click node_prompts "https://github.com/ashishjamarkattel/animator/blob/main/animator/prompts/__init__.py"
click node_renderer "https://github.com/ashishjamarkattel/animator/blob/main/animator/render.py"
click node_animation_engine "https://github.com/ashishjamarkattel/animator/blob/main/animator/engine.py"
click node_craft_detector "https://github.com/ashishjamarkattel/animator/blob/main/animator/craft_detector.py"
click node_component_ordering "https://github.com/ashishjamarkattel/animator/blob/main/animator/component_ordering.py"
click node_fill_painters "https://github.com/ashishjamarkattel/animator/blob/main/animator/fill_painters.py"
click node_skeleton_paths "https://github.com/ashishjamarkattel/animator/blob/main/animator/skeleton_paths.py"
click node_video_encoding "https://github.com/ashishjamarkattel/animator/blob/main/animator/video_encoding.py"
click node_api_app "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/app.py"
click node_generate_route "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/routers/generate.py"
click node_auth "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/auth.py"
click node_jobs "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/jobs.py"
click node_api_settings "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/settings.py"
click node_supabase_client "https://github.com/ashishjamarkattel/animator/blob/main/animator/api/supabase.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_prompt_pipeline,node_storyboard,node_scene_images,node_narration,node_beat_timing,node_region_detection,node_gemini_client,node_prompts,node_user toneBlue
class node_region_plans,node_renderer,node_animation_engine,node_craft_detector,node_component_ordering,node_fill_painters,node_skeleton_paths,node_video_encoding,node_supabase toneAmber
class node_cli toneMint
class node_api_app,node_generate_route,node_auth,node_jobs,node_api_settings,node_supabase_client toneRose
class node_gemini,node_ffmpeg toneIndigo
```

## Components

### AI content creation

- [Prompt pipeline](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/pipeline.py): `animator/gemini/pipeline.py`
- [Storyboard](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/storyboard.py): `animator/gemini/storyboard.py`
- [Scene images](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/images.py): `animator/gemini/images.py`
- [Beat narration](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/narration.py): `animator/gemini/narration.py`
- [Beat timing](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/beat_timing.py): `animator/gemini/beat_timing.py`
- [Region detection](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/detect_regions.py): `animator/gemini/detect_regions.py`
- [Gemini client](https://github.com/ashishjamarkattel/animator/blob/main/animator/gemini/client.py): `animator/gemini/client.py`
- [Prompt templates](https://github.com/ashishjamarkattel/animator/blob/main/animator/prompts/__init__.py): `animator/prompts/__init__.py`

### Animation and rendering

- [Region plans](https://github.com/ashishjamarkattel/animator/blob/main/animator/regions.py): `animator/regions.py`
- [Video renderer](https://github.com/ashishjamarkattel/animator/blob/main/animator/render.py): `animator/render.py`
- [Animation engine](https://github.com/ashishjamarkattel/animator/blob/main/animator/engine.py): `animator/engine.py`
- [Text detection](https://github.com/ashishjamarkattel/animator/blob/main/animator/craft_detector.py): `animator/craft_detector.py`
- [Component ordering](https://github.com/ashishjamarkattel/animator/blob/main/animator/component_ordering.py): `animator/component_ordering.py`
- [Fill painting](https://github.com/ashishjamarkattel/animator/blob/main/animator/fill_painters.py): `animator/fill_painters.py`
- [Stroke tracing](https://github.com/ashishjamarkattel/animator/blob/main/animator/skeleton_paths.py): `animator/skeleton_paths.py`
- [Video encoding](https://github.com/ashishjamarkattel/animator/blob/main/animator/video_encoding.py): `animator/video_encoding.py`

### User interfaces

- [Command line](https://github.com/ashishjamarkattel/animator/blob/main/animator/cli.py): `animator/cli.py`

### Web service and accounts

- [HTTP application](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/app.py): `animator/api/app.py`
- [Generate route](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/routers/generate.py): `animator/api/routers/generate.py`
- [User authentication](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/auth.py): `animator/api/auth.py`
- [Generation jobs](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/jobs.py): `animator/api/jobs.py`
- [Service settings](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/settings.py): `animator/api/settings.py`
- [Supabase access](https://github.com/ashishjamarkattel/animator/blob/main/animator/api/supabase.py): `animator/api/supabase.py`

### Other components

- **User**
- **Supabase**
- **Google Gemini**
- **FFmpeg**

## Connections

- User → Command line: runs (evidence: `README.md`)
- Command line → Prompt pipeline: starts prompt flow (evidence: `animator/cli.py`)
- Command line → Region detection: requests detection (evidence: `animator/cli.py`)
- Command line → Video renderer: renders scenes (evidence: `animator/cli.py`)
- Prompt pipeline → Storyboard: generates scenes (evidence: `animator/gemini/pipeline.py`)
- Prompt pipeline → Scene images: requests images (evidence: `animator/gemini/pipeline.py`)
- Prompt pipeline → Beat narration: requests speech (evidence: `animator/gemini/pipeline.py`)
- Prompt pipeline → Region detection: plans regions (evidence: `animator/gemini/pipeline.py`)
- Prompt pipeline → Video renderer: renders video (evidence: `animator/gemini/pipeline.py`)
- Beat narration → Beat timing: measures beats (evidence: `animator/gemini/narration.py`)
- Storyboard → Gemini client: calls model (evidence: `animator/gemini/storyboard.py`)
- Scene images → Gemini client: calls model (evidence: `animator/gemini/images.py`)
- Beat narration → Gemini client: calls model (evidence: `animator/gemini/narration.py`)
- Region detection → Gemini client: calls model (evidence: `animator/gemini/detect_regions.py`)
- Gemini client → Google Gemini: sends requests
- Storyboard → Prompt templates: loads template (evidence: `animator/gemini/storyboard.py`)
- Scene images → Prompt templates: loads template (evidence: `animator/gemini/images.py`)
- Region detection → Prompt templates: loads template (evidence: `animator/gemini/detect_regions.py`)
- Prompt pipeline → Region plans: sets beat windows (evidence: `animator/gemini/pipeline.py`)
- Video renderer → Region plans: uses timing plans (evidence: `animator/render.py`)
- Video renderer → Animation engine: renders scenes (evidence: `animator/render.py`)
- Animation engine → Text detection: detects text (evidence: `animator/engine.py`)
- Animation engine → Component ordering: orders components (evidence: `animator/engine.py`)
- Animation engine → Fill painting: paints fills (evidence: `animator/engine.py`)
- Animation engine → Stroke tracing: traces strokes (evidence: `animator/engine.py`)
- Animation engine → Video encoding: encodes frames (evidence: `animator/engine.py`)
- Video encoding → FFmpeg: encodes video (evidence: `animator/video_encoding.py`)
- User → HTTP application: sends requests (evidence: `README.md`)
- HTTP application → Generate route: registers route (evidence: `animator/api/app.py`)
- Generate route → User authentication: authenticates user (evidence: `animator/api/routers/generate.py`)
- User authentication → Supabase access: looks up user (evidence: `animator/api/auth.py`)
- Generate route → Supabase access: claims and charges (evidence: `animator/api/routers/generate.py`)
- Generate route → Generation jobs: schedules job (evidence: `animator/api/routers/generate.py`)
- Generate route → Service settings: reads pricing (evidence: `animator/api/routers/generate.py`)
- HTTP application → Service settings: configures app (evidence: `animator/api/app.py`)
- Supabase access → Service settings: reads credentials (evidence: `animator/api/supabase.py`)
- Supabase access → Supabase: reads and updates (evidence: `animator/api/supabase.py`)
- Generation jobs → Supabase access: updates job data (evidence: `animator/api/jobs.py`)
- Generation jobs → Prompt pipeline: runs generation (evidence: `animator/api/jobs.py`)
