# marvinody/fumodiscordbots architecture

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

- Interactive diagram: https://gitdiagram.com/marvinody/fumodiscordbots
- Repository: https://github.com/marvinody/fumodiscordbots

## Overview

Key Components to Include:

##### Core Components
- Discord Integration (Central Hub)
- Machine Learning Model (fumoModel)
- SQLite Database (fumo.db)
- Platform-specific Bots

##### Component Details

**External Platforms <---> Platform-specific Bots <---> Discord**
- ↓
- Fumo Detector (ML)
- ↓
- Database

##### Additional Elements
- A configuration section showing the example JSON files
- Logrotate configuration
- Requirements.txt dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        A[Service/Component]:::service --- B[Database]:::db
        C["/External Platform\nIntegration"]:::platform --- D["ML Component"]:::ml
        E["Configuration"]:::config
        style Legend fill:#f0f0f0,stroke:#333
    end

    subgraph "Core System"
        Discord[Discord Integration]:::service
        DB[(SQLite Database)]:::db
        click DB "https://github.com/marvinody/fumodiscordbots/blob/master/fumo.db"
    end

    subgraph "Machine Learning Layer"
        FumoDetector[Fumo Detector]:::ml
        click FumoDetector "https://github.com/marvinody/fumodiscordbots/blob/master/fumo_detector.py"
        
        subgraph "ML Model"
            ModelCheckpoint[Checkpoint]:::ml
            click ModelCheckpoint "https://github.com/marvinody/fumodiscordbots/tree/master/fumoModel/graph/checkpoint"
            FrozenModel[Frozen Model]:::ml
            click FrozenModel "https://github.com/marvinody/fumodiscordbots/blob/master/fumoModel/graph/frozen_inference_graph.pb"
            SavedModel[Saved Model]:::ml
            click SavedModel "https://github.com/marvinody/fumodiscordbots/blob/master/fumoModel/graph/saved_model/saved_model.pb"
            ObjectConfig[Object Detection Config]:::ml
            click ObjectConfig "https://github.com/marvinody/fumodiscordbots/blob/master/fumoModel/object_detection.pbtxt"
        end
    end

    subgraph "Platform Bots"
        Chan4Bot[4chan Bot]:::service
        click Chan4Bot "https://github.com/marvinody/fumodiscordbots/blob/master/fumo4chan.py"
        BuyeeBot[Buyee Bot]:::service
        click BuyeeBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoBuyee.py"
        TwitterBot[Twitter Bot]:::service
        click TwitterBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoTwitter.py"
        FacebookBot[Facebook Bot]:::service
        click FacebookBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoFacebook.py"
        InstagramBot[Instagram Bot]:::service
        click InstagramBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoInstagram.py"
        MercariBot[Mercari Bot]:::service
        click MercariBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoMercari.py"
        SuruguyaBot[Suruguya Bot]:::service
        click SuruguyaBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoSuruguya.py"
        AmiamiBot[Amiami Bot]:::service
        click AmiamiBot "https://github.com/marvinody/fumodiscordbots/blob/master/fumoAmiami.py"
    end

    subgraph "Configuration Files"
        BuyeeConfig[Buyee Config]:::config
        click BuyeeConfig "https://github.com/marvinody/fumodiscordbots/blob/master/buyee.example.json"
        FacebookConfig[Facebook Config]:::config
        click FacebookConfig "https://github.com/marvinody/fumodiscordbots/blob/master/facebook.example.json"
        InstagramConfig[Instagram Config]:::config
        click InstagramConfig "https://github.com/marvinody/fumodiscordbots/blob/master/instagram.example.json"
        MercariConfig[Mercari Config]:::config
        click MercariConfig "https://github.com/marvinody/fumodiscordbots/blob/master/mercari.example.json"
        SuruguyaConfig[Suruguya Config]:::config
        click SuruguyaConfig "https://github.com/marvinody/fumodiscordbots/blob/master/suruguya.example.json"
        TwitterConfig[Twitter Config]:::config
        click TwitterConfig "https://github.com/marvinody/fumodiscordbots/blob/master/twitter.example.json"
        AmiamiConfig[Amiami Config]:::config
        click AmiamiConfig "https://github.com/marvinody/fumodiscordbots/blob/master/amiami.example.json"
    end

    subgraph "System Config"
        LogRotate[Log Rotation]:::config
        click LogRotate "https://github.com/marvinody/fumodiscordbots/blob/master/logrotate.fumoBot.conf"
        Requirements[Dependencies]:::config
        click Requirements "https://github.com/marvinody/fumodiscordbots/blob/master/requirements.txt"
    end

    %% Connections
    Chan4Bot & BuyeeBot & TwitterBot & FacebookBot & InstagramBot & MercariBot & SuruguyaBot & AmiamiBot --> Discord
    Discord --> FumoDetector
    FumoDetector --> DB
    
    ModelCheckpoint & FrozenModel & SavedModel & ObjectConfig --> FumoDetector
    
    BuyeeConfig --> BuyeeBot
    FacebookConfig --> FacebookBot
    InstagramConfig --> InstagramBot
    MercariConfig --> MercariBot
    SuruguyaConfig --> SuruguyaBot
    TwitterConfig --> TwitterBot
    AmiamiConfig --> AmiamiBot

    %% Styles
    classDef service fill:#a8d1ff,stroke:#333
    classDef db fill:#c4c4c4,stroke:#333
    classDef platform fill:#90EE90,stroke:#333
    classDef ml fill:#FFE5B4,stroke:#333
    classDef config fill:#FFB6C1,stroke:#333
```
