# aivietnam-aio-ilovearti/timetable_widget_in_desktop architecture

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

- Interactive diagram: https://gitdiagram.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop
- Repository: https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop

## Overview

This is a desktop timetable chatbot: a user asks for a schedule, a frontend sends the prompt to a local WebSocket backend, and the backend prepares date context, reads timetable data, queries Groq, and returns an answer. It offers separate standard-window and Wayland interfaces. The backend and standard-window launcher are excerpted; frontend wiring and the Wayland interface are represented only where the README documents them.

Main entry points: [`Backend/Logic.py`](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/Logic.py) (WebSocket server), [`Frontend/UI_Window.qml`](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_Window.qml) (Window UI), [`Frontend/UI_wayland.qml`](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_wayland.qml) (Wayland UI), [`Frontend/connect_Window.py`](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/connect_Window.py) (Window launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["Desktop frontends"]
  node_window_launcher["Window launcher<br/>[connect_Window.py]"]
  node_window_ui["Window UI<br/>[UI_Window.qml]"]
  node_wayland_ui["Wayland UI<br/>[UI_wayland.qml]"]
end

subgraph group_backend["Chat backend"]
  node_backend_server["WebSocket server<br/>[Logic.py]"]
  node_prompt_logic["Prompt and date logic<br/>[Logic.py]"]
end

subgraph group_data["Timetable and AI"]
  node_timetable["Timetable data<br/>[source.txt]"]
  node_groq["Groq API"]
end

node_user(("User"))

node_user -->|"asks schedule"| node_window_ui
node_user -->|"asks schedule"| node_wayland_ui
node_window_launcher -->|"loads"| node_window_ui
node_window_ui -->|"sends prompt"| node_backend_server
node_wayland_ui -->|"sends prompt"| node_backend_server
node_backend_server -->|"dispatches prompt"| node_prompt_logic
node_prompt_logic -.->|"reads data"| node_timetable
node_prompt_logic -->|"queries schedule"| node_groq
node_backend_server -->|"returns response"| node_window_ui
node_backend_server -->|"returns response"| node_wayland_ui

click node_window_launcher "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/connect_Window.py"
click node_window_ui "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_Window.qml"
click node_wayland_ui "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_wayland.qml"
click node_backend_server "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/Logic.py"
click node_prompt_logic "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/Logic.py"
click node_timetable "https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/source.txt"

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_window_launcher,node_window_ui,node_wayland_ui,node_user toneBlue
class node_backend_server,node_prompt_logic toneAmber
class node_timetable,node_groq toneMint
```

## Components

### Desktop frontends

- [Window launcher](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/connect_Window.py): `Frontend/connect_Window.py`
- [Window UI](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_Window.qml): `Frontend/UI_Window.qml`
- [Wayland UI](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Frontend/UI_wayland.qml): `Frontend/UI_wayland.qml`

### Chat backend

- [WebSocket server](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/Logic.py): `Backend/Logic.py`
- [Prompt and date logic](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/Logic.py): `Backend/Logic.py`

### Timetable and AI

- [Timetable data](https://github.com/aivietnam-aio-ilovearti/timetable_widget_in_desktop/blob/main/Backend/source.txt): `Backend/source.txt`
- **Groq API**

### Other components

- **User**

## Connections

- User → Window UI: asks schedule (evidence: `README.md`)
- User → Wayland UI: asks schedule (evidence: `README.md`)
- Window launcher → Window UI: loads (evidence: `Frontend/connect_Window.py`)
- Window UI → WebSocket server: sends prompt (evidence: `README.md`)
- Wayland UI → WebSocket server: sends prompt (evidence: `README.md`)
- WebSocket server → Prompt and date logic: dispatches prompt (evidence: `Backend/Logic.py`)
- Prompt and date logic → Timetable data: reads data
- Prompt and date logic → Groq API: queries schedule (evidence: `Backend/Logic.py`)
- WebSocket server → Window UI: returns response (evidence: `README.md`)
- WebSocket server → Wayland UI: returns response (evidence: `README.md`)
