Xonry
On this page

In development. Not released. Nothing to download or buy.

How it works

How Xonry builds a page

This page follows one request, for the address / of a small demo project, from the folder on disk to the HTML in the browser. Every listing is a real file. Every picture is the real result.

Status. Xonry is in development and not released. You cannot install it yet.

1. The folder

A project is a folder. These are all the files of the demo project.

demo-site/the whole project
demo-site/
  index.php                the front controller, the same file in every project
  xonry.json               settings: the language of the pages
  wireframes.php           the pages and their sections
  head.php                 what goes inside <head>
  foot.php                 scripts before </body>
  css/site.css
  js/xon.min.js
  js/app.js
  layers/
    navigation/navigation.php   navigation.css
    hero/hero.php               hero.css
    parts/parts.php             parts.css
    counter/counter.php         counter.css
    files/files.php             files.css
    footer/footer.php           footer.css
    about/about.php             about.css

index.php is the front controller. It is the same file in every project and holds nothing about this one. Everything particular to the site is in the files around it.

2. The request

The browser asks for /. Xonry takes the first part of the path as the route. Here it is empty, so Xonry looks for the page marked 'default' => true. An address such as /about gives the route about. A route with no entry gets a 404 answer, drawn with the project's own page named 404 when it has one.

3. The map: wireframes.php

wireframes.phplines 1 to 7 and the start page
<?php
# SECURE -----------------
if (!$home) exit;

# WIREFRAMES ------------------- edit in the Xonry dashboard (Wireframes) or by hand;
# one $_WIREFRAMES[route] per page: its sections in order, then the page settings.
# A name starting with "_" is a layout; '@page' marks where the page's sections go.
...$_WIREFRAMES['index'] = array(
	array(
		'filename' => 'hero',
		'tag' => 'section',
		'id' => 'top',
		'class' => 'hero',
		'hasContainer' => 1,
	),
	array(
		'filename' => 'parts',
		'tag' => 'section',
		'id' => 'parts',
		'class' => 'parts',
		'hasContainer' => 1,
	),
... counter and files: two more sections of the same shape ...	'title' => 'Home',
	'default' => true,
);

Each numbered item is one section of the page, in the order it appears. Each has five fields. filename is the section file. tag, id and class describe the element the server wraps around it. hasContainer asks for an inner container: 1 for container, 2 for container-fluid, 0 for none.

The named items after the sections are page settings. 'default' => true makes this the start page.

The file is ordinary PHP that assigns arrays. The engine runs it. Tools that only need to read it do not run it: they read it as data. The API refuses to write a wireframes.php that holds code (the answer is 409). OnceBuilder Studio shows a file it cannot model exactly as code, with a reason, and does not edit it.

4. The layout

wireframes.php_layout
$_WIREFRAMES['_layout'] = array(
	array(
		'filename' => 'navigation',
		'tag' => 'header',
		'id' => '',
		'class' => 'site-header',
		'hasContainer' => 1,
	),
	array(
		'filename' => '@page',
	),
	array(
		'filename' => 'footer',
		'tag' => 'footer',
		'id' => '',
		'class' => 'site-footer',
		'hasContainer' => 1,
	),
);

A name that starts with an underscore is a layout. A layout is never a page of its own. When _layout exists, every page is rendered inside it. The item 'filename' => '@page' marks the place for the page's own sections.

For the address / the result is six sections: navigation, then hero, parts, counter and files from the page, then footer. A page can opt out with 'layout' => false, or name another layout, for example 'layout' => '_plain'. Layouts do not nest.

Xonry dashboard, Layout The layout editor of the Xonry dashboard. Heading: Layout _layout, used by index, about. Three rows: 1 navigation with the tag header, 2 @page, the page's own sections render here, 3 footer with the tag footer.The layout editor of the Xonry dashboard. Heading: Layout _layout, used by index, about. Three rows: 1 navigation with the tag header, 2 @page, the page's own sections render here, 3 footer with the tag footer.
The same layout in the dashboard. Demo project.Open full size

5. The sections

