# malkiii/quran-tiktok-bot architecture

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

- Interactive diagram: https://gitdiagram.com/malkiii/quran-tiktok-bot
- Repository: https://github.com/malkiii/quran-tiktok-bot

## Overview

##### Flow Representation

**Asset Acquisition Flow:**
**YouTube → Python Downloader → Local Storage → Cloudinary**

**Video Generation Flow:**
**Cloudinary → Props Generator → Remotion Renderer → Local Video Output**

**Publishing Flow:**
**Local Video Output → TikTok API Client → TikTok Platform**

##### Important Technical Details to Note

- Node.js 20+ Runtime Environment
- Python 3 Dependencies
- Remotion Linux Dependencies
- TikTok OAuth Authentication
- Environment Configuration

##### Integration Points

- Clear interfaces between:
- YouTube → Download Scripts
- Cloudinary ↔ Asset Management
- Remotion → Video Generation
- TikTok API → Content Publishing

##### Automation Workflow

**Trigger → Setup Environment → Download Assets → Generate Video → Upload to TikTok**

Special Considerations:

##### Development feedback loop (Remotion Studio)

This system design should clearly communicate both the automated and manual aspects of the content generation pipeline, making it easy for other developers to understand the project's architecture and workflow.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Asset Management"
        YT[YouTube]:::external
        CLD[(Cloudinary)]:::storage
        LAD[("Local Asset Storage")]:::storage
        YTD["YouTube Downloader"]:::process
        AD["Asset Downloader"]:::process
    end

    subgraph "Video Generation"
        REM["Remotion Studio"]:::process
        VCE["Video Composition"]:::process
        PG["Props Generator"]:::process
        RC["Root Component"]:::process
    end

    subgraph "Publishing"
        TTAPI["TikTok API Client"]:::process
        UM["Upload Manager"]:::process
        TT[TikTok Platform]:::external
    end

    subgraph "Automation"
        GHA["GitHub Actions"]:::automation
        SO["Scripts Orchestrator"]:::automation
        DC["Docker Container"]:::automation
    end

    %% Asset Management Flow
    YT --> YTD
    YTD --> LAD
    LAD --> CLD
    AD --> LAD

    %% Video Generation Flow
    CLD --> PG
    PG --> REM
    REM --> VCE
    VCE --> RC
    RC --> |"Video Output"| LAD

    %% Publishing Flow
    LAD --> TTAPI
    TTAPI --> TT
    TTAPI --> UM
    UM --> TT

    %% Automation Flow
    GHA --> SO
    SO --> YTD
    SO --> REM
    SO --> TTAPI
    DC --> SO

    %% Styling
    classDef external fill:#a8d1f0,stroke:#333
    classDef storage fill:#ffe4b5,stroke:#333
    classDef process fill:#98fb98,stroke:#333
    classDef automation fill:#ffa07a,stroke:#333

    %% Click Events
    click LAD "https://github.com/malkiii/quran-tiktok-bot/tree/master/assets/"
    click YTD "https://github.com/malkiii/quran-tiktok-bot/blob/master/scripts/download-youtube-videos.py"
    click AD "https://github.com/malkiii/quran-tiktok-bot/blob/master/scripts/download-assets.js"
    click REM "https://github.com/malkiii/quran-tiktok-bot/tree/master/remotion/"
    click VCE "https://github.com/malkiii/quran-tiktok-bot/blob/master/remotion/composition.tsx"
    click RC "https://github.com/malkiii/quran-tiktok-bot/blob/master/remotion/Root.tsx"
    click TTAPI "https://github.com/malkiii/quran-tiktok-bot/blob/master/scripts/upload-to-tiktok.ts"
    click UM "https://github.com/malkiii/quran-tiktok-bot/blob/master/scripts/upload-videos.py"
    click GHA "https://github.com/malkiii/quran-tiktok-bot/blob/master/.github/workflows/upload.yml"
    click DC "https://github.com/malkiii/quran-tiktok-bot/tree/master/Dockerfile"

    %% Legend
    subgraph Legend
        L1[External Services]:::external
        L2[Storage Systems]:::storage
        L3[Processing Components]:::process
        L4[Automation Tools]:::automation
    end
```
