# murzikvasilyevich/goodpupu architecture

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

- Interactive diagram: https://gitdiagram.com/murzikvasilyevich/goodpupu
- Repository: https://github.com/murzikvasilyevich/goodpupu

## Overview

Main Components to Include:

##### Core Application Components
- Query Generator (words_helper.py)
- Text Processor (generator.py)
- Translation Service (translation_helper.py)
- Publishing Service (publish_helper.py)

##### External Services Integration
- OpenAI API (openai_helper.py)
- Airtable Integration (airtable_helper.py)
- Media Handlers:
- Audio Processing (audio_helper.py)
- Video Processing (video_helper.py)

##### Data Sources
- Dictionary Files:
- Bad Words List
- Formats Database
- Genres Database

##### Publishing Endpoints
- Telegram Channels (3 different language versions)
- Medium
- Twitter

Design Guidelines:

- [Data Sources] → [Core Engine] → [External Services] → [Publishing Endpoints]

##### Flow Representation

Key Interactions to Highlight:

##### Input Flow
- How dictionary files feed into the word selection process
- Random word combination into queries

##### Processing Flow
- Demonstrate the query correction process via OpenAI
- Text generation pipeline
- Translation flow for multiple languages

##### Output Flow
- Multi-channel publishing process
- Parallel distribution to different platforms

Special Considerations:

##### Error Handling
- Retry mechanisms for API calls
- Fallback paths for failed operations

##### Configuration
- Settings.py influence on system behavior
- Logging configuration impact

##### Deployment
- Docker container boundary
- GitHub Actions workflow integration

Level of Detail:

- Text generation pipeline
- Translation workflow
- Multi-channel publishing

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Data_Sources
        BadWords[(Bad Words DB)]:::data
        Formats[(Formats DB)]:::data
        Genres[(Genres DB)]:::data
    end

    subgraph Core_Engine
        QueryGen[Query Generator]:::core
        TextProc[Text Processor]:::core
        TransServ[Translation Service]:::core
        PubServ[Publishing Service]:::core
    end

    subgraph External_Services
        OpenAI[OpenAI API]:::external
        Airtable[Airtable]:::external
        subgraph Media_Handlers
            Audio[Audio Processing]:::media
            Video[Video Processing]:::media
        end
    end

    subgraph Publishing_Endpoints
        TelegramRU[Telegram RU]:::publish
        TelegramEN[Telegram EN]:::publish
        TelegramES[Telegram ES]:::publish
        Medium[Medium]:::publish
        Twitter[Twitter]:::publish
    end

    subgraph Infrastructure
        Config[Configuration]:::infra
        Docker[Docker Container]:::infra
        CICD[GitHub Actions]:::infra
    end

    %% Data Flow
    BadWords --> QueryGen
    Formats --> QueryGen
    Genres --> QueryGen
    QueryGen --> TextProc
    TextProc --> TransServ
    TransServ --> PubServ
    
    %% External Service Connections
    TextProc -.-> OpenAI
    PubServ -.-> Airtable
    PubServ -.-> Audio
    PubServ -.-> Video
    
    %% Publishing Flow
    PubServ --> TelegramRU
    PubServ --> TelegramEN
    PubServ --> TelegramES
    PubServ --> Medium
    PubServ --> Twitter
    
    %% Infrastructure Impact
    Config -.-> Core_Engine
    Docker -.-> Core_Engine
    CICD -.-> Docker

    %% Click Events
    click QueryGen "https://github.com/MurzikVasilyevich/goodpupu/blob/master/words_helper.py"
    click TextProc "https://github.com/MurzikVasilyevich/goodpupu/blob/master/generator.py"
    click TransServ "https://github.com/MurzikVasilyevich/goodpupu/blob/master/translation_helper.py"
    click PubServ "https://github.com/MurzikVasilyevich/goodpupu/blob/master/publish_helper.py"
    click OpenAI "https://github.com/MurzikVasilyevich/goodpupu/blob/master/openai_helper.py"
    click Airtable "https://github.com/MurzikVasilyevich/goodpupu/blob/master/airtable_helper.py"
    click Audio "https://github.com/MurzikVasilyevich/goodpupu/blob/master/audio_helper.py"
    click Video "https://github.com/MurzikVasilyevich/goodpupu/blob/master/video_helper.py"
    click BadWords "https://github.com/MurzikVasilyevich/goodpupu/blob/master/dictionaries/bad-words.txt"
    click Formats "https://github.com/MurzikVasilyevich/goodpupu/blob/master/dictionaries/formats.csv"
    click Genres "https://github.com/MurzikVasilyevich/goodpupu/blob/master/dictionaries/genres.csv"
    click Config "https://github.com/MurzikVasilyevich/goodpupu/blob/master/settings.py"
    click CICD "https://github.com/MurzikVasilyevich/goodpupu/blob/master/.github/workflows/docker-image.yml"
    click Docker "https://github.com/MurzikVasilyevich/goodpupu/tree/master/Dockerfile"

    %% Styling
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef data fill:#ffe6a8,stroke:#333,stroke-width:2px
    classDef external fill:#90EE90,stroke:#333,stroke-width:2px
    classDef media fill:#98FB98,stroke:#333,stroke-width:2px
    classDef publish fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[(Data Sources)]:::data
        L3[External Services]:::external
        L4[Media Handlers]:::media
        L5[Publishing Endpoints]:::publish
        L6[Infrastructure]:::infra
    end
```
