# freyzamarshall02/seiapanel architecture

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

- Interactive diagram: https://gitdiagram.com/freyzamarshall02/seiapanel
- Repository: https://github.com/freyzamarshall02/seiapanel

## Overview

SeiaPanel is a self-hosted Minecraft server control panel. A user registers or logs in, then the authenticated web panel discovers configured servers and offers controls for processes, console, files, schedules, backups, and resource usage. The Go router and handlers coordinate these operations, with services managing server processes, scheduled actions, and backup work; models persist account, server, schedule, and backup state. The README documents several capabilities whose detailed implementation was not sampled, so those branches are included without inferring unshown internal calls.

Main entry points: [`main.go`](https://github.com/freyzamarshall02/seiapanel/blob/main/main.go) (HTTP application), [`handlers/server.go`](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/server.go) (Server controls), [`services/server_manager.go`](https://github.com/freyzamarshall02/seiapanel/blob/main/services/server_manager.go) (Server process), [`models/server.go`](https://github.com/freyzamarshall02/seiapanel/blob/main/models/server.go) (Domain records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_pages["Page rendering<br/>[render.go]"]
  node_console_ui["Live console UI<br/>[console.js]"]
  node_file_ui["File manager UI<br/>[file-manager.js]"]
  node_backup_ui["Backup UI<br/>[backups.js]"]
  node_schedule_ui["Schedule UI<br/>[schedule.js]"]
end

subgraph group_access["Access and routing"]
  node_app["HTTP application<br/>[main.go]"]
  node_auth["Account and login<br/>[auth.go]"]
  node_guard["Session guard<br/>[auth.go]"]
  node_config["Panel configuration<br/>[config.go]"]
end

subgraph group_servers["Server operations"]
  node_dashboard["Server discovery<br/>[server.go]"]
  node_server_handlers["Server controls<br/>[server.go]"]
  node_process["Server process<br/>[server_manager.go]"]
  node_file_handlers["File operations<br/>[files.go]"]
  node_file_editor["File editing<br/>[file_editor.go]"]
  node_stats["Resource monitoring<br/>[system_stats.go]"]
  node_settings["Server settings<br/>[settings.go]"]
end

subgraph group_automation["Automation and state"]
  node_backup_handlers["Backup controls<br/>[backups.go]"]
  node_backup_service["Backup engine<br/>[backup_service.go]"]
  node_schedule_handlers["Schedule controls<br/>[schedule.go]"]
  node_schedule_service["Cron execution"]
  node_models["Domain records<br/>[server.go]"]
  node_database[("SQLite database<br/>[database.go]")]
end

node_user(("Panel user"))
node_browser(("Web browser"))
node_minecraft["Minecraft server"]

node_user -->|"uses"| node_browser
node_browser -->|"sends requests"| node_app
node_app -->|"routes requests"| node_auth
node_app -->|"protects routes"| node_guard
node_app -->|"routes pages"| node_pages
node_auth -->|"checks accounts"| node_database
node_auth -->|"stores sessions"| node_config
node_app -->|"routes dashboard"| node_dashboard
node_dashboard -->|"loads servers"| node_models
node_app -->|"routes controls"| node_server_handlers
node_server_handlers -->|"controls process"| node_process
node_process -->|"starts process"| node_minecraft
node_browser -->|"views console"| node_console_ui
node_console_ui -.->|"uses console endpoints"| node_server_handlers
node_app -->|"routes file actions"| node_file_handlers
node_app -.->|"routes file editing"| node_file_editor
node_browser -->|"manages files"| node_file_ui
node_file_ui -->|"requests navigation"| node_file_handlers
node_browser -->|"manages backups"| node_backup_ui
node_app -->|"routes backup actions"| node_backup_handlers
node_backup_handlers -.->|"manages archives"| node_backup_service
node_backup_handlers -.->|"records backups"| node_models
node_browser -->|"configures tasks"| node_schedule_ui
node_app -->|"routes schedules"| node_schedule_handlers
node_schedule_handlers -.->|"manages cron jobs"| node_schedule_service
node_schedule_service -->|"runs server actions"| node_process
node_schedule_service -.->|"creates scheduled backups"| node_backup_service
node_server_handlers -.->|"gets usage stats"| node_stats
node_browser -->|"sets server folder"| node_settings
node_settings -.->|"updates settings"| node_config
node_models -->|"persists records"| node_database
node_process -->|"updates status"| node_models

click node_app "https://github.com/freyzamarshall02/seiapanel/blob/main/main.go"
click node_auth "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/auth.go"
click node_guard "https://github.com/freyzamarshall02/seiapanel/blob/main/middleware/auth.go"
click node_pages "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/render.go"
click node_dashboard "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/server.go"
click node_server_handlers "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/server.go"
click node_process "https://github.com/freyzamarshall02/seiapanel/blob/main/services/server_manager.go"
click node_console_ui "https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/console/console.js"
click node_file_handlers "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/files.go"
click node_file_editor "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/file_editor.go"
click node_file_ui "https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/files/file-manager.js"
click node_backup_handlers "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/backups.go"
click node_backup_service "https://github.com/freyzamarshall02/seiapanel/blob/main/services/backup_service.go"
click node_backup_ui "https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/backups/backups.js"
click node_schedule_handlers "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/schedule.go"
click node_schedule_service "https://github.com/freyzamarshall02/seiapanel/blob/main/services/schedule_service.go"
click node_schedule_ui "https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/schedule/schedule.js"
click node_stats "https://github.com/freyzamarshall02/seiapanel/blob/main/services/system_stats.go"
click node_settings "https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/settings.go"
click node_config "https://github.com/freyzamarshall02/seiapanel/blob/main/config/config.go"
click node_models "https://github.com/freyzamarshall02/seiapanel/blob/main/models/server.go"
click node_database "https://github.com/freyzamarshall02/seiapanel/blob/main/models/database.go"

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_pages,node_console_ui,node_file_ui,node_backup_ui,node_schedule_ui,node_user,node_browser toneBlue
class node_app,node_auth,node_guard,node_config toneAmber
class node_dashboard,node_server_handlers,node_process,node_file_handlers,node_file_editor,node_stats,node_settings,node_minecraft toneMint
class node_backup_handlers,node_backup_service,node_schedule_handlers,node_schedule_service,node_models,node_database toneRose
```

## Components

### Web interface

- [Page rendering](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/render.go): `handlers/render.go`
- [Live console UI](https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/console/console.js): `static/js/console/console.js`
- [File manager UI](https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/files/file-manager.js): `static/js/files/file-manager.js`
- [Backup UI](https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/backups/backups.js): `static/js/backups/backups.js`
- [Schedule UI](https://github.com/freyzamarshall02/seiapanel/blob/main/static/js/schedule/schedule.js): `static/js/schedule/schedule.js`

### Access and routing

- [HTTP application](https://github.com/freyzamarshall02/seiapanel/blob/main/main.go): `main.go`
- [Account and login](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/auth.go): `handlers/auth.go`
- [Session guard](https://github.com/freyzamarshall02/seiapanel/blob/main/middleware/auth.go): `middleware/auth.go`
- [Panel configuration](https://github.com/freyzamarshall02/seiapanel/blob/main/config/config.go): `config/config.go`

### Server operations

- [Server discovery](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/server.go): `handlers/server.go`
- [Server controls](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/server.go): `handlers/server.go`
- [Server process](https://github.com/freyzamarshall02/seiapanel/blob/main/services/server_manager.go): `services/server_manager.go`
- [File operations](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/files.go): `handlers/files.go`
- [File editing](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/file_editor.go): `handlers/file_editor.go`
- [Resource monitoring](https://github.com/freyzamarshall02/seiapanel/blob/main/services/system_stats.go): `services/system_stats.go`
- [Server settings](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/settings.go): `handlers/settings.go`

### Automation and state

- [Backup controls](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/backups.go): `handlers/backups.go`
- [Backup engine](https://github.com/freyzamarshall02/seiapanel/blob/main/services/backup_service.go): `services/backup_service.go`
- [Schedule controls](https://github.com/freyzamarshall02/seiapanel/blob/main/handlers/schedule.go): `handlers/schedule.go`
- [Cron execution](https://github.com/freyzamarshall02/seiapanel/blob/main/services/schedule_service.go): `services/schedule_service.go`
- [Domain records](https://github.com/freyzamarshall02/seiapanel/blob/main/models/server.go): `models/server.go`
- [SQLite database](https://github.com/freyzamarshall02/seiapanel/blob/main/models/database.go): `models/database.go`

### Other components

- **Panel user**
- **Web browser**
- **Minecraft server**

## Connections

- Panel user → Web browser: uses (evidence: `README.md`)
- Web browser → HTTP application: sends requests (evidence: `README.md`)
- HTTP application → Account and login: routes requests (evidence: `main.go`)
- HTTP application → Session guard: protects routes (evidence: `main.go`)
- HTTP application → Page rendering: routes pages (evidence: `main.go`)
- Account and login → SQLite database: checks accounts (evidence: `handlers/auth.go`)
- Account and login → Panel configuration: stores sessions (evidence: `handlers/auth.go`)
- HTTP application → Server discovery: routes dashboard (evidence: `main.go`)
- Server discovery → Domain records: loads servers (evidence: `handlers/server.go`)
- HTTP application → Server controls: routes controls (evidence: `main.go`)
- Server controls → Server process: controls process (evidence: `handlers/server.go`)
- Server process → Minecraft server: starts process (evidence: `services/server_manager.go`)
- Web browser → Live console UI: views console (evidence: `README.md`)
- Live console UI → Server controls: uses console endpoints
- HTTP application → File operations: routes file actions (evidence: `main.go`)
- HTTP application → File editing: routes file editing (evidence: `main.go`)
- Web browser → File manager UI: manages files (evidence: `README.md`)
- File manager UI → File operations: requests navigation (evidence: `static/js/files/file-manager.js`)
- Web browser → Backup UI: manages backups (evidence: `README.md`)
- HTTP application → Backup controls: routes backup actions (evidence: `main.go`)
- Backup controls → Backup engine: manages archives
- Backup controls → Domain records: records backups
- Web browser → Schedule UI: configures tasks (evidence: `README.md`)
- HTTP application → Schedule controls: routes schedules (evidence: `main.go`)
- Schedule controls → Cron execution: manages cron jobs
- Cron execution → Server process: runs server actions (evidence: `services/schedule_service.go`)
- Cron execution → Backup engine: creates scheduled backups
- Server controls → Resource monitoring: gets usage stats
- Web browser → Server settings: sets server folder (evidence: `README.md`)
- Server settings → Panel configuration: updates settings
- Domain records → SQLite database: persists records (evidence: `models/database.go`)
- Server process → Domain records: updates status (evidence: `services/server_manager.go`)
