Relayer is a convention-first PHP full-stack framework inspired by the Next.js App Router. The directory tree is the URL space, and every route is written not as a controller but as a component that returns an element tree. Routing, APIs, server actions, authentication, caching and the database are wired into a single boot entry. No build step.
<?php
use Polidog\Relayer\Router\Component\PageContext;
use Polidog\UsePhp\Html\H;
return function (PageContext $ctx): Closure {
$ctx->metadata(['title' => 'Hello']);
return fn () => (
<main className="p-8">
<h1>Hello, {$ctx->params['name']}</h1>
</main>
);
};That closure is the page component. Save the file and /hello/world responds — nothing to register, nothing to configure.
That is this site’s own src/Pages. There is no routing configuration file.
A request passes through four places, and no others: shared work in the middleware, rendering in the page, cache headers, then the document that goes out.
This documentation site is itself written in Relayer, and the source is public. github.com/polidog/relayer-docs
Reading the conventions takes longerthan writing the first page.