phlo/tech

Full-stack web framework with its own .phlo language: express backend logic, routing, HTML views, scoped CSS and single-page behavior in one concise file format that transpiles to plain PHP, CSS and JS.

Maintainers

Package info

github.com/q-ainl/phlo

pkg:composer/phlo/tech

Transparency log

Statistics

Installs: 5

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0 2026-07-03 18:54 UTC

This package is auto-updated.

Last update: 2026-07-03 22:08:13 UTC


README

A transpile-to-PHP web framework with its own .phlo language, a built-in SPA runtime, the Phlo Control Center (built-in dev panel), and first-class introspection for AI agents. Zero runtime dependencies.

prop title = 'Hello'

route GET => $this->home

method home => view($this->main, 'Home')

view main:
<h1>$this->title</h1>
<p>{{ date('Y') }}</p>

That file transpiles to a PHP class, a route, an HTML page, and (with a <style>/<script> block) a CSS and JS bundle. One .phlo file is one class; the build writes plain PHP you can read, lint and source-map back to the line you wrote.

Why Phlo

Phlo is opinionated on purpose. The bets it makes:

  • Transpile, don't interpret. .phlo is transformed to readable PHP at build time. Errors at runtime map back to your .phlo line, not to generated soup.
  • One closed loop. Source to build to lint to sourcemap to error page to Control Center to CLI introspection. Every layer points back at the source.
  • Small and dependency-free. The engine ships its own CSS transpiler, JS minifier and SPA runtime. No vendor tree to audit. The bet is proven server tech: PHP still runs more than 70% of the web (W3Techs), and Phlo builds on that instead of on a JavaScript build chain.
  • Agent-first. docs/SKILL.md is a complete language reference written for AI agents, and the reflect:: CLI exposes routes, views, the parsed AST and dependency graphs as JSON. An agent can build, introspect and fix a Phlo app without guessing.
  • Convention over configuration. File name becomes class name. Named phlo_app() arguments become constants. data/app.json stays tiny.

If you want a large ecosystem, a package for everything, and a team-standard hiring pool, reach for Laravel or Symfony. If you want a small, legible full-stack engine that one person (or one agent) can hold in their head, Phlo is for you.

One platform, four layers

The four Phlo layers: language, application, server, operations

The language is the bottom layer of one continuous system; each layer is built with the previous one, in the same syntax:

  1. Language: .phlo source transpiles to readable PHP, CSS and JS.
  2. Application: backend resources (ORM, sessions, security, AI) plus the phlo.js SPA engine and the apply() protocol; Phlo CMS adds a schema-driven CRUD and admin layer on top.
  3. Server: production on FrankenPHP in worker mode, with the Phlo Daemon for warm workers, realtime and scheduled tasks.
  4. Operations: the Phlo Dashboard manages apps and servers as a fleet: uptime, domains, databases, notifications.

The full story, guide, tutorial and reference live at phlo.tech; machine-readable docs at phlo.tech/llms.txt.

Quick start

Requirements: PHP >= 8.3. Optional extensions per resource (pdo_mysql, sodium, gd).

git clone https://github.com/q-ainl/phlo.git
php phlo/install.php /path/to/my-app

The installer asks for a name, host, purpose and which resources to enable, writes a buildable skeleton (app.phlo, www/app.php, data/app.json, data/app.md), and runs the build so the app is verified before you start.

Serve it with FrankenPHP, Docker, PHP-FPM or, for a quick look:

php /path/to/my-app/www/app.php reflect::context   # inspect without a server
php -S 127.0.0.1:80 /path/to/my-app/www/app.php   # then open http://localhost

See docs/deploy.md for FrankenPHP (incl. worker mode), Docker and nginx setups.

The development loop

With build: true set in www/app.php, the app rebuilds changed .phlo files on request. Two CLI namespaces drive everything:

php www/app.php build::run      # transpile changed sources, returns changed files
php www/app.php build::lint     # parse-check the generated PHP, [] means clean
php www/app.php reflect::context   # app identity, routes, views, recent errors
php www/app.php reflect::routes    # full route map

With build and debug on (dev only), the Phlo Control Center auto-mounts at /phlo and offers home, config, source, build, release and error views. Move it with the optional control: key or set control: false to disable.

The Phlo Control Center source view: every .phlo file highlighted and searchable, one click from build, release and errors

Documentation

Editor support

Syntax highlighting under editor/: a VS Code extension (TextMate grammar, reusable in Sublime/JetBrains/Zed) and a Notepad++ user-defined language with a function-list parser.

License

MIT. See LICENSE.