# adarshigx99/sandbox architecture

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

- Interactive diagram: https://gitdiagram.com/adarshigx99/sandbox
- Repository: https://github.com/adarshigx99/sandbox

## Overview

Sandbox lets visitors or administrators provision temporary WordPress sites, then exposes site details and manages their eventual deletion. The main path selects a connected server, requests deployment, records the site, and can configure DNS/SSL and send creation mail. Admin workflows also manage servers and settings; scheduled commands handle expiration and deletion reminders. The README documents SSL, configurable expiry, and public credential pages; those capabilities are represented where the tree supports them. Some controller and service wiring is based on partial excerpts or README descriptions.

Main entry points: [`app/Http/Controllers/SiteController.php`](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/SiteController.php) (Site controller), [`app/Http/Controllers/Admin/SettingsController.php`](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Admin/SettingsController.php) (Settings controller), [`app/Services/ServerAvatarService.php`](https://github.com/adarshigx99/sandbox/blob/main/app/Services/ServerAvatarService.php) (ServerAvatar service), [`app/Http/Controllers/ServerManagementController.php`](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/ServerManagementController.php) (Server management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site_workflow["Site provisioning"]
  node_site_routes["Web routes<br/>[web.php]"]
  node_site_controller["Site controller<br/>[SiteController.php]"]
  node_site_store[("Sites<br/>[Site.php]")]
  node_server_store[("Selected servers<br/>[SelectedServer.php]")]
  node_server_api["ServerAvatar service"]
  node_cloudflare_service["Cloudflare service"]
  node_public_site["Public site page<br/>[show.blade.php]"]
  node_created_mail["Creation email<br/>[SiteCreated.php]"]
end

subgraph group_admin_config["Administration"]
  node_settings_service["Settings service"]
  node_settings_store[("System settings<br/>[SystemSetting.php]")]
  node_settings_controller["Settings controller"]
  node_server_controller["Server management"]
  node_admin_controller["Admin dashboard"]
  node_admin_view["Admin views"]
end

subgraph group_lifecycle["Site lifecycle"]
  node_expire_command["Expiration cleanup"]
  node_notify_command["Deletion reminders"]
  node_deletion_mail["Reminder email"]
end

subgraph group_identity["Accounts and access"]
  node_auth_routes["Auth routes<br/>[auth.php]"]
  node_registration["Registration"]
  node_user_store[("Users<br/>[User.php]")]
  node_login["Login"]
end

node_visitor(("Visitor"))
node_admin(("Administrator"))
node_serveravatar{{"ServerAvatar"}}
node_cloudflare{{"Cloudflare"}}
node_mailer{{"SMTP mail"}}

node_visitor -->|"requests"| node_site_routes
node_admin -->|"manages sites"| node_site_routes
node_site_routes -->|"dispatches"| node_site_controller
node_site_controller -->|"selects server"| node_server_store
node_site_controller -->|"requests deployment"| node_server_api
node_server_api -->|"calls API"| node_serveravatar
node_site_controller -->|"records site"| node_site_store
node_site_controller -->|"manages DNS/SSL"| node_cloudflare_service
node_cloudflare_service -.->|"calls API"| node_cloudflare
node_site_controller -->|"reads settings"| node_settings_service
node_settings_service -->|"reads settings"| node_settings_store
node_site_controller -->|"sends creation mail"| node_created_mail
node_created_mail -->|"delivered by"| node_mailer
node_site_controller -->|"renders details"| node_public_site
node_admin -->|"configures"| node_settings_controller
node_settings_controller -->|"updates settings"| node_settings_store
node_settings_controller -->|"clears cache"| node_settings_service
node_settings_controller -->|"tests connection"| node_server_api
node_settings_controller -.->|"tests connection"| node_cloudflare_service
node_admin -->|"manages servers"| node_server_controller
node_server_controller -->|"fetches server"| node_server_api
node_server_controller -->|"updates selection"| node_server_store
node_admin -->|"opens dashboard"| node_admin_controller
node_admin_controller -->|"renders dashboard"| node_admin_view
node_expire_command -->|"checks expired sites"| node_site_store
node_expire_command -->|"deletes deployment"| node_server_api
node_notify_command -->|"finds due sites"| node_site_store
node_notify_command -->|"sends reminders"| node_deletion_mail
node_deletion_mail -->|"delivered by"| node_mailer
node_visitor -->|"requests account"| node_auth_routes
node_auth_routes -->|"dispatches"| node_registration
node_registration -->|"checks registration setting"| node_settings_store
node_registration -->|"creates account"| node_user_store
node_auth_routes -->|"dispatches"| node_login
node_login -->|"authenticates"| node_user_store

click node_site_routes "https://github.com/adarshigx99/sandbox/blob/main/routes/web.php"
click node_site_controller "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/SiteController.php"
click node_site_store "https://github.com/adarshigx99/sandbox/blob/main/app/Models/Site.php"
click node_server_store "https://github.com/adarshigx99/sandbox/blob/main/app/Models/SelectedServer.php"
click node_server_api "https://github.com/adarshigx99/sandbox/blob/main/app/Services/ServerAvatarService.php"
click node_cloudflare_service "https://github.com/adarshigx99/sandbox/blob/main/app/Services/CloudflareService.php"
click node_settings_service "https://github.com/adarshigx99/sandbox/blob/main/app/Services/SystemSettingsService.php"
click node_settings_store "https://github.com/adarshigx99/sandbox/blob/main/app/Models/SystemSetting.php"
click node_settings_controller "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Admin/SettingsController.php"
click node_server_controller "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/ServerManagementController.php"
click node_admin_controller "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/AdminController.php"
click node_admin_view "https://github.com/adarshigx99/sandbox/blob/main/resources/views/admin/dashboard.blade.php"
click node_public_site "https://github.com/adarshigx99/sandbox/blob/main/resources/views/sites/public/show.blade.php"
click node_created_mail "https://github.com/adarshigx99/sandbox/blob/main/app/Mail/SiteCreated.php"
click node_expire_command "https://github.com/adarshigx99/sandbox/blob/main/app/Console/Commands/DeleteExpiredSites.php"
click node_notify_command "https://github.com/adarshigx99/sandbox/blob/main/app/Console/Commands/SendDeletionNotifications.php"
click node_deletion_mail "https://github.com/adarshigx99/sandbox/blob/main/app/Mail/SiteDeletionNotification.php"
click node_auth_routes "https://github.com/adarshigx99/sandbox/blob/main/routes/auth.php"
click node_registration "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_user_store "https://github.com/adarshigx99/sandbox/blob/main/app/Models/User.php"
click node_login "https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.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_site_routes,node_site_controller,node_site_store,node_server_store,node_server_api,node_cloudflare_service,node_public_site,node_created_mail toneBlue
class node_settings_service,node_settings_store,node_settings_controller,node_server_controller,node_admin_controller,node_admin_view toneAmber
class node_expire_command,node_notify_command,node_deletion_mail,node_serveravatar toneMint
class node_auth_routes,node_registration,node_user_store,node_login toneRose
class node_visitor,node_admin,node_cloudflare,node_mailer toneIndigo
```

## Components

### Site provisioning

- [Web routes](https://github.com/adarshigx99/sandbox/blob/main/routes/web.php): `routes/web.php`
- [Site controller](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/SiteController.php): `app/Http/Controllers/SiteController.php`
- [Sites](https://github.com/adarshigx99/sandbox/blob/main/app/Models/Site.php): `app/Models/Site.php`
- [Selected servers](https://github.com/adarshigx99/sandbox/blob/main/app/Models/SelectedServer.php): `app/Models/SelectedServer.php`
- [ServerAvatar service](https://github.com/adarshigx99/sandbox/blob/main/app/Services/ServerAvatarService.php): `app/Services/ServerAvatarService.php`
- [Cloudflare service](https://github.com/adarshigx99/sandbox/blob/main/app/Services/CloudflareService.php): `app/Services/CloudflareService.php`
- [Public site page](https://github.com/adarshigx99/sandbox/blob/main/resources/views/sites/public/show.blade.php): `resources/views/sites/public/show.blade.php`
- [Creation email](https://github.com/adarshigx99/sandbox/blob/main/app/Mail/SiteCreated.php): `app/Mail/SiteCreated.php`

### Administration

- [Settings service](https://github.com/adarshigx99/sandbox/blob/main/app/Services/SystemSettingsService.php): `app/Services/SystemSettingsService.php`
- [System settings](https://github.com/adarshigx99/sandbox/blob/main/app/Models/SystemSetting.php): `app/Models/SystemSetting.php`
- [Settings controller](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Admin/SettingsController.php): `app/Http/Controllers/Admin/SettingsController.php`
- [Server management](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/ServerManagementController.php): `app/Http/Controllers/ServerManagementController.php`
- [Admin dashboard](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/AdminController.php): `app/Http/Controllers/AdminController.php`
- [Admin views](https://github.com/adarshigx99/sandbox/blob/main/resources/views/admin/dashboard.blade.php): `resources/views/admin/dashboard.blade.php`

### Site lifecycle

- [Expiration cleanup](https://github.com/adarshigx99/sandbox/blob/main/app/Console/Commands/DeleteExpiredSites.php): `app/Console/Commands/DeleteExpiredSites.php`
- [Deletion reminders](https://github.com/adarshigx99/sandbox/blob/main/app/Console/Commands/SendDeletionNotifications.php): `app/Console/Commands/SendDeletionNotifications.php`
- [Reminder email](https://github.com/adarshigx99/sandbox/blob/main/app/Mail/SiteDeletionNotification.php): `app/Mail/SiteDeletionNotification.php`

### Accounts and access

- [Auth routes](https://github.com/adarshigx99/sandbox/blob/main/routes/auth.php): `routes/auth.php`
- [Registration](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Users](https://github.com/adarshigx99/sandbox/blob/main/app/Models/User.php): `app/Models/User.php`
- [Login](https://github.com/adarshigx99/sandbox/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`

### Other components

- **Visitor**
- **Administrator**
- **ServerAvatar**
- **Cloudflare**
- **SMTP mail**

## Connections

- Visitor → Web routes: requests
- Administrator → Web routes: manages sites
- Web routes → Site controller: dispatches
- Site controller → Selected servers: selects server
- Site controller → ServerAvatar service: requests deployment
- ServerAvatar service → ServerAvatar: calls API
- Site controller → Sites: records site
- Site controller → Cloudflare service: manages DNS/SSL
- Cloudflare service → Cloudflare: calls API
- Site controller → Settings service: reads settings
- Settings service → System settings: reads settings
- Site controller → Creation email: sends creation mail
- Creation email → SMTP mail: delivered by
- Site controller → Public site page: renders details
- Administrator → Settings controller: configures
- Settings controller → System settings: updates settings
- Settings controller → Settings service: clears cache
- Settings controller → ServerAvatar service: tests connection
- Settings controller → Cloudflare service: tests connection
- Administrator → Server management: manages servers
- Server management → ServerAvatar service: fetches server
- Server management → Selected servers: updates selection
- Administrator → Admin dashboard: opens dashboard
- Admin dashboard → Admin views: renders dashboard
- Expiration cleanup → Sites: checks expired sites
- Expiration cleanup → ServerAvatar service: deletes deployment
- Deletion reminders → Sites: finds due sites
- Deletion reminders → Reminder email: sends reminders
- Reminder email → SMTP mail: delivered by
- Visitor → Auth routes: requests account
- Auth routes → Registration: dispatches
- Registration → System settings: checks registration setting
- Registration → Users: creates account
- Auth routes → Login: dispatches
- Login → Users: authenticates
