# andro2k/syon architecture

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

- Interactive diagram: https://gitdiagram.com/andro2k/syon
- Repository: https://github.com/andro2k/syon

## Overview

SYON is a Rust desktop application for streamers, intended to connect streaming platforms and react to chat and platform events with commands and voice. The intended workflow is platform input, normalized domain events, command/reward handling, and user-facing output; the README also names music and overlays, but the supplied tree does not show their implementation. The graph distinguishes the CLI, engine, adapters, persistence, and audio components. Several internal runtime connections are only implied by the product description, so they are dashed and uncited; unsampled source was not inspected.

Main entry points: [`crates/syon/src/commands.rs`](https://github.com/andro2k/syon/blob/master/crates/syon/src/commands.rs) (App commands), [`crates/syon/src/main.rs`](https://github.com/andro2k/syon/blob/master/crates/syon/src/main.rs) (Application entry), [`crates/syon-engine/src/engine.rs`](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/engine.rs) (Runtime engine), [`crates/syon-engine/src/commands.rs`](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/commands.rs) (Command handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_cli["CLI parsing<br/>[cli.rs]"]
  node_binary["Application entry<br/>[main.rs]"]
  node_app_commands["App commands<br/>[commands.rs]"]
  node_chat_input["Chat input<br/>[chat_input.rs]"]
  node_event_output["Event output<br/>[events.rs]"]
end

subgraph group_core["Domain and engine"]
  node_engine["Runtime engine<br/>[engine.rs]"]
  node_command_rules["Command handling<br/>[commands.rs]"]
  node_chat_runtime["Chat runtime<br/>[chat.rs]"]
  node_event_bus["Event bus<br/>[event_bus.rs]"]
  node_domain_events["Domain events<br/>[event.rs]"]
end

subgraph group_platforms["Platform adapters"]
  node_kick_adapter["Kick adapter<br/>[connector.rs]"]
  node_kick_oauth["Kick OAuth<br/>[oauth_client.rs]"]
  node_twitch_adapter["Twitch adapter<br/>[connector.rs]"]
  node_twitch_oauth["Twitch OAuth<br/>[oauth_client.rs]"]
end

subgraph group_services["Settings and voice"]
  node_settings["App settings<br/>[settings.rs]"]
  node_settings_store[("Settings storage<br/>[store.rs]")]
  node_toml_format["TOML format<br/>[format.rs]"]
  node_tts["Kokoro synthesis<br/>[engine.rs]"]
  node_audio["Audio playback<br/>[player.rs]"]
end

node_streamer(("Streamer"))
node_platform_services(("Streaming platforms"))

node_streamer -->|"runs"| node_binary
node_binary -->|"parses args"| node_cli
node_binary -->|"dispatches"| node_app_commands
node_app_commands -.->|"starts runtime"| node_engine
node_app_commands -->|"uses input"| node_chat_input
node_app_commands -->|"formats events"| node_event_output
node_platform_services -.->|"provides events"| node_kick_adapter
node_platform_services -.->|"provides events"| node_twitch_adapter
node_kick_adapter -.->|"normalizes"| node_domain_events
node_twitch_adapter -.->|"normalizes"| node_domain_events
node_kick_oauth -.->|"authorizes"| node_platform_services
node_twitch_oauth -.->|"authorizes"| node_platform_services
node_engine -.->|"dispatches"| node_command_rules
node_engine -.->|"publishes events"| node_event_bus
node_event_bus -.->|"delivers events"| node_chat_runtime
node_command_rules -.->|"requests speech"| node_tts
node_tts -.->|"produces clips"| node_audio
node_settings -.->|"persists settings"| node_settings_store
node_settings_store -->|"formats data"| node_toml_format

click node_cli "https://github.com/andro2k/syon/blob/master/crates/syon/src/cli.rs"
click node_binary "https://github.com/andro2k/syon/blob/master/crates/syon/src/main.rs"
click node_app_commands "https://github.com/andro2k/syon/blob/master/crates/syon/src/commands.rs"
click node_chat_input "https://github.com/andro2k/syon/blob/master/crates/syon/src/chat_input.rs"
click node_event_output "https://github.com/andro2k/syon/blob/master/crates/syon/src/events.rs"
click node_engine "https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/engine.rs"
click node_command_rules "https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/commands.rs"
click node_chat_runtime "https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/chat.rs"
click node_event_bus "https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/event_bus.rs"
click node_domain_events "https://github.com/andro2k/syon/blob/master/crates/syon-domain/src/event.rs"
click node_kick_adapter "https://github.com/andro2k/syon/blob/master/crates/syon-platform-kick/src/connector.rs"
click node_kick_oauth "https://github.com/andro2k/syon/blob/master/crates/syon-platform-kick/src/oauth_client.rs"
click node_twitch_adapter "https://github.com/andro2k/syon/blob/master/crates/syon-platform-twitch/src/connector.rs"
click node_twitch_oauth "https://github.com/andro2k/syon/blob/master/crates/syon-platform-twitch/src/oauth_client.rs"
click node_settings "https://github.com/andro2k/syon/blob/master/crates/syon-app/src/settings.rs"
click node_settings_store "https://github.com/andro2k/syon/blob/master/crates/syon-storage-toml/src/store.rs"
click node_toml_format "https://github.com/andro2k/syon/blob/master/crates/syon-storage-toml/src/format.rs"
click node_tts "https://github.com/andro2k/syon/blob/master/crates/syon-tts-kokoro/src/engine.rs"
click node_audio "https://github.com/andro2k/syon/blob/master/crates/syon-tts-rodio/src/player.rs"

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_cli,node_binary,node_app_commands,node_chat_input,node_event_output toneBlue
class node_engine,node_command_rules,node_chat_runtime,node_event_bus,node_domain_events toneAmber
class node_kick_adapter,node_kick_oauth,node_twitch_adapter,node_twitch_oauth toneMint
class node_settings,node_settings_store,node_toml_format,node_tts,node_audio toneRose
class node_streamer,node_platform_services toneIndigo
```

## Components

### Application entry

- [CLI parsing](https://github.com/andro2k/syon/blob/master/crates/syon/src/cli.rs): `crates/syon/src/cli.rs`
- [Application entry](https://github.com/andro2k/syon/blob/master/crates/syon/src/main.rs): `crates/syon/src/main.rs`
- [App commands](https://github.com/andro2k/syon/blob/master/crates/syon/src/commands.rs): `crates/syon/src/commands.rs`
- [Chat input](https://github.com/andro2k/syon/blob/master/crates/syon/src/chat_input.rs): `crates/syon/src/chat_input.rs`
- [Event output](https://github.com/andro2k/syon/blob/master/crates/syon/src/events.rs): `crates/syon/src/events.rs`

### Domain and engine

- [Runtime engine](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/engine.rs): `crates/syon-engine/src/engine.rs`
- [Command handling](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/commands.rs): `crates/syon-engine/src/commands.rs`
- [Chat runtime](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/chat.rs): `crates/syon-engine/src/chat.rs`
- [Event bus](https://github.com/andro2k/syon/blob/master/crates/syon-engine/src/event_bus.rs): `crates/syon-engine/src/event_bus.rs`
- [Domain events](https://github.com/andro2k/syon/blob/master/crates/syon-domain/src/event.rs): `crates/syon-domain/src/event.rs`

### Platform adapters

- [Kick adapter](https://github.com/andro2k/syon/blob/master/crates/syon-platform-kick/src/connector.rs): `crates/syon-platform-kick/src/connector.rs`
- [Kick OAuth](https://github.com/andro2k/syon/blob/master/crates/syon-platform-kick/src/oauth_client.rs): `crates/syon-platform-kick/src/oauth_client.rs`
- [Twitch adapter](https://github.com/andro2k/syon/blob/master/crates/syon-platform-twitch/src/connector.rs): `crates/syon-platform-twitch/src/connector.rs`
- [Twitch OAuth](https://github.com/andro2k/syon/blob/master/crates/syon-platform-twitch/src/oauth_client.rs): `crates/syon-platform-twitch/src/oauth_client.rs`

### Settings and voice

- [App settings](https://github.com/andro2k/syon/blob/master/crates/syon-app/src/settings.rs): `crates/syon-app/src/settings.rs`
- [Settings storage](https://github.com/andro2k/syon/blob/master/crates/syon-storage-toml/src/store.rs): `crates/syon-storage-toml/src/store.rs`
- [TOML format](https://github.com/andro2k/syon/blob/master/crates/syon-storage-toml/src/format.rs): `crates/syon-storage-toml/src/format.rs`
- [Kokoro synthesis](https://github.com/andro2k/syon/blob/master/crates/syon-tts-kokoro/src/engine.rs): `crates/syon-tts-kokoro/src/engine.rs`
- [Audio playback](https://github.com/andro2k/syon/blob/master/crates/syon-tts-rodio/src/player.rs): `crates/syon-tts-rodio/src/player.rs`

### Other components

- **Streamer**
- **Streaming platforms**

## Connections

- Streamer → Application entry: runs (evidence: `README.md`)
- Application entry → CLI parsing: parses args (evidence: `crates/syon/src/main.rs`)
- Application entry → App commands: dispatches (evidence: `crates/syon/src/main.rs`)
- App commands → Runtime engine: starts runtime
- App commands → Chat input: uses input (evidence: `crates/syon/src/commands.rs`)
- App commands → Event output: formats events (evidence: `crates/syon/src/commands.rs`)
- Streaming platforms → Kick adapter: provides events
- Streaming platforms → Twitch adapter: provides events
- Kick adapter → Domain events: normalizes
- Twitch adapter → Domain events: normalizes
- Kick OAuth → Streaming platforms: authorizes
- Twitch OAuth → Streaming platforms: authorizes
- Runtime engine → Command handling: dispatches
- Runtime engine → Event bus: publishes events
- Event bus → Chat runtime: delivers events
- Command handling → Kokoro synthesis: requests speech
- Kokoro synthesis → Audio playback: produces clips
- App settings → Settings storage: persists settings
- Settings storage → TOML format: formats data (evidence: `crates/syon-storage-toml/src/store.rs`)
