# soumyacodes007/alcheanimyst architecture

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

- Interactive diagram: https://gitdiagram.com/soumyacodes007/alcheanimyst
- Repository: https://github.com/soumyacodes007/alcheanimyst

## Overview

##### Project Type & Purpose
- A Python-based AI tool that converts text prompts into 2D animated videos with sound.

##### Main Components
- main.py: Entry point, orchestrates the pipeline.
- engine/
- alchymist_ai.py: Core AI logic, prompt→scene planning.
- retry_loop.py: Retry wrapper for transient errors.
- services/
- elevenlabs_service.py: Text-to-speech audio generation.
- video_creation.py: 2D animation and video assembly.
- requirements.txt: Third-party libs (e.g., AI SDKs, video tools).

##### Relationships & Data Flow
- User input → main.py
- main.py calls alchymist_ai to generate a scene script
- main.py uses retry_loop around external calls
- Audio: call elevenlabs_service → MP3/WAV
- Video: call video_creation → video frames + audio overlay
- Output: final .mp4 file

##### Architectural Patterns
- Pipeline pattern: sequential stages (AI → TTS → video)
- Modular services: each service is self-contained
- Retry decorator for resiliency

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entry Point
    Main["main.py"]:::entry

    %% Engine Modules
    subgraph "Engine" 
        Alch["alchymist_ai.py"]:::engine
        Retry["retry_loop.py"]:::engine
    end

    %% Service Modules
    subgraph "Services"
        Eleven["elevenlabs_service.py"]:::service
        Video["video_creation.py"]:::service
    end

    %% Output
    Output["final_video.mp4"]:::output

    %% Data Flow
    Main -->|"generate script"| Alch
    Alch -.->|"retry wrapper"| Retry
    Retry -->|"synthesize audio"| Eleven
    Retry -->|"render video"| Video
    Video -->|"produce .mp4"| Output

    %% Dependencies
    Req["requirements.txt"]:::dep

    %% Click Events
    click Main "https://github.com/soumyacodes007/alcheanimyst/blob/main/src/main.py"
    click Alch "https://github.com/soumyacodes007/alcheanimyst/blob/main/src/engine/alchymist_ai.py"
    click Retry "https://github.com/soumyacodes007/alcheanimyst/blob/main/src/engine/retry_loop.py"
    click Eleven "https://github.com/soumyacodes007/alcheanimyst/blob/main/src/services/elevenlabs_service.py"
    click Video "https://github.com/soumyacodes007/alcheanimyst/blob/main/src/services/video_creation.py"
    click Req "https://github.com/soumyacodes007/alcheanimyst/blob/main/requirements.txt"

    %% Styles
    classDef entry fill:#f9f,stroke:#333,stroke-width:2px
    classDef engine fill:#bbf,stroke:#333,stroke-width:1px
    classDef service fill:#bfb,stroke:#333,stroke-width:1px
    classDef output fill:#ffe066,stroke:#333,stroke-width:1px
    classDef dep fill:#ddd,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5
```