layers/hero/hero.phpthe whole file
<p class="eyebrow">layers/hero/hero.php</p>
<h1 class="title">A page is a list of sections.</h1>
<p class="lead">This heading is one file. Its place on the page is one entry in <code>wireframes.php</code>.</p>
<a class="button" href="/about">About this demo</a>

A section is a file of HTML. Xonry looks for layers/hero/hero.php when the folder layers/hero exists, and for layers/hero.php when it does not. A hero.css beside it is added once to a style block in the head of every page that uses the section. A hero.js is added to a script block before the end of the body.

layers/files/files.phpa PHP loop
<?php $files = array('wireframes.php', 'head.php', 'foot.php', 'layers/hero/hero.php', 'layers/counter/counter.php'); ?>
<h2 class="heading">This list comes from a PHP loop</h2>
<ul class="file-list">
<?php foreach ($files as $file) { ?>
	<li><code><?= htmlspecialchars($file) ?></code></li>
<?php } ?>
</ul>

PHP is allowed anywhere in a section. This one builds its list with a loop.

6. What the server sends

The answer to GET /cut after the hero
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo site</title>
<link rel="stylesheet" href="/css/site.css">

<meta content="(per-session value removed)" name="csrf_token">
  ... the styles of the six sections ...</style>
</head>
<body>
			<header class="site-header">
				<div class='container'>
					<nav class="nav" aria-label="Main">
						<a class="brand" href="/">Demo site</a>
						<ul class="nav-links">
							<li><a href="/">Home</a></li>
							<li><a href="/about">About</a></li>
						</ul>
					</nav>
					
				</div>
			</header>
			<section id="top" class="hero">
				<div class='container'>
					<p class="eyebrow">layers/hero/hero.php</p>
					<h1 class="title">A page is a list of sections.</h1>
					<p class="lead">This heading is one file. Its place on the page is one entry in <code>wireframes.php</code>.</p>
					<a class="button" href="/about">About this demo</a>
					
				</div>
			</section>

This is the answer, cut after its first sections. Around each section is the wrapper the map asked for. The page is whole when it arrives: nothing on it waits for a script.

demo-site, rendered by Xonry The whole demo page from top to bottom: navigation; a heading, A page is a list of sections; three columns about wireframes.php, layers and _layout; a counter with a button, Add one; a list of five file names; and a footer reading Demo site, rendered by PHP 8.3.
The same answer, drawn by the browser. Six wrappers, six files. Demo project.Open full size

Limit. The styles and scripts of the sections are printed inside the page. A site rendered this way cannot use a Content-Security-Policy that forbids inline code.

Limit. Another: the engine has no page title or description per page. The <head> comes from head.php, which the template fills from one site-wide file.

7. XON in the browser

layers/counter/counter.php
<h2 class="heading">A section with XON attributes</h2>
<p class="count">Clicked <strong id="count" data-text="counter.clicks">0</strong> times.</p>
<button type="button" class="button" id="add" data-on-click="addOne">Add one</button>
<p class="note">The markup names a store value and a function. The function itself is in <code>js/app.js</code>.</p>
js/app.js
// The counter section (layers/counter/counter.php) reads this store and calls this function.
xon.data('counter', { clicks: 0 });
function addOne() { xon.data('counter').clicks++; }
xon.use(addOne);
foot.php
<script src="/js/xon.min.js" defer></script>
<script src="/js/app.js" defer></script>

data-text="counter.clicks" shows a value from a store named counter and keeps it up to date. data-on-click="addOne" calls a function when the button is clicked. The script creates the store, defines the function, and offers it to the page with xon.use. Markup can call only what the script has offered.

demo-site, the counter section Part of the demo page: the heading A section with XON attributes, the sentence Clicked 3 times, a button labelled Add one, and a line saying the function itself is in js/app.js.
The section after three clicks. Demo project.Open full size

XON is a separate, released library. Xonry does not add it for you: the project loads it in foot.php. XON at xonjs.com (opens another website)

8. The same files in the dashboard

