# ptlc8/maeva architecture

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

- Interactive diagram: https://gitdiagram.com/ptlc8/maeva
- Repository: https://github.com/ptlc8/maeva

## Overview

##### Main Components Identification
The system should be divided into these primary components:

a) Core Bot Infrastructure
- Main Application Entry Point
- Bot Listener System
- Command Handler
- Message Processing System

b) External Services Integration
- Discord API (via JDA)
- Giphy API
- Twitch Integration
- Web Server Component

c) Data Management
- JSON-based Storage
- State Management
- User Data Handling

**┌─ Bot Core ─────────────┐**
- Main Controller      │
- Event Listeners      │
- Command Processor    │
- Message Handler      │
- ┘

**┌─ Commands ──────────┐**
- Administrative    │
- Economy          │
- Entertainment    │
- Utility          │
- Moderation       │
- ┘

**┌─ External APIs ─────┐**
- Discord (JDA)     │
- Giphy API        │
- Twitch           │
- ┘

**┌─ Data Management ───┐**
- JSON Storage     │
- User Data        │
- Server Settings  │
- ┘

##### Component Details

For each major component, include:
- Input/Output relationships
- Dependencies
- State management
- Error handling paths

##### Technical Stack Indicators

Technology usage:
- Java runtime
- JDA library
- GSON for JSON handling
- PircBot for Twitch
- OkHttp for API calls

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        Main["Main Bot Core"]:::core
        EventListener["Event Listener System"]:::core
        CmdProcessor["Command Processing"]:::core
        MsgHandler["Message Handler"]:::core
    end

    subgraph "External Services"
        DiscordAPI["Discord API (JDA)"]:::external
        GiphyAPI["Giphy API"]:::external
        TwitchInt["Twitch Integration"]:::external
        WebServer["Web Server"]:::external
    end

    subgraph "Command Modules"
        CmdAdmin["Administrative Commands"]:::command
        CmdEcon["Economy Commands"]:::command
        CmdEnt["Entertainment Commands"]:::command
        CmdUtil["Utility Commands"]:::command
        CmdMod["Moderation Commands"]:::command
        ChatBot["Chat Bot System"]:::command
    end

    subgraph "Data Management"
        DataCore["Data Core"]:::data
        UserMgmt["User Management"]:::data
        ServerMgmt["Server Management"]:::data
        ShopSystem["Shop System"]:::data
        Config["Configuration"]:::data
        Logger["Logging System"]:::data
    end

    Main --> EventListener
    EventListener --> MsgHandler
    MsgHandler --> CmdProcessor
    CmdProcessor --> |Commands| CmdAdmin
    CmdProcessor --> |Commands| CmdEcon
    CmdProcessor --> |Commands| CmdEnt
    CmdProcessor --> |Commands| CmdUtil
    CmdProcessor --> |Commands| CmdMod
    CmdProcessor --> |Commands| ChatBot

    Main -.-> DiscordAPI
    Main -.-> GiphyAPI
    Main -.-> TwitchInt
    Main -.-> WebServer

    DataCore --> UserMgmt
    DataCore --> ServerMgmt
    DataCore --> ShopSystem
    DataCore --> Config
    DataCore --> Logger

    MsgHandler --> DataCore
    CmdProcessor --> DataCore

    %% Click Events
    click Main "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/Main.java"
    click EventListener "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/BotListener.java"
    click CmdProcessor "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/Commands.java"
    click MsgHandler "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/OnMessage.java"
    click GiphyAPI "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/giphyapi/json/GiphyAPI.java"
    click TwitchInt "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/twitch/OnTwitch.java"
    click DataCore "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/data/Data.java"
    click ShopSystem "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/data/Shop.java"
    click CmdAdmin "https://github.com/ptlc8/maeva/tree/master/src/fr/ptlc/maeva/commands/"
    click WebServer "https://github.com/ptlc8/maeva/tree/master/web-server/src/"
    click Config "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/data/Options.java"
    click UserMgmt "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/data/Client.java"
    click ServerMgmt "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/data/Server.java"
    click ChatBot "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/ChatBotResponse.java"
    click Logger "https://github.com/ptlc8/maeva/blob/master/src/fr/ptlc/maeva/commands/Log.jav"

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef external fill:#2ecc71,stroke:#27ae60,color:white
    classDef command fill:#e67e22,stroke:#d35400,color:white
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["External Services"]:::external
        L3["Command Modules"]:::command
        L4["Data Management"]:::data
    end
```
