# brunobriante/rodanodeck_bot architecture

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

- Interactive diagram: https://gitdiagram.com/brunobriante/rodanodeck_bot
- Repository: https://github.com/brunobriante/rodanodeck_bot

## Overview

##### Main Components

a. Entry Point Layer:
- `cmd/bot/main.go` as the application entry point

b. Core Bot Layer:
- Center the `internal/bot` package as the core of the system
- Following components from internal/bot:
- bot.go (main bot logic)
- protondb.go (ProtonDB API integration)
- results.go (results handling)
- sdhq.go (Steam Deck HQ integration)
- steam.go (Steam API integration)

c. External Services Layer:
- ProtonDB API
- Steam API
- Steam Deck HQ API
- Bot Platform API (likely Telegram or Discord)

d. Configuration Layer:
- Configs directory with env.go and message.tmpl
- Configuration flow into the system

##### Component Relationships

- Entry Point → Bot Core (initialization flow)
- Bot Core → External Services (API calls)
- Configuration → Bot Core (config injection)
- Bot Core → Results Handler (data processing)

##### Specific Implementation Details

**[External Services Layer]**
- ↕
**[Bot Core Layer]**
- ↕
**[Configuration Layer]**
- ↑
**[Entry Point Layer]**

b. Specific elements:
- Message flow from user input through the system
- API call patterns to external services
- Results processing and response flow
- Configuration injection points

##### Technical Details to Highlight

- Go-specific patterns (goroutines if used)
- API integration points
- Configuration management
- Message template system

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        ProtonDB[ProtonDB API]
        SteamAPI[Steam API]
        SDHQ[Steam Deck HQ API]
        BotPlatform[Bot Platform API]
    end

    subgraph Core
        BotLogic["Bot Logic"]:::core
        ProtonDBInt["ProtonDB Integration"]:::core
        ResultsHandler["Results Handler"]:::core
        SDHQInt["Steam Deck HQ Integration"]:::core
        SteamInt["Steam Integration"]:::core
    end

    subgraph Config
        EnvConfig["Environment Config"]:::config
        MsgTemplate["Message Templates"]:::config
        EnvExample["Environment Example"]:::config
    end

    Entry["Application Entry Point"]:::entry

    %% Connections
    Entry --> BotLogic
    BotLogic --> ProtonDBInt
    BotLogic --> SDHQInt
    BotLogic --> SteamInt
    BotLogic --> ResultsHandler
    
    ProtonDBInt --> ProtonDB
    SDHQInt --> SDHQ
    SteamInt --> SteamAPI
    BotLogic --> BotPlatform
    
    EnvConfig --> BotLogic
    MsgTemplate --> BotLogic
    EnvExample -.-> EnvConfig

    %% Click Events
    click Entry "https://github.com/brunobriante/rodanodeck_bot/blob/main/cmd/bot/main.go"
    click BotLogic "https://github.com/brunobriante/rodanodeck_bot/blob/main/internal/bot/bot.go"
    click ProtonDBInt "https://github.com/brunobriante/rodanodeck_bot/blob/main/internal/bot/protondb.go"
    click ResultsHandler "https://github.com/brunobriante/rodanodeck_bot/blob/main/internal/bot/results.go"
    click SDHQInt "https://github.com/brunobriante/rodanodeck_bot/blob/main/internal/bot/sdhq.go"
    click SteamInt "https://github.com/brunobriante/rodanodeck_bot/blob/main/internal/bot/steam.go"
    click EnvConfig "https://github.com/brunobriante/rodanodeck_bot/blob/main/configs/env.go"
    click MsgTemplate "https://github.com/brunobriante/rodanodeck_bot/blob/main/configs/message.tmpl"
    click EnvExample "https://github.com/brunobriante/rodanodeck_bot/blob/main/configs/env.example"

    %% Styles
    classDef core fill:#2374ab
    classDef config fill:#ffd700
    classDef entry fill:#95a5a6
    classDef external fill:#2ecc71

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        ConfigComp["Configuration"]:::config
        EntryComp["Entry Point"]:::entry
        ExtComp["External Service"]:::external
    end
```
