Architecture
A request, from the rewrite that sends it to index.php to the bytes that go back.
The request, traced
The exception handler is installed first because it has to work when nothing else did: it logs, sends a bare 500 if the headers have not gone out, and tells the visitor nothing else.
The layers
The dependencies point one way. Controllers use services and views, views and models build elements out of View\Html, and View\Html depends on nothing above it.
The app
One per process, booted by the site's autoloader and read back with App::current(). Constructing one does nothing, booting it twice is booting it once, and a second app is refused. The framework's deep code — the API's key and replay serial, the health report — asks the booted app, rather than every constructor on the way down carrying the site's facts.
The wire
A request is parsed defensively. An unknown method is null, not a guess at GET, and a target PHP's parser cannot read is kept as the path it is rather than answered with the home page. The security headers are typed objects, sent before anything that could fail, and every page varies on exactly the headers it was rendered from.
The signed API
An update is a gzipped tar in the body of one POST, signed with an ECDSA P-256 key of which the server holds only the public half. The signature covers the action, a timestamp, a serial the server spends before it applies anything, and a hash of the body. A call that is unsigned or signed wrongly is answered exactly as an address that does not exist.
SPA navigation
Every link is a real href. Navigation intercepts a click on one that stays on this origin, asks for the page with X-Requested-With, and swaps the answer into #content. A server running the framework answers with a fragment; a static host like this one answers with the whole page, and only its content and its title are taken — and, when the page is in another language, the parts of the shell written in the language it replaces.
Further reading
- docs/architecture.md — the request, the app, the layers, exceptions, the markup tree
- docs/security.md — the headers, the method gate, the guards, the API
- docs/frontend.md — the build, the element model, SPA navigation
- docs/collections.md — collections, and what stays an array