# mandur23/tendo_aris architecture

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

- Interactive diagram: https://gitdiagram.com/mandur23/tendo_aris
- Repository: https://github.com/mandur23/tendo_aris

## Overview

Aris is a Discord bot whose principal workflow is a user command entering a registered cog, which invokes a game, media, AI, or market capability and returns a Discord response. The launcher registers those cogs and starts the bot; music and TTS share voice playback infrastructure, while TRPG cogs use a rules engine and local-LLM generation. Persistence is split between JSON files and optional MySQL. The README documents capabilities beyond the sampled excerpts; links for those features use explicit README statements or indexed imports, not inferred sibling calls.

Main entry points: [`core/launcher.py`](https://github.com/mandur23/tendo_aris/blob/master/core/launcher.py) (Bot launcher), [`cogs/chat_ai.py`](https://github.com/mandur23/tendo_aris/blob/master/cogs/chat_ai.py) (AI chat), [`cogs/trpg.py`](https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg.py) (Solo adventures), [`utils/file_utils.py`](https://github.com/mandur23/tendo_aris/blob/master/utils/file_utils.py) (JSON and files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_launcher["Bot launcher<br/>[launcher.py]"]
  node_commands["Command bot<br/>[bot.py]"]
  node_web_admin["Web admin<br/>[web_admin.py]"]
  node_watchdog["Bot watchdog<br/>[watchdog.py]"]
  node_shutdown["Shutdown handler"]
  node_blackjack["Blackjack game<br/>[BlackjackGame.py]"]
end

subgraph group_media["Voice and media"]
  node_music["Music commands<br/>[music.py]"]
  node_player["Music player<br/>[music_player.py]"]
  node_youtube["YouTube extraction<br/>[ytdl_utils.py]"]
  node_mixer["Audio mixer<br/>[audio_mixer.py]"]
  node_tts["TTS commands<br/>[tts.py]"]
  node_tts_engines["TTS engines<br/>[tts_utils.py]"]
  node_rvc["RVC synthesis<br/>[rvc_utils.py]"]
end

subgraph group_ai["AI and adventures"]
  node_chat["AI chat<br/>[chat_ai.py]"]
  node_trpg_solo["Solo adventures<br/>[trpg.py]"]
  node_trpg_party["Party adventures<br/>[trpg_party.py]"]
  node_trpg_world["Shared world<br/>[trpg_world.py]"]
  node_trpg_engine["TRPG engine<br/>[TRPGEngine.py]"]
  node_trpg_ui["Adventure UI<br/>[trpg_ui.py]"]
  node_dice["Dice utilities<br/>[trpg_dice.py]"]
  node_web_search["Web search<br/>[web_search.py]"]
  node_knowledge["Knowledge lookup<br/>[knowledge_utils.py]"]
end

subgraph group_market["Market data"]
  node_stock["Stock commands<br/>[stock.py]"]
  node_krx["KRX market data<br/>[krx_api.py]"]
  node_naver["Naver market data<br/>[naver_stock.py]"]
end

subgraph group_platform["Shared services"]
  node_config["Configuration<br/>[config.py]"]
  node_files[("JSON and files<br/>[file_utils.py]")]
  node_db[("MySQL storage<br/>[db_utils.py]")]
end

node_user(("Discord user"))
node_discord(("Discord platform"))
node_ollama(("Ollama service"))
node_mysql[("MySQL server")]
node_youtube_service(("YouTube"))
node_web(("Web search service"))

node_user -->|"sends command"| node_discord
node_discord -->|"routes commands"| node_commands
node_launcher -->|"starts"| node_commands
node_launcher -->|"registers"| node_music
node_launcher -->|"registers"| node_tts
node_launcher -->|"registers"| node_chat
node_launcher -->|"registers"| node_trpg_solo
node_launcher -->|"registers"| node_trpg_party
node_launcher -->|"registers"| node_trpg_world
node_launcher -->|"registers"| node_stock
node_launcher -->|"starts"| node_web_admin
node_launcher -->|"starts"| node_watchdog
node_launcher -->|"uses"| node_shutdown
node_music -->|"controls"| node_player
node_player -->|"extracts media"| node_youtube
node_youtube -->|"fetches media"| node_youtube_service
node_music -->|"loads playlists"| node_files
node_music -->|"stores history"| node_db
node_player -->|"plays audio"| node_mixer
node_tts -->|"plays overlays"| node_mixer
node_tts -->|"synthesizes speech"| node_tts_engines
node_tts -->|"uses voice models"| node_rvc
node_chat -->|"generates replies"| node_ollama
node_chat -->|"reads adventure context"| node_trpg_solo
node_chat -->|"requests search"| node_web_search
node_web_search -->|"searches web"| node_web
node_chat -->|"retrieves documents"| node_knowledge
node_chat -->|"loads saved context"| node_files
node_trpg_solo -->|"runs rules"| node_trpg_engine
node_trpg_party -->|"runs rules"| node_trpg_engine
node_trpg_world -->|"runs rules"| node_trpg_engine
node_trpg_solo -->|"uses controls"| node_trpg_ui
node_trpg_party -->|"uses controls"| node_trpg_ui
node_trpg_world -->|"uses controls"| node_trpg_ui
node_trpg_engine -->|"generates scenes"| node_ollama
node_trpg_solo -->|"rolls checks"| node_dice
node_trpg_party -->|"rolls checks"| node_dice
node_trpg_world -->|"rolls checks"| node_dice
node_trpg_solo -->|"saves adventures"| node_files
node_trpg_party -->|"saves adventures"| node_files
node_trpg_world -->|"saves adventures"| node_files
node_stock -->|"queries market"| node_krx
node_stock -->|"queries market"| node_naver
node_web_admin -->|"checks storage"| node_db
node_web_admin -->|"checks market data"| node_krx
node_web_admin -->|"checks market data"| node_naver
node_files -->|"reads settings"| node_config
node_db -->|"reads settings"| node_config

click node_launcher "https://github.com/mandur23/tendo_aris/blob/master/core/launcher.py"
click node_commands "https://github.com/mandur23/tendo_aris/blob/master/core/bot.py"
click node_music "https://github.com/mandur23/tendo_aris/blob/master/cogs/music.py"
click node_player "https://github.com/mandur23/tendo_aris/blob/master/core/music_player.py"
click node_youtube "https://github.com/mandur23/tendo_aris/blob/master/utils/ytdl_utils.py"
click node_mixer "https://github.com/mandur23/tendo_aris/blob/master/core/audio_mixer.py"
click node_tts "https://github.com/mandur23/tendo_aris/blob/master/cogs/tts.py"
click node_tts_engines "https://github.com/mandur23/tendo_aris/blob/master/utils/tts_utils.py"
click node_rvc "https://github.com/mandur23/tendo_aris/blob/master/utils/rvc_utils.py"
click node_chat "https://github.com/mandur23/tendo_aris/blob/master/cogs/chat_ai.py"
click node_trpg_solo "https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg.py"
click node_trpg_party "https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_party.py"
click node_trpg_world "https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_world.py"
click node_trpg_engine "https://github.com/mandur23/tendo_aris/blob/master/GameSystem/TRPGEngine.py"
click node_trpg_ui "https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_ui.py"
click node_dice "https://github.com/mandur23/tendo_aris/blob/master/utils/trpg_dice.py"
click node_web_search "https://github.com/mandur23/tendo_aris/blob/master/utils/web_search.py"
click node_knowledge "https://github.com/mandur23/tendo_aris/blob/master/utils/knowledge_utils.py"
click node_stock "https://github.com/mandur23/tendo_aris/blob/master/cogs/stock.py"
click node_krx "https://github.com/mandur23/tendo_aris/blob/master/utils/krx_api.py"
click node_naver "https://github.com/mandur23/tendo_aris/blob/master/utils/naver_stock.py"
click node_web_admin "https://github.com/mandur23/tendo_aris/blob/master/core/web_admin.py"
click node_watchdog "https://github.com/mandur23/tendo_aris/blob/master/core/watchdog.py"
click node_shutdown "https://github.com/mandur23/tendo_aris/blob/master/core/shutdown_handler.py"
click node_config "https://github.com/mandur23/tendo_aris/blob/master/utils/config.py"
click node_files "https://github.com/mandur23/tendo_aris/blob/master/utils/file_utils.py"
click node_db "https://github.com/mandur23/tendo_aris/blob/master/utils/db_utils.py"
click node_blackjack "https://github.com/mandur23/tendo_aris/blob/master/GameSystem/BlackjackGame.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_commands,node_web_admin,node_watchdog,node_shutdown,node_blackjack,node_user toneBlue
class node_music,node_player,node_youtube,node_mixer,node_tts,node_tts_engines,node_rvc,node_mysql toneAmber
class node_chat,node_trpg_solo,node_trpg_party,node_trpg_world,node_trpg_engine,node_trpg_ui,node_dice,node_web_search,node_knowledge toneMint
class node_stock,node_krx,node_naver toneRose
class node_config,node_files,node_db,node_discord,node_ollama,node_youtube_service,node_web toneIndigo
```

## Components

### Bot runtime

- [Bot launcher](https://github.com/mandur23/tendo_aris/blob/master/core/launcher.py): `core/launcher.py`
- [Command bot](https://github.com/mandur23/tendo_aris/blob/master/core/bot.py): `core/bot.py`
- [Web admin](https://github.com/mandur23/tendo_aris/blob/master/core/web_admin.py): `core/web_admin.py`
- [Bot watchdog](https://github.com/mandur23/tendo_aris/blob/master/core/watchdog.py): `core/watchdog.py`
- [Shutdown handler](https://github.com/mandur23/tendo_aris/blob/master/core/shutdown_handler.py): `core/shutdown_handler.py`
- [Blackjack game](https://github.com/mandur23/tendo_aris/blob/master/GameSystem/BlackjackGame.py): `GameSystem/BlackjackGame.py`

### Voice and media

- [Music commands](https://github.com/mandur23/tendo_aris/blob/master/cogs/music.py): `cogs/music.py`
- [Music player](https://github.com/mandur23/tendo_aris/blob/master/core/music_player.py): `core/music_player.py`
- [YouTube extraction](https://github.com/mandur23/tendo_aris/blob/master/utils/ytdl_utils.py): `utils/ytdl_utils.py`
- [Audio mixer](https://github.com/mandur23/tendo_aris/blob/master/core/audio_mixer.py): `core/audio_mixer.py`
- [TTS commands](https://github.com/mandur23/tendo_aris/blob/master/cogs/tts.py): `cogs/tts.py`
- [TTS engines](https://github.com/mandur23/tendo_aris/blob/master/utils/tts_utils.py): `utils/tts_utils.py`
- [RVC synthesis](https://github.com/mandur23/tendo_aris/blob/master/utils/rvc_utils.py): `utils/rvc_utils.py`

### AI and adventures

- [AI chat](https://github.com/mandur23/tendo_aris/blob/master/cogs/chat_ai.py): `cogs/chat_ai.py`
- [Solo adventures](https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg.py): `cogs/trpg.py`
- [Party adventures](https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_party.py): `cogs/trpg_party.py`
- [Shared world](https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_world.py): `cogs/trpg_world.py`
- [TRPG engine](https://github.com/mandur23/tendo_aris/blob/master/GameSystem/TRPGEngine.py): `GameSystem/TRPGEngine.py`
- [Adventure UI](https://github.com/mandur23/tendo_aris/blob/master/cogs/trpg_ui.py): `cogs/trpg_ui.py`
- [Dice utilities](https://github.com/mandur23/tendo_aris/blob/master/utils/trpg_dice.py): `utils/trpg_dice.py`
- [Web search](https://github.com/mandur23/tendo_aris/blob/master/utils/web_search.py): `utils/web_search.py`
- [Knowledge lookup](https://github.com/mandur23/tendo_aris/blob/master/utils/knowledge_utils.py): `utils/knowledge_utils.py`

### Market data

- [Stock commands](https://github.com/mandur23/tendo_aris/blob/master/cogs/stock.py): `cogs/stock.py`
- [KRX market data](https://github.com/mandur23/tendo_aris/blob/master/utils/krx_api.py): `utils/krx_api.py`
- [Naver market data](https://github.com/mandur23/tendo_aris/blob/master/utils/naver_stock.py): `utils/naver_stock.py`

### Shared services

- [Configuration](https://github.com/mandur23/tendo_aris/blob/master/utils/config.py): `utils/config.py`
- [JSON and files](https://github.com/mandur23/tendo_aris/blob/master/utils/file_utils.py): `utils/file_utils.py`
- [MySQL storage](https://github.com/mandur23/tendo_aris/blob/master/utils/db_utils.py): `utils/db_utils.py`

### Other components

- **Discord user**
- **Discord platform**
- **Ollama service**
- **MySQL server**
- **YouTube**
- **Web search service**

## Connections

- Discord user → Discord platform: sends command (evidence: `README.md`)
- Discord platform → Command bot: routes commands (evidence: `README.md`)
- Bot launcher → Command bot: starts (evidence: `core/launcher.py`)
- Bot launcher → Music commands: registers (evidence: `core/launcher.py`)
- Bot launcher → TTS commands: registers (evidence: `core/launcher.py`)
- Bot launcher → AI chat: registers (evidence: `core/launcher.py`)
- Bot launcher → Solo adventures: registers (evidence: `core/launcher.py`)
- Bot launcher → Party adventures: registers (evidence: `core/launcher.py`)
- Bot launcher → Shared world: registers (evidence: `core/launcher.py`)
- Bot launcher → Stock commands: registers (evidence: `core/launcher.py`)
- Bot launcher → Web admin: starts (evidence: `core/launcher.py`)
- Bot launcher → Bot watchdog: starts (evidence: `bot.py`)
- Bot launcher → Shutdown handler: uses (evidence: `bot.py`)
- Music commands → Music player: controls (evidence: `cogs/music.py`)
- Music player → YouTube extraction: extracts media (evidence: `core/music_player.py`)
- YouTube extraction → YouTube: fetches media (evidence: `README.md`)
- Music commands → JSON and files: loads playlists (evidence: `cogs/music.py`)
- Music commands → MySQL storage: stores history (evidence: `cogs/music.py`)
- Music player → Audio mixer: plays audio (evidence: `core/music_player.py`)
- TTS commands → Audio mixer: plays overlays (evidence: `cogs/tts.py`)
- TTS commands → TTS engines: synthesizes speech (evidence: `cogs/tts.py`)
- TTS commands → RVC synthesis: uses voice models (evidence: `cogs/tts.py`)
- AI chat → Ollama service: generates replies (evidence: `README.md`)
- AI chat → Solo adventures: reads adventure context (evidence: `cogs/chat_ai.py`)
- AI chat → Web search: requests search (evidence: `cogs/chat_ai.py`)
- Web search → Web search service: searches web (evidence: `README.md`)
- AI chat → Knowledge lookup: retrieves documents (evidence: `cogs/chat_ai.py`)
- AI chat → JSON and files: loads saved context (evidence: `cogs/chat_ai.py`)
- Solo adventures → TRPG engine: runs rules (evidence: `cogs/trpg.py`)
- Party adventures → TRPG engine: runs rules (evidence: `cogs/trpg_party.py`)
- Shared world → TRPG engine: runs rules (evidence: `cogs/trpg_world.py`)
- Solo adventures → Adventure UI: uses controls (evidence: `cogs/trpg.py`)
- Party adventures → Adventure UI: uses controls (evidence: `cogs/trpg_party.py`)
- Shared world → Adventure UI: uses controls (evidence: `cogs/trpg_world.py`)
- TRPG engine → Ollama service: generates scenes (evidence: `GameSystem/TRPGEngine.py`)
- Solo adventures → Dice utilities: rolls checks (evidence: `cogs/trpg.py`)
- Party adventures → Dice utilities: rolls checks (evidence: `cogs/trpg_party.py`)
- Shared world → Dice utilities: rolls checks (evidence: `cogs/trpg_world.py`)
- Solo adventures → JSON and files: saves adventures (evidence: `README.md`)
- Party adventures → JSON and files: saves adventures (evidence: `README.md`)
- Shared world → JSON and files: saves adventures (evidence: `README.md`)
- Stock commands → KRX market data: queries market (evidence: `cogs/stock.py`)
- Stock commands → Naver market data: queries market (evidence: `cogs/stock.py`)
- Web admin → MySQL storage: checks storage (evidence: `core/web_admin.py`)
- Web admin → KRX market data: checks market data (evidence: `core/web_admin.py`)
- Web admin → Naver market data: checks market data (evidence: `core/web_admin.py`)
- JSON and files → Configuration: reads settings (evidence: `utils/file_utils.py`)
- MySQL storage → Configuration: reads settings (evidence: `utils/db_utils.py`)
