# urakhilraj/uirpi architecture

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

- Interactive diagram: https://gitdiagram.com/urakhilraj/uirpi
- Repository: https://github.com/urakhilraj/uirpi

## Overview

Raspberry Pi Dashboard is a browser-based Pi monitoring and management application. The main user journey is to open the dashboard, authenticate, and view live hardware status or manage system settings and power; README-described capabilities also include detailed system information, scheduled shutdown/reboot, responsive display, and theme switching. Separate repository features include poster management and slideshow, Wi-Fi controls, and a voice client. The graph reflects shown calls and documented capabilities; unsampled wiring is omitted rather than inferred.

Main entry points: [`backend/Config.php`](https://github.com/urakhilraj/uirpi/blob/main/backend/Config.php) (Config handler), [`index.php`](https://github.com/urakhilraj/uirpi/blob/main/index.php) (Dashboard UI), [`poster_manager.php`](https://github.com/urakhilraj/uirpi/blob/main/poster_manager.php) (Poster manager), [`backend/serv.php`](https://github.com/urakhilraj/uirpi/blob/main/backend/serv.php) (Auth and power)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_page["Dashboard UI<br/>[index.php]"]
  node_live_client["Live dashboard client<br/>[main.js]"]
  node_theme["Theme switching<br/>[color-modes.js]"]
  node_setup["Initial setup<br/>[setup.php]"]
end

subgraph group_system["System management"]
  node_config["Config handler<br/>[Config.php]"]
  node_settings_file[("Local settings")]
  node_system_info["Hardware status<br/>[sys_infos.php]"]
  node_system_actions["Auth and power<br/>[serv.php]"]
  node_service_control["Service control"]
end

subgraph group_media["Poster media"]
  node_poster_manager["Poster manager<br/>[poster_manager.php]"]
  node_poster_edit["Poster editor<br/>[edit_poster.php]"]
  node_poster_slider["Poster slideshow<br/>[poster_slider.php]"]
end

subgraph group_extras["Additional tools"]
  node_wifi["Wi-Fi controls<br/>[wifi_manager.php]"]
  node_voice["Voice client<br/>[voice.py]"]
end

node_user(("Pi user"))
node_browser(("Web browser"))
node_openai["OpenAI service"]

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_dashboard_page
node_dashboard_page -->|"loads settings"| node_config
node_dashboard_page -->|"routes first setup"| node_setup
node_dashboard_page -.->|"presents dashboard"| node_live_client
node_browser -->|"selects theme"| node_theme
node_live_client -->|"requests power actions"| node_system_actions
node_setup -->|"loads and saves settings"| node_config
node_system_actions -->|"loads and saves settings"| node_config
node_system_info -->|"loads settings"| node_config
node_config -->|"reads and writes"| node_settings_file
node_poster_manager -->|"submits edits"| node_poster_edit
node_poster_manager -->|"requests service action"| node_service_control
node_user -.->|"views Pi status"| node_system_info
node_user -.->|"manages power"| node_system_actions
node_user -.->|"manages posters"| node_poster_manager
node_user -.->|"views slideshow"| node_poster_slider
node_user -.->|"manages Wi-Fi"| node_wifi
node_voice -.->|"streams audio"| node_openai

click node_dashboard_page "https://github.com/urakhilraj/uirpi/blob/main/index.php"
click node_live_client "https://github.com/urakhilraj/uirpi/blob/main/js/main.js"
click node_theme "https://github.com/urakhilraj/uirpi/blob/main/js/color-modes.js"
click node_setup "https://github.com/urakhilraj/uirpi/blob/main/setup.php"
click node_config "https://github.com/urakhilraj/uirpi/blob/main/backend/Config.php"
click node_system_info "https://github.com/urakhilraj/uirpi/blob/main/backend/sys_infos.php"
click node_system_actions "https://github.com/urakhilraj/uirpi/blob/main/backend/serv.php"
click node_service_control "https://github.com/urakhilraj/uirpi/blob/main/service_control.php"
click node_poster_manager "https://github.com/urakhilraj/uirpi/blob/main/poster_manager.php"
click node_poster_edit "https://github.com/urakhilraj/uirpi/blob/main/edit_poster.php"
click node_poster_slider "https://github.com/urakhilraj/uirpi/blob/main/poster_slider.php"
click node_wifi "https://github.com/urakhilraj/uirpi/blob/main/wifi_manager.php"
click node_voice "https://github.com/urakhilraj/uirpi/blob/main/voice.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_dashboard_page,node_live_client,node_theme,node_setup,node_user,node_browser toneBlue
class node_config,node_settings_file,node_system_info,node_system_actions,node_service_control toneAmber
class node_poster_manager,node_poster_edit,node_poster_slider toneMint
class node_wifi,node_voice toneRose
class node_openai toneIndigo
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/urakhilraj/uirpi/blob/main/index.php): `index.php`
- [Live dashboard client](https://github.com/urakhilraj/uirpi/blob/main/js/main.js): `js/main.js`
- [Theme switching](https://github.com/urakhilraj/uirpi/blob/main/js/color-modes.js): `js/color-modes.js`
- [Initial setup](https://github.com/urakhilraj/uirpi/blob/main/setup.php): `setup.php`

### System management

- [Config handler](https://github.com/urakhilraj/uirpi/blob/main/backend/Config.php): `backend/Config.php`
- **Local settings**
- [Hardware status](https://github.com/urakhilraj/uirpi/blob/main/backend/sys_infos.php): `backend/sys_infos.php`
- [Auth and power](https://github.com/urakhilraj/uirpi/blob/main/backend/serv.php): `backend/serv.php`
- [Service control](https://github.com/urakhilraj/uirpi/blob/main/service_control.php): `service_control.php`

### Poster media

- [Poster manager](https://github.com/urakhilraj/uirpi/blob/main/poster_manager.php): `poster_manager.php`
- [Poster editor](https://github.com/urakhilraj/uirpi/blob/main/edit_poster.php): `edit_poster.php`
- [Poster slideshow](https://github.com/urakhilraj/uirpi/blob/main/poster_slider.php): `poster_slider.php`

### Additional tools

- [Wi-Fi controls](https://github.com/urakhilraj/uirpi/blob/main/wifi_manager.php): `wifi_manager.php`
- [Voice client](https://github.com/urakhilraj/uirpi/blob/main/voice.py): `voice.py`

### Other components

- **Pi user**
- **Web browser**
- **OpenAI service**

## Connections

- Pi user → Web browser: uses (evidence: `README.md`)
- Web browser → Dashboard UI: opens (evidence: `README.md`)
- Dashboard UI → Config handler: loads settings (evidence: `index.php`)
- Dashboard UI → Initial setup: routes first setup (evidence: `index.php`)
- Dashboard UI → Live dashboard client: presents dashboard
- Web browser → Theme switching: selects theme (evidence: `js/color-modes.js`)
- Live dashboard client → Auth and power: requests power actions (evidence: `js/main.js`)
- Initial setup → Config handler: loads and saves settings (evidence: `setup.php`)
- Auth and power → Config handler: loads and saves settings (evidence: `backend/serv.php`)
- Hardware status → Config handler: loads settings (evidence: `backend/sys_infos.php`)
- Config handler → Local settings: reads and writes (evidence: `backend/Config.php`)
- Poster manager → Poster editor: submits edits (evidence: `poster_manager.php`)
- Poster manager → Service control: requests service action (evidence: `poster_manager.php`)
- Pi user → Hardware status: views Pi status (evidence: `README.md`)
- Pi user → Auth and power: manages power (evidence: `README.md`)
- Pi user → Poster manager: manages posters
- Pi user → Poster slideshow: views slideshow
- Pi user → Wi-Fi controls: manages Wi-Fi
- Voice client → OpenAI service: streams audio
