# pr0tel/chooseone architecture

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

- Interactive diagram: https://gitdiagram.com/pr0tel/chooseone
- Repository: https://github.com/pr0tel/chooseone

## Overview

##### Main Components
- Video Generation Engine (main.py): This is the entry point controlling the workflow.
- AI Services Integration:
– GPT: Used to generate questions and text prompts.
– Kandinsky: Used to transform text prompts into images.
- Media Assets:
– Assets Folder: Contains pre-made media like audio (audio.mp3) and video backgrounds (first_bg.mp4) used during video compilation.
- External Dependencies:
– Python libraries specified in requirements.txt.
- Output:
– The final compiled video is produced and stored in the root folder.

##### Relationships and Data Flow
- The engine (main.py) initiates the process by calling the GPT API to generate a question and corresponding answers/options.
- The generated text is then used to create image prompts for Kandinsky.
- Kandinsky generates the images which are then compiled along with static assets (audio and background video) to generate the final video.

##### Architectural Patterns or Design Principles
- Modular Design: Even though it’s a single script, consider depicting the logical separation between:
- Input generation (GPT module)
- Processing (Kandinsky image generation)
- Media Compilation (video creation using static assets)
- Integration of External Services: Clearly mark the boundaries where external API calls are made.
- Dependency Management: Note that the project uses a requirements.txt file to manage Python libraries, which is essential for reproducibility.

##### Relevant Technologies and Libraries
- Python as the main language
- OpenAI GPT service for text generation
- Kandinsky API/service for image creation
- Standard media processing libraries (possibly moviepy or similar, although not explicitly mentioned—they might be part of the requirements)

##### Final Steps
- That each module is distinctly represented.
- Notes/comments if needed (like “Set your API key” from the README).
- Keep the design simple and intuitive, focusing on the linear flow of data through the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    ED["Python Dependencies (requirements.txt)"]:::dependency
    VGE["Video Generation Engine (main.py)"]:::internal
    G["GPT-based Text Generator"]:::external
    K["Kandinsky-based Image Generator"]:::external
    VC["Media Compilation (Video Compiler)"]:::internal
    MV["Media Assets (Assets/)"]:::asset
    F["Final Video Output (Root Folder)"]:::output

    ED --> VGE
    VGE -->|"calls"| G
    G -->|"produces_text"| K
    K -->|"generates_images"| VC
    MV -->|"provides_assets"| VC
    VC -->|"compiles_into"| F

    click VGE "https://github.com/pr0tel/chooseone/blob/master/main.py"
    click G "https://github.com/pr0tel/chooseone/blob/master/main.py"
    click K "https://github.com/pr0tel/chooseone/blob/master/main.py"
    click MV "https://github.com/pr0tel/chooseone/tree/master/Assets/"
    click ED "https://github.com/pr0tel/chooseone/blob/master/requirements.txt"
    click F "https://github.com/pr0tel/chooseone/tree/master/Root Folder"

    classDef internal fill:#fef2cc,stroke:#d9a32d,stroke-width:2px;
    classDef external fill:#d0e6ff,stroke:#4973ab,stroke-width:2px;
    classDef asset fill:#ffedcc,stroke:#d98f2e,stroke-width:2px;
    classDef output fill:#d0ffd6,stroke:#2aa352,stroke-width:2px;
    classDef dependency fill:#e0e0e0,stroke:#8a8a8a,stroke-width:2px;
```
