Sign in

Running locally & testing

Updated Jul 3, 2026

Devani needs nothing but PHP to develop against. No Node, no build watcher, no container, no database server.

Run it

unzip devani-cms-2.x.y.zip -d devani
cd devani
php -S localhost:8000

Open http://localhost:8000/ — a fresh tree redirects you to the setup wizard. For pure code reading you don't even need to run setup; for feature work, complete it so you have content to edit. PHP's built-in server is fine for development; nginx + PHP-FPM (what the installer configures) is for production.

Requirements

PHP 8.x with the usual extensions: curl, mbstring, xml/dom, zip. (The DOM extension matters — the content sanitizer is built on DOMDocument.)

Testing

  • Lint everything you touch: php -l path/to/file.php; for editor JS, node --check devani/page-editor.js.
  • The sanitizer suite: php tests/sanitizer-test.php — dozens of assertions guarding the save pipeline's invariants (artifacts stripped, content modules preserved, idempotent saves, UTF-8 integrity). Mandatory after touching the editor, the sanitizer, or any module markup. It lives outside devani/ so it never ships in a release.
  • Exercise the real flow. Devani has no build step, so the loop is fast: edit file → reload page. Test the actual behavior you changed — save a page through the editor, run a test-mode checkout, call your new MCP tool — not just the lint.

Conventions to match

  • Plain PHP, plain JS — no frameworks, no transpiling. Match the surrounding file's style.
  • Path-portable: never hardcode absolute paths; resolve via __DIR__/dirname().
  • Comments explain why, and cluster where the code is subtle (the sanitizer and JsonStore are good examples of the house style).
  • Anything that writes content: snapshot first, sanitize, keep index tables in sync — use the existing helpers rather than writing files directly.
Was this helpful?

Related articles

Powered by Subido