# btherio/ghoti architecture

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

- Interactive diagram: https://gitdiagram.com/btherio/ghoti
- Repository: https://github.com/btherio/ghoti

## Overview

Ghoti is a PHP CMS and site-management platform. A request enters through index.php, which loads the core, applies settings, manages the session, and loads enabled modules; the core provides page rendering and asynchronous JSON RPC. Major capabilities include accounts, content, analytics, commerce, and site administration. The graph includes the listed product modules, but their internal links are limited where source was not sampled and the README provides no additional documentation.

Main entry points: [`ghoti.php`](https://github.com/btherio/ghoti/blob/main/ghoti.php) (Ghoti Runtime), [`index.php`](https://github.com/btherio/ghoti/blob/main/index.php) (Request Bootstrap), [`mod/filemanager/filemanager.download.php`](https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.download.php) (File Downloads), [`mod/filemanager/filemanager.async.php`](https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.async.php) (File Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["CMS Core"]
  node_entry["Request Bootstrap<br/>[index.php]"]
  node_runtime["Ghoti Runtime<br/>[ghoti.php]"]
  node_rpc["Async RPC and Pages<br/>[ghoti.async.php]"]
  node_database[("Core Database<br/>[ghoti.db.php]")]
  node_validation["Input Validation<br/>[ghoti.validate.php]"]
  node_security["Security Controls<br/>[ghoti.security.php]"]
  node_privacy["Privacy Controls<br/>[ghoti.privacy.php]"]
  node_alerts["Alerts<br/>[ghoti.alerts.php]"]
  node_setup["Initial Setup<br/>[ghoti.setup.php]"]
  node_docs["Documentation"]
  node_backup["Backup<br/>[ghoti.backup.php]"]
  node_mailcore["Core Mail<br/>[ghoti.mail.php]"]
  node_seo["SEO<br/>[ghoti.seo.php]"]
  node_totp["TOTP<br/>[ghoti.totp.php]"]
end

subgraph group_content["Content and Community"]
  node_login["Accounts and Login<br/>[login.async.php]"]
  node_logindb[("Account Storage<br/>[login.db.php]")]
  node_boards["Message Boards"]
  node_gallery["Gallery"]
  node_links["Links"]
end

subgraph group_commerce["Commerce and Services"]
  node_store["Storefront and Orders<br/>[store.async.php]"]
  node_promotions["Store Promotions"]
  node_storedb[("Store Storage<br/>[store.db.php]")]
  node_storefulfil["Order Fulfilment<br/>[store.fulfil.php]"]
  node_storecrypto["Crypto Payments<br/>[store.crypto.php]"]
  node_storepaypal["PayPal Payments<br/>[store.paypal.php]"]
  node_mailmodule["Mail Module"]
  node_bpong["Bitcoin Pong"]
end

subgraph group_admin["Site Administration"]
  node_analytics["Analytics"]
  node_banners["Banners and Ads"]
  node_vhosts["Virtual Hosts"]
  node_filemanager["File Manager"]
  node_filedownload["File Downloads"]
end

node_visitor(("Visitor or Admin"))

node_visitor -->|"requests page"| node_entry
node_entry -->|"loads core"| node_runtime
node_runtime -->|"includes RPC"| node_rpc
node_runtime -->|"includes database"| node_database
node_runtime -->|"includes validation"| node_validation
node_runtime -->|"includes security"| node_security
node_runtime -->|"includes privacy"| node_privacy
node_runtime -->|"includes alerts"| node_alerts
node_runtime -->|"includes setup"| node_setup
node_runtime -->|"includes documentation"| node_docs
node_runtime -->|"includes backup"| node_backup
node_runtime -->|"includes mail"| node_mailcore
node_runtime -->|"includes SEO"| node_seo
node_runtime -->|"includes TOTP"| node_totp
node_entry -->|"instantiates"| node_analytics
node_entry -->|"instantiates"| node_gallery
node_entry -->|"instantiates"| node_mailmodule
node_entry -->|"instantiates"| node_filemanager
node_entry -->|"conditionally instantiates"| node_boards
node_entry -->|"conditionally instantiates"| node_vhosts
node_filedownload -->|"loads core"| node_runtime
node_filedownload -->|"checks admin"| node_logindb
node_filedownload -->|"resolves target"| node_filemanager
node_store -->|"uses rules"| node_promotions

click node_entry "https://github.com/btherio/ghoti/blob/main/index.php"
click node_runtime "https://github.com/btherio/ghoti/blob/main/ghoti.php"
click node_rpc "https://github.com/btherio/ghoti/blob/main/ghoti.async.php"
click node_database "https://github.com/btherio/ghoti/blob/main/ghoti.db.php"
click node_validation "https://github.com/btherio/ghoti/blob/main/ghoti.validate.php"
click node_security "https://github.com/btherio/ghoti/blob/main/ghoti.security.php"
click node_privacy "https://github.com/btherio/ghoti/blob/main/ghoti.privacy.php"
click node_alerts "https://github.com/btherio/ghoti/blob/main/ghoti.alerts.php"
click node_setup "https://github.com/btherio/ghoti/blob/main/ghoti.setup.php"
click node_docs "https://github.com/btherio/ghoti/blob/main/ghoti.documentation.php"
click node_backup "https://github.com/btherio/ghoti/blob/main/ghoti.backup.php"
click node_mailcore "https://github.com/btherio/ghoti/blob/main/ghoti.mail.php"
click node_seo "https://github.com/btherio/ghoti/blob/main/ghoti.seo.php"
click node_totp "https://github.com/btherio/ghoti/blob/main/ghoti.totp.php"
click node_analytics "https://github.com/btherio/ghoti/tree/main/mod/analytics"
click node_banners "https://github.com/btherio/ghoti/tree/main/mod/banners"
click node_vhosts "https://github.com/btherio/ghoti/tree/main/mod/vhosts"
click node_filemanager "https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.async.php"
click node_filedownload "https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.download.php"
click node_login "https://github.com/btherio/ghoti/blob/main/mod/login/login.async.php"
click node_logindb "https://github.com/btherio/ghoti/blob/main/mod/login/login.db.php"
click node_boards "https://github.com/btherio/ghoti/tree/main/mod/boards"
click node_gallery "https://github.com/btherio/ghoti/tree/main/mod/gallery"
click node_links "https://github.com/btherio/ghoti/tree/main/mod/links"
click node_store "https://github.com/btherio/ghoti/blob/main/mod/store/store.async.php"
click node_promotions "https://github.com/btherio/ghoti/blob/main/mod/store/store.promotions.php"
click node_storedb "https://github.com/btherio/ghoti/blob/main/mod/store/store.db.php"
click node_storefulfil "https://github.com/btherio/ghoti/blob/main/mod/store/store.fulfil.php"
click node_storecrypto "https://github.com/btherio/ghoti/blob/main/mod/store/store.crypto.php"
click node_storepaypal "https://github.com/btherio/ghoti/blob/main/mod/store/store.paypal.php"
click node_mailmodule "https://github.com/btherio/ghoti/tree/main/mod/mail"
click node_bpong "https://github.com/btherio/ghoti/tree/main/mod/bpong"

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_entry,node_runtime,node_rpc,node_database,node_validation,node_security,node_privacy,node_alerts,node_setup,node_docs,node_backup,node_mailcore,node_seo,node_totp toneBlue
class node_login,node_logindb,node_boards,node_gallery,node_links toneAmber
class node_store,node_promotions,node_storedb,node_storefulfil,node_storecrypto,node_storepaypal,node_mailmodule,node_bpong toneMint
class node_analytics,node_banners,node_vhosts,node_filemanager,node_filedownload toneRose
class node_visitor toneIndigo
```

## Components

### CMS Core

- [Request Bootstrap](https://github.com/btherio/ghoti/blob/main/index.php): `index.php`
- [Ghoti Runtime](https://github.com/btherio/ghoti/blob/main/ghoti.php): `ghoti.php`
- [Async RPC and Pages](https://github.com/btherio/ghoti/blob/main/ghoti.async.php): `ghoti.async.php`
- [Core Database](https://github.com/btherio/ghoti/blob/main/ghoti.db.php): `ghoti.db.php`
- [Input Validation](https://github.com/btherio/ghoti/blob/main/ghoti.validate.php): `ghoti.validate.php`
- [Security Controls](https://github.com/btherio/ghoti/blob/main/ghoti.security.php): `ghoti.security.php`
- [Privacy Controls](https://github.com/btherio/ghoti/blob/main/ghoti.privacy.php): `ghoti.privacy.php`
- [Alerts](https://github.com/btherio/ghoti/blob/main/ghoti.alerts.php): `ghoti.alerts.php`
- [Initial Setup](https://github.com/btherio/ghoti/blob/main/ghoti.setup.php): `ghoti.setup.php`
- [Documentation](https://github.com/btherio/ghoti/blob/main/ghoti.documentation.php): `ghoti.documentation.php`
- [Backup](https://github.com/btherio/ghoti/blob/main/ghoti.backup.php): `ghoti.backup.php`
- [Core Mail](https://github.com/btherio/ghoti/blob/main/ghoti.mail.php): `ghoti.mail.php`
- [SEO](https://github.com/btherio/ghoti/blob/main/ghoti.seo.php): `ghoti.seo.php`
- [TOTP](https://github.com/btherio/ghoti/blob/main/ghoti.totp.php): `ghoti.totp.php`

### Content and Community

- [Accounts and Login](https://github.com/btherio/ghoti/blob/main/mod/login/login.async.php): `mod/login/login.async.php`
- [Account Storage](https://github.com/btherio/ghoti/blob/main/mod/login/login.db.php): `mod/login/login.db.php`
- [Message Boards](https://github.com/btherio/ghoti/tree/main/mod/boards): `mod/boards`
- [Gallery](https://github.com/btherio/ghoti/tree/main/mod/gallery): `mod/gallery`
- [Links](https://github.com/btherio/ghoti/tree/main/mod/links): `mod/links`

### Commerce and Services

- [Storefront and Orders](https://github.com/btherio/ghoti/blob/main/mod/store/store.async.php): `mod/store/store.async.php`
- [Store Promotions](https://github.com/btherio/ghoti/blob/main/mod/store/store.promotions.php): `mod/store/store.promotions.php`
- [Store Storage](https://github.com/btherio/ghoti/blob/main/mod/store/store.db.php): `mod/store/store.db.php`
- [Order Fulfilment](https://github.com/btherio/ghoti/blob/main/mod/store/store.fulfil.php): `mod/store/store.fulfil.php`
- [Crypto Payments](https://github.com/btherio/ghoti/blob/main/mod/store/store.crypto.php): `mod/store/store.crypto.php`
- [PayPal Payments](https://github.com/btherio/ghoti/blob/main/mod/store/store.paypal.php): `mod/store/store.paypal.php`
- [Mail Module](https://github.com/btherio/ghoti/tree/main/mod/mail): `mod/mail`
- [Bitcoin Pong](https://github.com/btherio/ghoti/tree/main/mod/bpong): `mod/bpong`

### Site Administration

- [Analytics](https://github.com/btherio/ghoti/tree/main/mod/analytics): `mod/analytics`
- [Banners and Ads](https://github.com/btherio/ghoti/tree/main/mod/banners): `mod/banners`
- [Virtual Hosts](https://github.com/btherio/ghoti/tree/main/mod/vhosts): `mod/vhosts`
- [File Manager](https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.async.php): `mod/filemanager/filemanager.async.php`
- [File Downloads](https://github.com/btherio/ghoti/blob/main/mod/filemanager/filemanager.download.php): `mod/filemanager/filemanager.download.php`

### Other components

- **Visitor or Admin**

## Connections

- Visitor or Admin → Request Bootstrap: requests page (evidence: `index.php`)
- Request Bootstrap → Ghoti Runtime: loads core (evidence: `index.php`)
- Ghoti Runtime → Async RPC and Pages: includes RPC (evidence: `ghoti.php`)
- Ghoti Runtime → Core Database: includes database (evidence: `ghoti.php`)
- Ghoti Runtime → Input Validation: includes validation (evidence: `ghoti.php`)
- Ghoti Runtime → Security Controls: includes security (evidence: `ghoti.php`)
- Ghoti Runtime → Privacy Controls: includes privacy (evidence: `ghoti.php`)
- Ghoti Runtime → Alerts: includes alerts (evidence: `ghoti.php`)
- Ghoti Runtime → Initial Setup: includes setup (evidence: `ghoti.php`)
- Ghoti Runtime → Documentation: includes documentation (evidence: `ghoti.php`)
- Ghoti Runtime → Backup: includes backup (evidence: `ghoti.php`)
- Ghoti Runtime → Core Mail: includes mail (evidence: `ghoti.php`)
- Ghoti Runtime → SEO: includes SEO (evidence: `ghoti.php`)
- Ghoti Runtime → TOTP: includes TOTP (evidence: `ghoti.php`)
- Request Bootstrap → Analytics: instantiates (evidence: `index.php`)
- Request Bootstrap → Gallery: instantiates (evidence: `index.php`)
- Request Bootstrap → Mail Module: instantiates (evidence: `index.php`)
- Request Bootstrap → File Manager: instantiates (evidence: `index.php`)
- Request Bootstrap → Message Boards: conditionally instantiates (evidence: `index.php`)
- Request Bootstrap → Virtual Hosts: conditionally instantiates (evidence: `index.php`)
- File Downloads → Ghoti Runtime: loads core (evidence: `mod/filemanager/filemanager.download.php`)
- File Downloads → Account Storage: checks admin (evidence: `mod/filemanager/filemanager.download.php`)
- File Downloads → File Manager: resolves target (evidence: `mod/filemanager/filemanager.download.php`)
- Storefront and Orders → Store Promotions: uses rules (evidence: `mod/store/store.async.php`)
