Architecture overview
Corex is a monorepo of one theme, the core plugins, and optional add-ons. The repo is the
source; a WordPress install loads it through wp-content/ links.
Layout
Section titled “Layout”theme/ # the skin — FSE templates/parts/patterns/tokensplugins/ corex-core # the engine: Boot, Container, Config, Hooks, data layer, middleware corex-blocks # block engine: discovery, conditional assets, connectors corex-forms # forms: schema, validation, secured submit, the form block corex-config # branding + the admin settings UIaddons/ corex-ui # the corex/* block library + section patterns corex-email # Corex Mail corex-newsletter · corex-careers · corex-captcha · corex-bookings corex-kit-company # a site kit (blueprint + templates)packages/ cli # wp corex make:* generators build-tools # @wordpress/scripts build conventionsdocs-app/ # this documentation siteThe principles (non-negotiable)
Section titled “The principles (non-negotiable)”- The theme is a skin, not a skeleton — presentation only.
- Plugins boot themselves —
corex-coreself-inits onplugins_loaded. - Thin controllers, fat services — repositories are the only data callers.
- Everything is injected — through the PSR-11 container.
- Design tokens are runtime —
theme.json→ CSS vars →brand.json. - Assets load conditionally — a block’s CSS/JS loads only where it renders.
- Security is declarative — routes declare middleware; it applies automatically.
- RTL is first-class — logical CSS properties by default.
- No optional dependency is a hard dependency — ACF/Woo/Polylang behind interfaces.
- The spec is the source of truth — code is generated from the spec.
The request path
Section titled “The request path”REST/AJAX → Controller (thin) → Service (logic) → Repository (data) → Model (shape) └ middleware: nonce → sanitize → throttle (declared, automatic)Blocks as components
Section titled “Blocks as components”Every section of a site is built from Corex blocks — dynamic, server-rendered, token-only.
There is no hardcoded section markup; a block’s PHP renderer produces escaped output and
the editor previews it with <ServerSideRender>.