# tomhacker69/jarwish architecture

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

- Interactive diagram: https://gitdiagram.com/tomhacker69/jarwish
- Repository: https://github.com/tomhacker69/jarwish

## Overview

Jarvis.py implements a single-turn voice assistant: the user speaks a wake word and command, speech is transcribed, and the command is routed to web actions, news lookup, or an OpenAI response. Responses are spoken using gTTS and pygame. The README describes broader security and platform ambitions, but they are not implemented in the sampled source; this map reflects the observed code. All implementation nodes share the sole source file, Jarvis.py.

Main entry points: [`Jarvis.py`](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py) (Command routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice interaction"]
  node_recognition["Speech recognition<br/>[Jarvis.py]"]
  node_speech["Spoken response<br/>[Jarvis.py]"]
end

subgraph group_commands["Command handling"]
  node_router["Command routing<br/>[Jarvis.py]"]
  node_web["Web actions<br/>[Jarvis.py]"]
  node_news["News lookup<br/>[Jarvis.py]"]
  node_ai["AI response<br/>[Jarvis.py]"]
end

subgraph group_integrations["External services"]
  node_google["Google speech API"]
end

node_user(("Voice user"))
node_browser["Web browser"]
node_newsapi["NewsData API"]
node_openai["OpenAI API"]
node_tts["gTTS service"]

node_user -->|"speaks audio"| node_recognition
node_recognition -->|"transcribes audio"| node_google
node_recognition -->|"returns transcript"| node_router
node_router -->|"routes web commands"| node_web
node_router -->|"routes news commands"| node_news
node_router -->|"routes other commands"| node_ai
node_router -->|"speaks prompts"| node_speech
node_web -->|"opens pages"| node_browser
node_news -->|"fetches articles"| node_newsapi
node_news -->|"speaks status"| node_speech
node_ai -->|"requests completion"| node_openai
node_ai -->|"speaks answer"| node_speech
node_speech -->|"generates audio"| node_tts

click node_recognition "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py"
click node_router "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py"
click node_speech "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py"
click node_web "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py"
click node_news "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py"
click node_ai "https://github.com/tomhacker69/jarwish/blob/main/Jarvis.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_recognition,node_speech,node_user,node_browser toneBlue
class node_router,node_web,node_news,node_ai toneAmber
class node_google,node_newsapi,node_openai toneMint
class node_tts toneIndigo
```

## Components

### Voice interaction

- [Speech recognition](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`
- [Spoken response](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`

### Command handling

- [Command routing](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`
- [Web actions](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`
- [News lookup](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`
- [AI response](https://github.com/tomhacker69/jarwish/blob/main/Jarvis.py): `Jarvis.py`

### External services

- **Google speech API**

### Other components

- **Voice user**
- **Web browser**
- **NewsData API**
- **OpenAI API**
- **gTTS service**

## Connections

- Voice user → Speech recognition: speaks audio (evidence: `Jarvis.py`)
- Speech recognition → Google speech API: transcribes audio (evidence: `Jarvis.py`)
- Speech recognition → Command routing: returns transcript (evidence: `Jarvis.py`)
- Command routing → Web actions: routes web commands (evidence: `Jarvis.py`)
- Command routing → News lookup: routes news commands (evidence: `Jarvis.py`)
- Command routing → AI response: routes other commands (evidence: `Jarvis.py`)
- Command routing → Spoken response: speaks prompts (evidence: `Jarvis.py`)
- Web actions → Web browser: opens pages (evidence: `Jarvis.py`)
- News lookup → NewsData API: fetches articles (evidence: `Jarvis.py`)
- News lookup → Spoken response: speaks status (evidence: `Jarvis.py`)
- AI response → OpenAI API: requests completion (evidence: `Jarvis.py`)
- AI response → Spoken response: speaks answer (evidence: `Jarvis.py`)
- Spoken response → gTTS service: generates audio (evidence: `Jarvis.py`)
