# guritadarattt/panel architecture

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

- Interactive diagram: https://gitdiagram.com/guritadarattt/panel
- Repository: https://github.com/guritadarattt/panel

## Overview

Gurita Panel is a Node.js VPS management panel. Users authenticate, view owned servers, manage files and ports, monitor resources, and control server processes; administrators additionally manage users, server configuration, settings, themes, media, and audit history. The graph follows the documented HTTP/WebSocket entry points and sampled controller, process, and resource calls. Some route-to-controller wiring and unsampled services are inferred only where the README or route declarations identify the capability; uncertain internal links are omitted.

Main entry points: [`src/routes/index.js`](https://github.com/guritadarattt/panel/blob/main/src/routes/index.js) (API routes), [`server.js`](https://github.com/guritadarattt/panel/blob/main/server.js) (HTTP and WS host), [`src/controllers/serverController.js`](https://github.com/guritadarattt/panel/blob/main/src/controllers/serverController.js) (Server control), [`src/process/processManager.js`](https://github.com/guritadarattt/panel/blob/main/src/process/processManager.js) (Process manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Panel interface"]
  node_ui["Panel UI<br/>[dashboard.js]"]
  node_server_ui["Server UI<br/>[server.js]"]
  node_admin_ui["Admin UI<br/>[admin.js]"]
end

subgraph group_http["HTTP and access"]
  node_entry["HTTP and WS host<br/>[server.js]"]
  node_routes["API routes<br/>[index.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_account["Account management"]
  node_user_admin["User administration<br/>[userController.js]"]
  node_server_admin["Server administration"]
end

subgraph group_operations["Server operations"]
  node_server_ops["Server control"]
  node_files["File manager<br/>[fileController.js]"]
  node_allocations["Port allocation"]
  node_resources["Resource monitor<br/>[resourceManager.js]"]
  node_console["Live console<br/>[consoleServer.js]"]
  node_shell["Interactive shell<br/>[shellServer.js]"]
  node_process["Process manager<br/>[processManager.js]"]
  node_cgroups["Cgroup limits<br/>[cgroupManager.js]"]
  node_file_service["File operations<br/>[fileService.js]"]
end

subgraph group_platform["State and extensions"]
  node_store[("JSON data store<br/>[store.js]")]
  node_session["Session service<br/>[sessionService.js]"]
  node_settings["Panel settings"]
  node_themes["Theme management<br/>[themeController.js]"]
  node_media["Background and music<br/>[mediaController.js]"]
  node_audit["Audit history<br/>[auditService.js]"]
end

node_browser(("Browser user"))
node_github["GitHub"]
node_linux["Linux VPS"]

node_browser -->|"uses"| node_ui
node_browser -->|"uses"| node_server_ui
node_browser -->|"uses"| node_admin_ui
node_ui -->|"HTTP requests"| node_entry
node_server_ui -->|"HTTP and WS"| node_entry
node_admin_ui -->|"HTTP requests"| node_entry
node_entry -->|"dispatches API"| node_routes
node_entry -->|"attaches WS"| node_console
node_entry -->|"attaches WS"| node_shell
node_routes -->|"dispatches auth"| node_auth
node_routes -->|"dispatches account"| node_account
node_routes -->|"dispatches users"| node_user_admin
node_routes -->|"dispatches admin servers"| node_server_admin
node_routes -->|"dispatches servers"| node_server_ops
node_routes -->|"dispatches files"| node_files
node_routes -->|"dispatches settings"| node_settings
node_routes -->|"dispatches themes"| node_themes
node_routes -->|"dispatches media"| node_media
node_auth -->|"creates sessions"| node_session
node_session -->|"reads and writes"| node_store
node_server_ops -->|"controls runtime"| node_process
node_server_ops -->|"requests stats"| node_resources
node_server_ops -->|"manages ports"| node_allocations
node_files -->|"uses file ops"| node_file_service
node_server_ops -->|"records actions"| node_audit
node_server_admin -->|"records actions"| node_audit
node_themes -->|"records actions"| node_audit
node_settings -->|"persists settings"| node_store
node_themes -.->|"imports theme"| node_github
node_process -->|"applies limits"| node_cgroups
node_resources -->|"reads stats"| node_cgroups
node_process -->|"spawns processes"| node_linux
node_shell -->|"spawns PTY"| node_linux
node_console -->|"streams output"| node_process

click node_ui "https://github.com/guritadarattt/panel/blob/main/public/js/dashboard.js"
click node_server_ui "https://github.com/guritadarattt/panel/blob/main/public/js/server.js"
click node_admin_ui "https://github.com/guritadarattt/panel/blob/main/public/js/admin.js"
click node_entry "https://github.com/guritadarattt/panel/blob/main/server.js"
click node_routes "https://github.com/guritadarattt/panel/blob/main/src/routes/index.js"
click node_auth "https://github.com/guritadarattt/panel/blob/main/src/controllers/authController.js"
click node_account "https://github.com/guritadarattt/panel/blob/main/src/controllers/accountController.js"
click node_user_admin "https://github.com/guritadarattt/panel/blob/main/src/controllers/userController.js"
click node_server_admin "https://github.com/guritadarattt/panel/blob/main/src/controllers/adminServerController.js"
click node_server_ops "https://github.com/guritadarattt/panel/blob/main/src/controllers/serverController.js"
click node_files "https://github.com/guritadarattt/panel/blob/main/src/controllers/fileController.js"
click node_allocations "https://github.com/guritadarattt/panel/blob/main/src/services/allocationService.js"
click node_resources "https://github.com/guritadarattt/panel/blob/main/src/resources/resourceManager.js"
click node_console "https://github.com/guritadarattt/panel/blob/main/src/websocket/consoleServer.js"
click node_shell "https://github.com/guritadarattt/panel/blob/main/src/websocket/shellServer.js"
click node_process "https://github.com/guritadarattt/panel/blob/main/src/process/processManager.js"
click node_cgroups "https://github.com/guritadarattt/panel/blob/main/src/process/cgroupManager.js"
click node_file_service "https://github.com/guritadarattt/panel/blob/main/src/services/fileService.js"
click node_store "https://github.com/guritadarattt/panel/blob/main/src/database/store.js"
click node_session "https://github.com/guritadarattt/panel/blob/main/src/services/sessionService.js"
click node_settings "https://github.com/guritadarattt/panel/blob/main/src/controllers/settingsController.js"
click node_themes "https://github.com/guritadarattt/panel/blob/main/src/controllers/themeController.js"
click node_media "https://github.com/guritadarattt/panel/blob/main/src/controllers/mediaController.js"
click node_audit "https://github.com/guritadarattt/panel/blob/main/src/services/auditService.js"

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_ui,node_server_ui,node_admin_ui,node_browser toneBlue
class node_entry,node_routes,node_auth,node_account,node_user_admin,node_server_admin toneAmber
class node_server_ops,node_files,node_allocations,node_resources,node_console,node_shell,node_process,node_cgroups,node_file_service toneMint
class node_store,node_session,node_settings,node_themes,node_media,node_audit toneRose
class node_github,node_linux toneIndigo
```

## Components

### Panel interface

- [Panel UI](https://github.com/guritadarattt/panel/blob/main/public/js/dashboard.js): `public/js/dashboard.js`
- [Server UI](https://github.com/guritadarattt/panel/blob/main/public/js/server.js): `public/js/server.js`
- [Admin UI](https://github.com/guritadarattt/panel/blob/main/public/js/admin.js): `public/js/admin.js`

### HTTP and access

- [HTTP and WS host](https://github.com/guritadarattt/panel/blob/main/server.js): `server.js`
- [API routes](https://github.com/guritadarattt/panel/blob/main/src/routes/index.js): `src/routes/index.js`
- [Authentication](https://github.com/guritadarattt/panel/blob/main/src/controllers/authController.js): `src/controllers/authController.js`
- [Account management](https://github.com/guritadarattt/panel/blob/main/src/controllers/accountController.js): `src/controllers/accountController.js`
- [User administration](https://github.com/guritadarattt/panel/blob/main/src/controllers/userController.js): `src/controllers/userController.js`
- [Server administration](https://github.com/guritadarattt/panel/blob/main/src/controllers/adminServerController.js): `src/controllers/adminServerController.js`

### Server operations

- [Server control](https://github.com/guritadarattt/panel/blob/main/src/controllers/serverController.js): `src/controllers/serverController.js`
- [File manager](https://github.com/guritadarattt/panel/blob/main/src/controllers/fileController.js): `src/controllers/fileController.js`
- [Port allocation](https://github.com/guritadarattt/panel/blob/main/src/services/allocationService.js): `src/services/allocationService.js`
- [Resource monitor](https://github.com/guritadarattt/panel/blob/main/src/resources/resourceManager.js): `src/resources/resourceManager.js`
- [Live console](https://github.com/guritadarattt/panel/blob/main/src/websocket/consoleServer.js): `src/websocket/consoleServer.js`
- [Interactive shell](https://github.com/guritadarattt/panel/blob/main/src/websocket/shellServer.js): `src/websocket/shellServer.js`
- [Process manager](https://github.com/guritadarattt/panel/blob/main/src/process/processManager.js): `src/process/processManager.js`
- [Cgroup limits](https://github.com/guritadarattt/panel/blob/main/src/process/cgroupManager.js): `src/process/cgroupManager.js`
- [File operations](https://github.com/guritadarattt/panel/blob/main/src/services/fileService.js): `src/services/fileService.js`

### State and extensions

- [JSON data store](https://github.com/guritadarattt/panel/blob/main/src/database/store.js): `src/database/store.js`
- [Session service](https://github.com/guritadarattt/panel/blob/main/src/services/sessionService.js): `src/services/sessionService.js`
- [Panel settings](https://github.com/guritadarattt/panel/blob/main/src/controllers/settingsController.js): `src/controllers/settingsController.js`
- [Theme management](https://github.com/guritadarattt/panel/blob/main/src/controllers/themeController.js): `src/controllers/themeController.js`
- [Background and music](https://github.com/guritadarattt/panel/blob/main/src/controllers/mediaController.js): `src/controllers/mediaController.js`
- [Audit history](https://github.com/guritadarattt/panel/blob/main/src/services/auditService.js): `src/services/auditService.js`

### Other components

- **Browser user**
- **GitHub**
- **Linux VPS**

## Connections

- Browser user → Panel UI: uses
- Browser user → Server UI: uses
- Browser user → Admin UI: uses
- Panel UI → HTTP and WS host: HTTP requests
- Server UI → HTTP and WS host: HTTP and WS
- Admin UI → HTTP and WS host: HTTP requests
- HTTP and WS host → API routes: dispatches API
- HTTP and WS host → Live console: attaches WS
- HTTP and WS host → Interactive shell: attaches WS
- API routes → Authentication: dispatches auth
- API routes → Account management: dispatches account
- API routes → User administration: dispatches users
- API routes → Server administration: dispatches admin servers
- API routes → Server control: dispatches servers
- API routes → File manager: dispatches files
- API routes → Panel settings: dispatches settings
- API routes → Theme management: dispatches themes
- API routes → Background and music: dispatches media
- Authentication → Session service: creates sessions
- Session service → JSON data store: reads and writes
- Server control → Process manager: controls runtime
- Server control → Resource monitor: requests stats
- Server control → Port allocation: manages ports
- File manager → File operations: uses file ops
- Server control → Audit history: records actions
- Server administration → Audit history: records actions
- Theme management → Audit history: records actions
- Panel settings → JSON data store: persists settings
- Theme management → GitHub: imports theme
- Process manager → Cgroup limits: applies limits
- Resource monitor → Cgroup limits: reads stats
- Process manager → Linux VPS: spawns processes
- Interactive shell → Linux VPS: spawns PTY
- Live console → Process manager: streams output
