# embedded-systems-26-27/opdracht2-yv architecture

> Architecture diagram of the GitHub repository embedded-systems-26-27/opdracht2-yv, 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/embedded-systems-26-27/opdracht2-yv
- Repository: https://github.com/embedded-systems-26-27/opdracht2-yv

## Overview

Melissa is a voice- or console-driven assistant: it accepts a user prompt, passes conversation state to an Ollama model, optionally invokes GPIO or temperature tools, then returns the response through matching output. A separate Streamlit dashboard reads the TC74 sensor and GPIO level, displays recent readings, and shares SQLite history with the assistant. The sampled source shows these runtime paths; model assets and deployment details are not mapped.

Main entry points: [`src/dashboard.py`](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/dashboard.py) (Live dashboard), [`src/main.py`](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/main.py) (Assistant runtime), [`src/logic.py`](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/logic.py) (Tool orchestration), [`src/stt.py`](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/stt.py) (Input modes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_io["User interaction"]
  node_input["Input modes<br/>[stt.py]"]
  node_output["Response modes<br/>[tts.py]"]
end

subgraph group_assistant["Assistant conversation"]
  node_runtime["Assistant runtime<br/>[main.py]"]
  node_reasoning["Tool orchestration<br/>[logic.py]"]
end

subgraph group_devices["Device tools"]
  node_gpio["GPIO controls<br/>[gpioManager.py]"]
  node_temperature["Temperature reader<br/>[tempMonitor.py]"]
end

subgraph group_dashboard["Monitoring dashboard"]
  node_dashboard_ui["Live dashboard<br/>[dashboard.py]"]
  node_history[("SQLite history<br/>[main.py]")]
end

node_user(("User"))
node_ollama{{"Ollama model"}}
node_gpio_device{{"GPIO pin 18"}}
node_tc74{{"TC74 sensor"}}

node_user -->|"provides input"| node_input
node_input -->|"returns prompt"| node_runtime
node_runtime -->|"requests response"| node_reasoning
node_reasoning -->|"sends messages"| node_ollama
node_reasoning -->|"dispatches tools"| node_gpio
node_reasoning -->|"dispatches tools"| node_temperature
node_gpio -->|"reads and sets"| node_gpio_device
node_temperature -->|"reads sensor"| node_tc74
node_runtime -->|"sends response"| node_output
node_output -->|"presents response"| node_user
node_runtime -->|"writes prompts"| node_history
node_dashboard_ui -->|"reads sensor"| node_tc74
node_dashboard_ui -->|"reads level"| node_gpio_device
node_dashboard_ui -->|"stores readings"| node_history
node_dashboard_ui -->|"reads latest prompt"| node_history

click node_input "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/stt.py"
click node_output "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/tts.py"
click node_runtime "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/main.py"
click node_reasoning "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/logic.py"
click node_gpio "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/plugins/gpioManager.py"
click node_temperature "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/plugins/tempMonitor.py"
click node_dashboard_ui "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/dashboard.py"
click node_history "https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/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_input,node_output,node_user toneBlue
class node_runtime,node_reasoning toneAmber
class node_gpio,node_temperature toneMint
class node_dashboard_ui,node_history toneRose
class node_ollama,node_gpio_device,node_tc74 toneIndigo
```

## Components

### User interaction

- [Input modes](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/stt.py): `src/stt.py`
- [Response modes](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/tts.py): `src/tts.py`

### Assistant conversation

- [Assistant runtime](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/main.py): `src/main.py`
- [Tool orchestration](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/logic.py): `src/logic.py`

### Device tools

- [GPIO controls](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/plugins/gpioManager.py): `src/plugins/gpioManager.py`
- [Temperature reader](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/plugins/tempMonitor.py): `src/plugins/tempMonitor.py`

### Monitoring dashboard

- [Live dashboard](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/dashboard.py): `src/dashboard.py`
- [SQLite history](https://github.com/embedded-systems-26-27/opdracht2-yv/blob/main/src/main.py): `src/main.py`

### Other components

- **User**
- **Ollama model**
- **GPIO pin 18**
- **TC74 sensor**

## Connections

- User → Input modes: provides input
- Input modes → Assistant runtime: returns prompt (evidence: `src/main.py`)
- Assistant runtime → Tool orchestration: requests response (evidence: `src/main.py`)
- Tool orchestration → Ollama model: sends messages (evidence: `src/logic.py`)
- Tool orchestration → GPIO controls: dispatches tools (evidence: `src/logic.py`)
- Tool orchestration → Temperature reader: dispatches tools (evidence: `src/logic.py`)
- GPIO controls → GPIO pin 18: reads and sets (evidence: `src/plugins/gpioManager.py`)
- Temperature reader → TC74 sensor: reads sensor (evidence: `src/plugins/tempMonitor.py`)
- Assistant runtime → Response modes: sends response (evidence: `src/main.py`)
- Response modes → User: presents response
- Assistant runtime → SQLite history: writes prompts (evidence: `src/main.py`)
- Live dashboard → TC74 sensor: reads sensor (evidence: `src/dashboard.py`)
- Live dashboard → GPIO pin 18: reads level (evidence: `src/dashboard.py`)
- Live dashboard → SQLite history: stores readings (evidence: `src/dashboard.py`)
- Live dashboard → SQLite history: reads latest prompt (evidence: `src/dashboard.py`)
