# elementary/website architecture

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

- Interactive diagram: https://gitdiagram.com/elementary/website
- Repository: https://github.com/elementary/website

## Overview

This is elementary.io, a PHP-templated website for presenting elementary OS, its community and resources, and release downloads and payments. The main visitor flow is routed page requests to page rendering, with the homepage additionally loading download and payment logic. Separate branches cover localization and translation maintenance, checkout, and cache support. The README describes the simple PHP template model; some page capabilities are represented by their exact paths in the tree, but their implementations were not sampled, so their internal links are omitted.

Main entry points: [`index.php`](https://github.com/elementary/website/blob/master/index.php) (Homepage), [`_backend/preload.php`](https://github.com/elementary/website/blob/master/_backend/preload.php) (Page setup), [`_backend/bootstrap.php`](https://github.com/elementary/website/blob/master/_backend/bootstrap.php) (Backend bootstrap), [`api/create-checkout-session.php`](https://github.com/elementary/website/blob/master/api/create-checkout-session.php) (Checkout endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Website pages"]
  node_router["Request router<br/>[router.php]"]
  node_home["Homepage<br/>[index.php]"]
  node_brand["Brand guide<br/>[brand.php]"]
  node_open_source["Open source<br/>[open-source.php]"]
  node_community_pages["Community pages<br/>[get-involved.php]"]
  node_support_pages["Support pages<br/>[support.php]"]
  node_error_page["Not found page<br/>[404.php]"]
end

subgraph group_render["Rendering and configuration"]
  node_preload["Page setup<br/>[preload.php]"]
  node_bootstrap["Backend bootstrap<br/>[bootstrap.php]"]
  node_config["Configuration loader<br/>[config.loader.php]"]
  node_templates["Shared templates<br/>[header.php]"]
  node_translation_footer["Page footer<br/>[footer.php]"]
  node_logging["Response logging<br/>[log-echo.php]"]
end

subgraph group_release["Release and payment"]
  node_download["Download link<br/>[download.php]"]
  node_payment["Payment cookies<br/>[os-payment.php]"]
  node_checkout["Checkout endpoint"]
end

subgraph group_localization["Localization"]
  node_localization_runtime["Localization runtime<br/>[L10n.php]"]
  node_translation_extract["Text extraction<br/>[Extract.php]"]
  node_translation_manage["Translation updates<br/>[Translation.php]"]
end

subgraph group_cache["Cache support"]
  node_cache["Cache facade<br/>[Cache.php]"]
  node_cache_interface["Store interface<br/>[StoreInterface.php]"]
  node_cache_base["Base store<br/>[BaseStore.php]"]
  node_cache_file[("File store<br/>[FileStore.php]")]
end

node_visitor(("Site visitor"))
node_stripe["Stripe checkout"]

node_visitor -.->|"requests pages"| node_router
node_router -->|"routes root"| node_home
node_router -->|"routes missing"| node_error_page
node_home -->|"loads link"| node_download
node_home -->|"loads setup"| node_preload
node_home -->|"loads payment logic"| node_payment
node_preload -->|"loads bootstrap"| node_bootstrap
node_bootstrap -->|"loads config"| node_config
node_preload -->|"loads logging"| node_logging
node_home -.->|"renders shared header"| node_templates
node_home -.->|"renders shared footer"| node_translation_footer
node_templates -->|"uses translations"| node_localization_runtime
node_translation_manage -->|"runs extraction"| node_translation_extract
node_translation_manage -->|"loads language data"| node_localization_runtime
node_translation_extract -->|"extracts translated text"| node_localization_runtime
node_payment -->|"loads bootstrap"| node_bootstrap
node_payment -->|"loads logging"| node_logging
node_checkout -->|"loads bootstrap"| node_bootstrap
node_checkout -->|"loads site setup"| node_preload
node_checkout -->|"creates session"| node_stripe
node_cache -->|"uses contract"| node_cache_interface
node_cache_file -->|"implements contract"| node_cache_interface
node_cache_file -->|"extends store"| node_cache_base
node_cache_file -->|"references facade"| node_cache

click node_router "https://github.com/elementary/website/blob/master/router.php"
click node_home "https://github.com/elementary/website/blob/master/index.php"
click node_brand "https://github.com/elementary/website/blob/master/brand.php"
click node_open_source "https://github.com/elementary/website/blob/master/open-source.php"
click node_community_pages "https://github.com/elementary/website/blob/master/get-involved.php"
click node_support_pages "https://github.com/elementary/website/blob/master/support.php"
click node_error_page "https://github.com/elementary/website/blob/master/404.php"
click node_preload "https://github.com/elementary/website/blob/master/_backend/preload.php"
click node_bootstrap "https://github.com/elementary/website/blob/master/_backend/bootstrap.php"
click node_config "https://github.com/elementary/website/blob/master/_backend/config.loader.php"
click node_templates "https://github.com/elementary/website/blob/master/_templates/header.php"
click node_translation_footer "https://github.com/elementary/website/blob/master/_templates/footer.php"
click node_localization_runtime "https://github.com/elementary/website/blob/master/_backend/Lib/L10n.php"
click node_translation_extract "https://github.com/elementary/website/blob/master/_backend/Console/Extract.php"
click node_translation_manage "https://github.com/elementary/website/blob/master/_backend/Console/Translation.php"
click node_download "https://github.com/elementary/website/blob/master/_backend/download.php"
click node_payment "https://github.com/elementary/website/blob/master/_backend/os-payment.php"
click node_checkout "https://github.com/elementary/website/blob/master/api/create-checkout-session.php"
click node_cache "https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Cache.php"
click node_cache_interface "https://github.com/elementary/website/blob/master/_backend/Lib/Cache/StoreInterface.php"
click node_cache_base "https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Store/BaseStore.php"
click node_cache_file "https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Store/FileStore.php"
click node_logging "https://github.com/elementary/website/blob/master/_backend/log-echo.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_router,node_home,node_brand,node_open_source,node_community_pages,node_support_pages,node_error_page toneBlue
class node_preload,node_bootstrap,node_config,node_templates,node_translation_footer,node_logging toneAmber
class node_download,node_payment,node_checkout toneMint
class node_localization_runtime,node_translation_extract,node_translation_manage toneRose
class node_cache,node_cache_interface,node_cache_base,node_cache_file,node_visitor,node_stripe toneIndigo
```

## Components

### Website pages

- [Request router](https://github.com/elementary/website/blob/master/router.php): `router.php`
- [Homepage](https://github.com/elementary/website/blob/master/index.php): `index.php`
- [Brand guide](https://github.com/elementary/website/blob/master/brand.php): `brand.php`
- [Open source](https://github.com/elementary/website/blob/master/open-source.php): `open-source.php`
- [Community pages](https://github.com/elementary/website/blob/master/get-involved.php): `get-involved.php`
- [Support pages](https://github.com/elementary/website/blob/master/support.php): `support.php`
- [Not found page](https://github.com/elementary/website/blob/master/404.php): `404.php`

### Rendering and configuration

- [Page setup](https://github.com/elementary/website/blob/master/_backend/preload.php): `_backend/preload.php`
- [Backend bootstrap](https://github.com/elementary/website/blob/master/_backend/bootstrap.php): `_backend/bootstrap.php`
- [Configuration loader](https://github.com/elementary/website/blob/master/_backend/config.loader.php): `_backend/config.loader.php`
- [Shared templates](https://github.com/elementary/website/blob/master/_templates/header.php): `_templates/header.php`
- [Page footer](https://github.com/elementary/website/blob/master/_templates/footer.php): `_templates/footer.php`
- [Response logging](https://github.com/elementary/website/blob/master/_backend/log-echo.php): `_backend/log-echo.php`

### Release and payment

- [Download link](https://github.com/elementary/website/blob/master/_backend/download.php): `_backend/download.php`
- [Payment cookies](https://github.com/elementary/website/blob/master/_backend/os-payment.php): `_backend/os-payment.php`
- [Checkout endpoint](https://github.com/elementary/website/blob/master/api/create-checkout-session.php): `api/create-checkout-session.php`

### Localization

- [Localization runtime](https://github.com/elementary/website/blob/master/_backend/Lib/L10n.php): `_backend/Lib/L10n.php`
- [Text extraction](https://github.com/elementary/website/blob/master/_backend/Console/Extract.php): `_backend/Console/Extract.php`
- [Translation updates](https://github.com/elementary/website/blob/master/_backend/Console/Translation.php): `_backend/Console/Translation.php`

### Cache support

- [Cache facade](https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Cache.php): `_backend/Lib/Cache/Cache.php`
- [Store interface](https://github.com/elementary/website/blob/master/_backend/Lib/Cache/StoreInterface.php): `_backend/Lib/Cache/StoreInterface.php`
- [Base store](https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Store/BaseStore.php): `_backend/Lib/Cache/Store/BaseStore.php`
- [File store](https://github.com/elementary/website/blob/master/_backend/Lib/Cache/Store/FileStore.php): `_backend/Lib/Cache/Store/FileStore.php`

### Other components

- **Site visitor**
- **Stripe checkout**

## Connections

- Site visitor → Request router: requests pages
- Request router → Homepage: routes root (evidence: `router.php`)
- Request router → Not found page: routes missing (evidence: `router.php`)
- Homepage → Download link: loads link (evidence: `index.php`)
- Homepage → Page setup: loads setup (evidence: `index.php`)
- Homepage → Payment cookies: loads payment logic (evidence: `index.php`)
- Page setup → Backend bootstrap: loads bootstrap (evidence: `_backend/preload.php`)
- Backend bootstrap → Configuration loader: loads config (evidence: `_backend/bootstrap.php`)
- Page setup → Response logging: loads logging (evidence: `_backend/preload.php`)
- Homepage → Shared templates: renders shared header
- Homepage → Page footer: renders shared footer
- Shared templates → Localization runtime: uses translations (evidence: `_templates/header.php`)
- Translation updates → Text extraction: runs extraction (evidence: `_backend/Console/Translation.php`)
- Translation updates → Localization runtime: loads language data (evidence: `_backend/Console/Translation.php`)
- Text extraction → Localization runtime: extracts translated text (evidence: `_backend/Console/Extract.php`)
- Payment cookies → Backend bootstrap: loads bootstrap (evidence: `_backend/os-payment.php`)
- Payment cookies → Response logging: loads logging (evidence: `_backend/os-payment.php`)
- Checkout endpoint → Backend bootstrap: loads bootstrap (evidence: `api/create-checkout-session.php`)
- Checkout endpoint → Page setup: loads site setup (evidence: `api/create-checkout-session.php`)
- Checkout endpoint → Stripe checkout: creates session (evidence: `api/create-checkout-session.php`)
- Cache facade → Store interface: uses contract (evidence: `_backend/Lib/Cache/Cache.php`)
- File store → Store interface: implements contract (evidence: `_backend/Lib/Cache/Store/FileStore.php`)
- File store → Base store: extends store (evidence: `_backend/Lib/Cache/Store/FileStore.php`)
- File store → Cache facade: references facade (evidence: `_backend/Lib/Cache/Store/FileStore.php`)
