Skip to content

Architecture

Web.Casa follows a layered architecture with clear separation between the API, business logic, data, and UI layers.

┌─────────────────────────────────────────────┐
│ Browser (React 19 SPA) │
│ Vite 7 · Radix UI Themes 3 · Zustand 5 │
│ Tailwind CSS v4 │
└──────────────┬──────────────────────────────┘
│ REST API (HTTP)
│ WebSocket (terminal, metrics, logs)
┌──────────────▼──────────────────────────────┐
│ Go Backend (Gin + GORM) │
│ ┌──────────┐ ┌──────────┐ ┌─────────────┐ │
│ │ Handler │ │ Service │ │ Model │ │
│ │ layer │→│ layer │→│ layer │ │
│ └──────────┘ └──────────┘ └─────────────┘ │
│ ┌──────────────────────────────────────┐ │
│ │ Plugin System (12 plugins) │ │
│ └──────────────────────────────────────┘ │
└──────┬──────────────────────┬───────────────┘
│ │
┌──────▼──────┐ ┌──────────▼──────────┐
│ SQLite │ │ Caddy subprocess │
│ (WAL mode) │ │ (managed via │
│ │ │ admin API) │
└─────────────┘ └─────────────────────┘
  • Built with Go using the Gin HTTP framework
  • Data persistence through GORM ORM with SQLite in WAL mode
  • SQLite stores all panel configuration, user accounts, host definitions, audit logs, and plugin state
  • Database location: /var/lib/webcasa/webcasa.db

Key design choice: Caddy runs as a managed subprocess. Web.Casa communicates with Caddy through its admin API to apply configuration changes dynamically — no process restarts needed.

TechnologyVersionPurpose
React19UI framework
Vite7Build tool and dev server
Radix UI Themes3Component library
Tailwind CSSv4Utility-first styling
Zustand5State management
  • Compiled into static assets and served directly by the Go binary
  • No separate web server required for the frontend
  • Single-page application with client-side routing

WebSocket connections handle features requiring persistent, bidirectional data flow:

  • Terminal — PTY sessions via xterm.js
  • Monitoring — CPU, memory, disk, and network metrics streaming
  • Deploy — build log streaming during Git deployments
  • Docker — container log tailing

Web.Casa uses a plugin architecture to organize feature modules. Each plugin implements a standard Plugin interface and communicates with the core system through an event bus.

12 built-in plugins:

PluginFunction
DockerContainer and Compose management
DatabaseMySQL/PostgreSQL/MariaDB/Redis management
BackupScheduled and manual backups
MonitoringSystem resource metrics
File ManagerFile browsing, editing, and web terminal
AIAI assistant integration
App StoreOne-click Docker app catalog
MCP ServerModel Context Protocol endpoints
FirewallFirewall rule management
PHPPHP version and site management
DeployGit-based deployment pipelines
Cron JobScheduled task management
  • Runs as a systemd service in production
  • Configuration via environment variables in /etc/webcasa/webcasa.env
  • Caddy binary managed as a child process with lifecycle control (start, stop, reload)