Title here
Summary here
You are reading DeskFlow docs and hit an unfamiliar term — switch, envelope, Porm. Use this page as a quick reference while following the API tutorial.
task / member / projectreturnCode relates to HTTP status codesOptional — no setup required. For context, skim Moonlight overview first.
Pionia docs reuse the same terms everywhere. DeskFlow is the canonical example app; when you see alex@northwind.studio or port 8000, that refers to the fictional Northwind Studio team running their local API.
| Term | Meaning |
|---|---|
| Action | A method on a service invoked by name in JSON ("action": "list" → listAction) |
| AppRealm | The booted application container returned by app() / realm() |
| DeskFlow | The canonical docs example — a task board API for Northwind Studio |
| Envelope | JSON response shape: returnCode, returnMessage, returnData |
| GenericService | Base class that provides CRUD actions for one database table |
| Moonlight | Pionia’s { service, action } dispatch model over versioned /api/v1/ |
| Porm | Pionia’s fluent SQL layer (table(), where(), joins) — lives in your app |
| returnCode | Business outcome in the JSON body (0 = success); distinct from HTTP status |
| Service | PHP class holding business logic; registered on a switch |
| Switch | Versioned API entry (e.g. MainSwitch for /api/v1/) |
| Service | Example action | Purpose |
|---|---|---|
task | list, create | Tasks on the team board |
member | login, profile | Team authentication |
project | list | Client projects grouping tasks |
Example request Alex sends from the React board:
POST http://127.0.0.1:8000/api/v1/
{ "service": "task", "action": "list", "status": "open" }returnCode with HTTP status — returnCode: 0 can arrive with HTTP 200; errors may use 422 or 401 with a non-zero returnCode.service and action select the handler.service and action.How terms connect in practice.
Full request flow diagram.
Use the vocabulary hands-on.