# tds2k5/fried-egg architecture

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

- Interactive diagram: https://gitdiagram.com/tds2k5/fried-egg
- Repository: https://github.com/tds2k5/fried-egg

## Overview

FriedEgg is a voice-and-text assistant. Its main workflow accepts a wake word, captures a command, routes it to a browser, music, news, or Gemini action, and speaks responses. The README documents these capabilities; the sampled `main.py` shows their implementation, while `dev.py` provides a parallel text-oriented development entry point. The graph omits uncertain links beyond those shown in the excerpts or documented in the README.

Main entry points: [`main.py`](https://github.com/tds2k5/fried-egg/blob/master/main.py) (Command router), [`dev.py`](https://github.com/tds2k5/fried-egg/blob/master/dev.py) (Dev runtime), [`musicLibrary.py`](https://github.com/tds2k5/fried-egg/blob/master/musicLibrary.py) (Song catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_main["Assistant runtime<br/>[main.py]"]
  node_dev["Dev runtime<br/>[dev.py]"]
  node_wake["Wake-word check<br/>[main.py]"]
  node_capture["Command capture<br/>[main.py]"]
  node_speech["Speech output<br/>[main.py]"]
end

subgraph group_commands["Command capabilities"]
  node_router["Command router<br/>[main.py]"]
  node_websites["Website opening<br/>[main.py]"]
  node_music["Music playback<br/>[main.py]"]
  node_catalog["Song catalog<br/>[musicLibrary.py]"]
  node_news["News fetching<br/>[main.py]"]
  node_ai["AI responses<br/>[main.py]"]
end

subgraph group_integrations["External integrations"]
  node_browser["Web browser"]
  node_recognition["Speech recognition"]
  node_newsapi["NewsAPI"]
  node_gemini["Gemini"]
  node_tts["Text-to-speech engine"]
end

node_user(("User"))
node_microphone(("Microphone"))

node_user -->|"starts"| node_main
node_main -->|"checks wake word"| node_wake
node_microphone -->|"provides audio"| node_capture
node_capture -->|"transcribes audio"| node_recognition
node_wake -->|"activates command"| node_capture
node_user -->|"enters text"| node_dev
node_dev -->|"checks input"| node_wake
node_capture -->|"dispatches command"| node_router
node_router -->|"opens sites"| node_websites
node_websites -->|"opens URL"| node_browser
node_router -->|"selects song"| node_music
node_music -->|"looks up link"| node_catalog
node_music -->|"opens link"| node_browser
node_router -->|"fetches headlines"| node_news
node_news -->|"requests headlines"| node_newsapi
node_router -->|"forwards other queries"| node_ai
node_ai -->|"requests response"| node_gemini
node_ai -->|"speaks response"| node_speech
node_news -->|"speaks headlines"| node_speech
node_speech -->|"synthesizes speech"| node_tts

click node_main "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_dev "https://github.com/tds2k5/fried-egg/blob/master/dev.py"
click node_wake "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_capture "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_speech "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_router "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_websites "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_music "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_catalog "https://github.com/tds2k5/fried-egg/blob/master/musicLibrary.py"
click node_news "https://github.com/tds2k5/fried-egg/blob/master/main.py"
click node_ai "https://github.com/tds2k5/fried-egg/blob/master/main.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_main,node_dev,node_wake,node_capture,node_speech,node_user toneBlue
class node_router,node_websites,node_music,node_catalog,node_news,node_ai toneAmber
class node_browser,node_recognition,node_newsapi,node_gemini,node_tts toneMint
class node_microphone toneIndigo
```

## Components

### User interaction

- [Assistant runtime](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Dev runtime](https://github.com/tds2k5/fried-egg/blob/master/dev.py): `dev.py`
- [Wake-word check](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Command capture](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Speech output](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`

### Command capabilities

- [Command router](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Website opening](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Music playback](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [Song catalog](https://github.com/tds2k5/fried-egg/blob/master/musicLibrary.py): `musicLibrary.py`
- [News fetching](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`
- [AI responses](https://github.com/tds2k5/fried-egg/blob/master/main.py): `main.py`

### External integrations

- **Web browser**
- **Speech recognition**
- **NewsAPI**
- **Gemini**
- **Text-to-speech engine**

### Other components

- **User**
- **Microphone**

## Connections

- User → Assistant runtime: starts (evidence: `README.md`)
- Assistant runtime → Wake-word check: checks wake word (evidence: `main.py`)
- Microphone → Command capture: provides audio (evidence: `main.py`)
- Command capture → Speech recognition: transcribes audio (evidence: `main.py`)
- Wake-word check → Command capture: activates command (evidence: `main.py`)
- User → Dev runtime: enters text (evidence: `dev.py`)
- Dev runtime → Wake-word check: checks input (evidence: `dev.py`)
- Command capture → Command router: dispatches command (evidence: `main.py`)
- Command router → Website opening: opens sites (evidence: `main.py`)
- Website opening → Web browser: opens URL (evidence: `main.py`)
- Command router → Music playback: selects song (evidence: `main.py`)
- Music playback → Song catalog: looks up link (evidence: `main.py`)
- Music playback → Web browser: opens link (evidence: `main.py`)
- Command router → News fetching: fetches headlines (evidence: `main.py`)
- News fetching → NewsAPI: requests headlines (evidence: `main.py`)
- Command router → AI responses: forwards other queries (evidence: `main.py`)
- AI responses → Gemini: requests response (evidence: `main.py`)
- AI responses → Speech output: speaks response (evidence: `main.py`)
- News fetching → Speech output: speaks headlines (evidence: `main.py`)
- Speech output → Text-to-speech engine: synthesizes speech (evidence: `main.py`)