Xonry dashboard, Wireframes and Pages The sections table of the Xonry dashboard screen Wireframes and Pages: four numbered rows, hero, parts, counter and files, each with a tag, an id, a class and a container setting, and buttons to save, move, edit and remove the row.The sections table of the Xonry dashboard screen Wireframes and Pages: four numbered rows, hero, parts, counter and files, each with a tag, an id, a class and a container setting, and buttons to save, move, edit and remove the row.
The sections table of the Wireframes screen, demo project, 3 December 2026.Open full size

The Wireframes screen shows the map as a list of pages and a table of sections. Rows can be dragged or moved with the arrows; edited rows are written with Save. The file is saved in the project folder and the previous version is kept as wireframes.php.bak. The dashboard writes the whole file again each time, so comments in it are lost.

Xonry dashboard, Layers files The table of the Layers files screen of the Xonry dashboard: seven section files, parts.php, about.php, hero.php, files.php, counter.php, footer.php and navigation.php, each with its path under layers and the buttons Edit and Delete.
The section files of the demo project. The dashboard calls a section file a layer.Open full size

9. The same files over the API

GET /xonry/api/v1/projects/demo-site/pagesa request and its answer
GET /xonry/api/v1/projects/demo-site/pages
(dashboard session; a token would send: Authorization: Bearer xon_pat_...)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
ETag: "929c9059210bdad0ab9f1d790ebc86a1b1ea10e1"
Cache-Control: no-store
X-Request-Id: 6e255b395456867f
RateLimit-Limit: 600
RateLimit-Remaining: 599

{
  "data": [
    {
      "route": "about",
      "title": "",
      "default": true,
      "sections": [],
      "layout": "",
      "renderLayout": "",
      "layoutMissing": false,
      "kind": "page"
    }
  ],
  "page": {
    "limit": 25,
    "next": null,
    "sort": null
  }
}

The project is named in every address (here it is demo-site; the listing is from the working install with the name replaced). The answer carries an ETag: for pages, the sha1 of wireframes.php. To change a page a client sends that value back in If-Match. If the file changed in between, the answer is 412 and nothing is written. Without If-Match the answer is 428.

Without a token401
GET /xonry/api/v1/projects/demo-site/pages

HTTP/1.1 401 Unauthorized

{
  "error": {
    "code": "unauthenticated",
    "message": "Send Authorization: Bearer <token> (or use the dashboard session)",
    "field": null
  },
  "request_id": "29b6f8734479f716"
}

A caller is either the dashboard session or a token. A token is created on the API tokens screen with the scopes it may use, the projects it may reach and an expiry. Xonry keeps a hash of it outside the web root.

Xonry dashboard, New token The form New token in the Xonry dashboard: a name field, an expiry set to 90 days, a field for browser origins, and six scopes with checkboxes: read:content, write:content, read:data, write:data, deploy and admin, each with a short description.
Creating a token. Xonry stores a hash of it and shows the token itself once.Open full size
One entry of commands.json
{
  "name": "pages.get",
  "tool": "xonry_pages_get",
  "description": "One page or layout (ETag = revision of wireframes.php)",
  "status": "available",
  "scope": "read:content",
  ...  "project": true,
  "writes": false,
  "inputSchema": {
    "type": "object",
    "properties": {
      "project": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
        "description": "Project folder name (explicit in every call)"
      },
      "route": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      }
    },
    "required": [
      "project",
      "route"
    ],
    "additionalProperties": false
  },
  ...  "rest": {
    "method": "GET",
    "path": "/xonry/api/v1/projects/{project}/pages/{route}"
  }
}

Each command is also described for programs: its name, whether it writes, the scope it needs and the shape of its input. 18 commands are available today; 30 more are registered as planned and answer 501.

10. The same files in OnceBuilder Studio

OnceBuilder Studio OnceBuilder Studio with the demo project open. Left: the pages index, about and _layout, and a tree of the sections with their elements; the row h1 .title is selected. Middle: the rendered page with an outline around the heading. Right: read-only properties with the file layers/hero/hero.php, the mode studio and the range bytes 44 to 96.
The demo project in OnceBuilder Studio. Read-only today. Demo project, 3 December 2026.Open full size

OnceBuilder Studio is a separate program that reads the same two things, the map and the section files, and shows them as a tree and a canvas. Today it only reads. It is in development and not released. OnceBuilder Studio (opens another website)

What works and what does not