Nothing heavy. Nothing hidden.

The ideas behind PhlatPage.

PhlatPage is built on a few ideas that hold everywhere: pages are folders, content is JSON, and every save is a git commit. Learn them once and the rest of the system follows.

Content

Pages, files and history: what a site is made of and how you find it.

Everything is a page

A blog post, a gallery item and the dash are the same thing: a page in a tree, pointing at a view. There is no separate concept of a route, a content type or a dash URL. The dash is an addon mounted as ordinary pages, so learning pages covers the whole system.

Content is files

A page is a folder. Its content is JSON next to the files it uses, so you can cd into a page, edit _data.json in any editor, or read the git log of the folder. What is on disk is what is served.

site/pages/
  about/
    _index.json     # uuid, view, metadata
    _data.json      # title, body, whatever fields you add

Every save is a commit

Pages live in a git repository of their own, and every write is a commit, whether it comes from the dash, the CLI or your own code. Editors get history, restore and sync to a remote without touching git. Developers get a normal repository to branch, diff and deploy.

Views bundle what a page needs

A view holds a template, a controller, a router and a field schema in one folder. Define "article" once and every article page gets the same layout, request handling and fields. A view can also bind a PHP class, so logic that belongs to the page lives on the page.

A query language over a SQLite index

A SQLite registry maps pages to paths, views and fields, so a query does not walk the filesystem. It filters, sorts, pages and runs ranked full-text search. The registry is a cache: delete it and one command rebuilds it from the pages on disk.

$app->find('view=docs, sort=-updated, limit=3');
  • Deploy

    Keep per-deployment config in env.json, ship releases with Deployer, and back up what matters.

  • UI

    Plain, neutral elements and the components built on them, as Latte partials.

  • Reference

    The CLI, configuration and the full deployment docs.

Delivery

How a page reaches a visitor, and who is allowed to see it.

Hypermedia, not an API

Every route returns HTML, and HTMX drives each interaction over that same HTML. There is no JSON layer, no client-side router and no state to keep in sync. Any block of a page can be fetched on its own at a :blockname URL and cached.

Editors can publish safely

Four independent settings decide whether a page is live, listed, open to everyone or locked against change. Roles and dot-notation permissions guard routes and templates. Editors work on autosaved drafts, and visitors never see a page until it is published.

Images without a pipeline

Resize, crop, filter and draw text or shapes over an image with a short option string. Variants are generated on the first request and served as static files afterward. Files of an unpublished or gated page stay private and are served through PHP behind the page's access check.

{$page->cover->src('w=800,h=400,crop')}
{$page->cover->srcset(['thumbnail', 'card', 'hero'])}

Extending

Start from what ships, then replace it one piece at a time.

Defaults to start, code to finish

PhlatPage ships a dash, login and roles, ui elements, icons, fonts and a render template for every field. Put them together and a prototype or a small web app runs without custom CSS or routes. When the project grows, replace one piece at a time with your own views, routers, fieldtypes and markup, until the whole site is custom or only the parts that need to be.

{* a working page from shipped parts *}
<h1>{$page->title}</h1>
{$page->body|render}
{ui list, items: $page->children() /}

{* the same page, fully yours *}
{* site/views/@ui/list.latte replaces the shipped list *}

Override anything, copy nothing

Everything in phlat/ is a default. A file at the same path under site/ replaces it, and an override can include the original and add to it. Addons add views, fields, routes and services without touching framework code.

A CLI and a simple deploy

Create users, scaffold views and pages, check and repair the registry, back up and restore from the terminal. The project ships a Deployer config. State is two folders to back up.

Nothing heavy. Nothing hidden.