Why Pionia?
Who this is for
You are choosing a PHP framework for Northwind Studio’s DeskFlow — or any mobile/SPA backend — and want to know whether Moonlight’s { service, action } model beats dozens of REST controllers.
What you will learn
- What Pionia optimizes for (versioned JSON APIs, small teams)
- How DeskFlow maps to services, switches, and Porm queries
- When to pick something else (server-rendered HTML, GraphQL-first)
Before you start
No install required. For a hands-on comparison, scaffold DeskFlow in Introduction first.
How it works
Pionia targets teams shipping versioned JSON APIs without Symfony-sized boilerplate. You write services and register them on switches; clients POST { "service", "action" } to http://127.0.0.1:8000/api/v1/.
What you get
- Services, not controllers — business logic lives in
services/TaskService.php. Moonlight dispatch replaces per-route controllers. - Porm, not ORM —
table('tasks')->filter(...)->all()returns arrays; no model hydration overhead. See Database. - Real HTTP semantics — validation errors are 422, auth failures 401; the JSON body still uses
returnCode. See Requests & responses. - Versioned switches — add
v2insettings.iniwithout rewritingv1. See API versioning. - Flexible auth — pluggable backends and per-action checks. See Security.
- Optional Vite SPA — scaffold React/Vue beside the API. See Frontend integration.
- Production workers — RoadRunner, OPcache preload, maintenance mode. See Operations.
When Pionia fits
| Good fit | Less ideal |
|---|---|
| Mobile or SPA backends with stable JSON contracts | Server-rendered HTML as the primary UI |
| Small teams who want one envelope shape | GraphQL-first APIs |
| CRUD plus custom actions on the same switch | Plugin-heavy CMS-style admin |
Moonlight in one paragraph
Moonlight is the { service, action } contract: one POST target per API version, predictable JSON envelopes, and switches that map aliases to PHP classes. Pionia implements that contract with real HTTP status codes, OpenAPI export, and first-class tooling.
Common mistakes
- Expecting Laravel-style Eloquent models — Porm queries tables directly; there is no built-in ORM layer.
- Treating Moonlight as RPC over HTTP 200 only — v3 uses real status codes for auth and validation failures.
- Choosing Pionia for a Blade-only admin site — you can, but server-rendered HTML is not the sweet spot.
What’s next
DeskFlow tutorial
Build DeskFlow hands-on.
Moonlight overview
Architecture deep dive.
Upgrading from v2
Migration checklist.