# praneetha789/lunara architecture

> Architecture diagram of the GitHub repository praneetha789/lunara, 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/praneetha789/lunara
- Repository: https://github.com/praneetha789/lunara

## Overview

Lunara is a voice-controlled desktop assistant with a browser-based animated interface. A user clicks the microphone; the UI requests audio playback and starts the Python listening workflow. The backend transcribes speech, routes recognized commands to time, desktop-app, web-search, or system actions, then speaks and displays the response. Separate helpers provide text-to-speech and sound playback. The source shows the main UI/backend calls, but not the internal Eel transport or all browser callback wiring; those boundaries are represented conservatively.

Main entry points: [`main.py`](https://github.com/praneetha789/lunara/blob/master/main.py) (Assistant entry), [`www/main.js`](https://github.com/praneetha789/lunara/blob/master/www/main.js) (Lunara UI), [`engine/command.py`](https://github.com/praneetha789/lunara/blob/master/engine/command.py) (Command router), [`engine/features.py`](https://github.com/praneetha789/lunara/blob/master/engine/features.py) (Sound feedback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_browser["Lunara UI<br/>[main.js]"]
  node_ui_callbacks["UI callbacks<br/>[controller.js]"]
end

subgraph group_runtime["Assistant runtime"]
  node_eel["Eel bridge"]
  node_assistant_entry["Assistant entry<br/>[main.py]"]
end

subgraph group_capabilities["Assistant capabilities"]
  node_speech_input["Speech input<br/>[command.py]"]
  node_command_router["Command router<br/>[command.py]"]
  node_voice_output["Voice output<br/>[features.py]"]
  node_sound_feedback["Sound feedback<br/>[features.py]"]
  node_sound_player["Sound player<br/>[playsound.py]"]
end

subgraph group_integrations["System integrations"]
  node_speech_service["Speech recognition"]
  node_desktop_actions["Desktop actions<br/>[command.py]"]
  node_web_actions["Web actions<br/>[command.py]"]
end

node_user(("User"))
node_websites["Web services"]
node_tts_engine["TTS engine"]
node_local_audio["Local audio"]

node_user -->|"clicks microphone"| node_browser
node_browser -->|"requests listening"| node_eel
node_browser -->|"requests click sound"| node_eel
node_eel -->|"dispatches start"| node_assistant_entry
node_eel -->|"dispatches click sound"| node_sound_feedback
node_assistant_entry -->|"calls listen"| node_speech_input
node_speech_input -->|"recognizes audio"| node_speech_service
node_assistant_entry -->|"routes query"| node_command_router
node_command_router -->|"runs local actions"| node_desktop_actions
node_command_router -->|"opens or searches"| node_web_actions
node_web_actions -->|"opens pages"| node_websites
node_assistant_entry -->|"speaks response"| node_voice_output
node_assistant_entry -->|"sends response text"| node_eel
node_eel -->|"delivers response"| node_browser
node_voice_output -->|"synthesizes speech"| node_tts_engine
node_assistant_entry -->|"plays startup sound"| node_sound_feedback
node_sound_feedback -->|"plays asynchronously"| node_sound_player
node_sound_player -->|"plays audio file"| node_local_audio
node_ui_callbacks -->|"exposes callbacks"| node_eel

click node_browser "https://github.com/praneetha789/lunara/blob/master/www/main.js"
click node_ui_callbacks "https://github.com/praneetha789/lunara/blob/master/www/controller.js"
click node_assistant_entry "https://github.com/praneetha789/lunara/blob/master/main.py"
click node_speech_input "https://github.com/praneetha789/lunara/blob/master/engine/command.py"
click node_command_router "https://github.com/praneetha789/lunara/blob/master/engine/command.py"
click node_voice_output "https://github.com/praneetha789/lunara/blob/master/engine/features.py"
click node_sound_feedback "https://github.com/praneetha789/lunara/blob/master/engine/features.py"
click node_sound_player "https://github.com/praneetha789/lunara/blob/master/playsound.py/playsound.py"
click node_desktop_actions "https://github.com/praneetha789/lunara/blob/master/engine/command.py"
click node_web_actions "https://github.com/praneetha789/lunara/blob/master/engine/command.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_browser,node_ui_callbacks,node_user toneBlue
class node_eel,node_assistant_entry toneAmber
class node_speech_input,node_command_router,node_voice_output,node_sound_feedback,node_sound_player toneMint
class node_speech_service,node_desktop_actions,node_web_actions toneRose
class node_websites,node_tts_engine,node_local_audio toneIndigo
```

## Components

### Browser interface

- [Lunara UI](https://github.com/praneetha789/lunara/blob/master/www/main.js): `www/main.js`
- [UI callbacks](https://github.com/praneetha789/lunara/blob/master/www/controller.js): `www/controller.js`

### Assistant runtime

- **Eel bridge**
- [Assistant entry](https://github.com/praneetha789/lunara/blob/master/main.py): `main.py`

### Assistant capabilities

- [Speech input](https://github.com/praneetha789/lunara/blob/master/engine/command.py): `engine/command.py`
- [Command router](https://github.com/praneetha789/lunara/blob/master/engine/command.py): `engine/command.py`
- [Voice output](https://github.com/praneetha789/lunara/blob/master/engine/features.py): `engine/features.py`
- [Sound feedback](https://github.com/praneetha789/lunara/blob/master/engine/features.py): `engine/features.py`
- [Sound player](https://github.com/praneetha789/lunara/blob/master/playsound.py/playsound.py): `playsound.py/playsound.py`

### System integrations

- **Speech recognition**
- [Desktop actions](https://github.com/praneetha789/lunara/blob/master/engine/command.py): `engine/command.py`
- [Web actions](https://github.com/praneetha789/lunara/blob/master/engine/command.py): `engine/command.py`

### Other components

- **User**
- **Web services**
- **TTS engine**
- **Local audio**

## Connections

- User → Lunara UI: clicks microphone (evidence: `www/main.js`)
- Lunara UI → Eel bridge: requests listening (evidence: `www/main.js`)
- Lunara UI → Eel bridge: requests click sound (evidence: `www/main.js`)
- Eel bridge → Assistant entry: dispatches start (evidence: `main.py`)
- Eel bridge → Sound feedback: dispatches click sound (evidence: `engine/features.py`)
- Assistant entry → Speech input: calls listen (evidence: `main.py`)
- Speech input → Speech recognition: recognizes audio (evidence: `engine/command.py`)
- Assistant entry → Command router: routes query (evidence: `main.py`)
- Command router → Desktop actions: runs local actions (evidence: `engine/command.py`)
- Command router → Web actions: opens or searches (evidence: `engine/command.py`)
- Web actions → Web services: opens pages (evidence: `engine/command.py`)
- Assistant entry → Voice output: speaks response (evidence: `main.py`)
- Assistant entry → Eel bridge: sends response text (evidence: `main.py`)
- Eel bridge → Lunara UI: delivers response (evidence: `www/main.js`)
- Voice output → TTS engine: synthesizes speech (evidence: `engine/features.py`)
- Assistant entry → Sound feedback: plays startup sound (evidence: `main.py`)
- Sound feedback → Sound player: plays asynchronously (evidence: `engine/features.py`)
- Sound player → Local audio: plays audio file (evidence: `playsound.py/playsound.py`)
- UI callbacks → Eel bridge: exposes callbacks (evidence: `www/controller.js`)
