# thenareshofficial/linuxwebui architecture

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

- Interactive diagram: https://gitdiagram.com/thenareshofficial/linuxwebui
- Repository: https://github.com/thenareshofficial/linuxwebui

## Overview

LinuxWebUI is a PHP homelab panel: users register or sign in, then view server metrics and control whitelisted services from a live dashboard. The principal flow is authentication → dashboard requests for stats or service actions → Linux host data and service-control operations. The dashboard excerpt confirms charts and service UI, while README documents three-second refresh and responsive presentation. Registration storage details are partly excerpted; no user-store path appears in the tree, so it is not modeled as a repository file.

Main entry points: [`dashboard.php`](https://github.com/thenareshofficial/linuxwebui/blob/main/dashboard.php) (Dashboard UI), [`api/service.php`](https://github.com/thenareshofficial/linuxwebui/blob/main/api/service.php) (Service API), [`login.php`](https://github.com/thenareshofficial/linuxwebui/blob/main/login.php) (Sign in), [`api/stats.php`](https://github.com/thenareshofficial/linuxwebui/blob/main/api/stats.php) (Stats API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Account access"]
  node_index["Entry redirect<br/>[index.php]"]
  node_register["Registration<br/>[register.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_session["Session guard<br/>[auth.php]"]
  node_logout["Sign out<br/>[logout.php]"]
end

subgraph group_panel["Dashboard"]
  node_dashboard["Dashboard UI<br/>[dashboard.php]"]
  node_service_ui["Service cards and charts<br/>[dashboard.php]"]
end

subgraph group_monitor["System monitoring"]
  node_stats_api["Stats API<br/>[stats.php]"]
  node_system_metrics["Metrics collection<br/>[functions.php]"]
end

subgraph group_control["Service control"]
  node_service_api["Service API<br/>[service.php]"]
end

node_visitor(("Browser user"))
node_linux_host["Linux host"]
node_service_control["Service control binary"]
node_systemd["Host services"]

node_visitor -->|"opens"| node_index
node_index -->|"redirects"| node_login
node_visitor -->|"submits credentials"| node_login
node_visitor -->|"creates account"| node_register
node_login -->|"redirects after login"| node_dashboard
node_dashboard -->|"requires"| node_session
node_stats_api -->|"requires"| node_session
node_service_api -->|"requires"| node_session
node_visitor -->|"signs out"| node_logout
node_logout -->|"redirects"| node_login
node_stats_api -->|"calls"| node_system_metrics
node_system_metrics -->|"reads metrics"| node_linux_host
node_dashboard -.->|"requests stats"| node_stats_api
node_dashboard -->|"renders"| node_service_ui
node_service_ui -.->|"requests actions"| node_service_api
node_service_api -->|"checks ports"| node_linux_host
node_service_api -->|"executes command"| node_service_control
node_service_control -.->|"controls services"| node_systemd

click node_index "https://github.com/thenareshofficial/linuxwebui/blob/main/index.php"
click node_register "https://github.com/thenareshofficial/linuxwebui/blob/main/register.php"
click node_login "https://github.com/thenareshofficial/linuxwebui/blob/main/login.php"
click node_session "https://github.com/thenareshofficial/linuxwebui/blob/main/includes/auth.php"
click node_logout "https://github.com/thenareshofficial/linuxwebui/blob/main/logout.php"
click node_dashboard "https://github.com/thenareshofficial/linuxwebui/blob/main/dashboard.php"
click node_stats_api "https://github.com/thenareshofficial/linuxwebui/blob/main/api/stats.php"
click node_system_metrics "https://github.com/thenareshofficial/linuxwebui/blob/main/includes/functions.php"
click node_service_ui "https://github.com/thenareshofficial/linuxwebui/blob/main/dashboard.php"
click node_service_api "https://github.com/thenareshofficial/linuxwebui/blob/main/api/service.php"

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_index,node_register,node_login,node_session,node_logout,node_visitor toneBlue
class node_dashboard,node_service_ui toneAmber
class node_stats_api,node_system_metrics toneMint
class node_service_api toneRose
class node_linux_host,node_service_control,node_systemd toneIndigo
```

## Components

### Account access

- [Entry redirect](https://github.com/thenareshofficial/linuxwebui/blob/main/index.php): `index.php`
- [Registration](https://github.com/thenareshofficial/linuxwebui/blob/main/register.php): `register.php`
- [Sign in](https://github.com/thenareshofficial/linuxwebui/blob/main/login.php): `login.php`
- [Session guard](https://github.com/thenareshofficial/linuxwebui/blob/main/includes/auth.php): `includes/auth.php`
- [Sign out](https://github.com/thenareshofficial/linuxwebui/blob/main/logout.php): `logout.php`

### Dashboard

- [Dashboard UI](https://github.com/thenareshofficial/linuxwebui/blob/main/dashboard.php): `dashboard.php`
- [Service cards and charts](https://github.com/thenareshofficial/linuxwebui/blob/main/dashboard.php): `dashboard.php`

### System monitoring

- [Stats API](https://github.com/thenareshofficial/linuxwebui/blob/main/api/stats.php): `api/stats.php`
- [Metrics collection](https://github.com/thenareshofficial/linuxwebui/blob/main/includes/functions.php): `includes/functions.php`

### Service control

- [Service API](https://github.com/thenareshofficial/linuxwebui/blob/main/api/service.php): `api/service.php`

### Other components

- **Browser user**
- **Linux host**
- **Service control binary**
- **Host services**

## Connections

- Browser user → Entry redirect: opens (evidence: `index.php`)
- Entry redirect → Sign in: redirects (evidence: `index.php`)
- Browser user → Sign in: submits credentials (evidence: `login.php`)
- Browser user → Registration: creates account (evidence: `register.php`)
- Sign in → Dashboard UI: redirects after login (evidence: `login.php`)
- Dashboard UI → Session guard: requires (evidence: `dashboard.php`)
- Stats API → Session guard: requires (evidence: `api/stats.php`)
- Service API → Session guard: requires (evidence: `api/service.php`)
- Browser user → Sign out: signs out (evidence: `logout.php`)
- Sign out → Sign in: redirects (evidence: `logout.php`)
- Stats API → Metrics collection: calls (evidence: `api/stats.php`)
- Metrics collection → Linux host: reads metrics (evidence: `includes/functions.php`)
- Dashboard UI → Stats API: requests stats
- Dashboard UI → Service cards and charts: renders (evidence: `dashboard.php`)
- Service cards and charts → Service API: requests actions
- Service API → Linux host: checks ports (evidence: `api/service.php`)
- Service API → Service control binary: executes command (evidence: `api/service.php`)
- Service control binary → Host services: controls services
