Glossary

Who this is for

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.

What you will learn

  • Moonlight vocabulary: service, action, switch, envelope
  • DeskFlow-specific names: Northwind Studio, task / member / project
  • How returnCode relates to HTTP status codes

Before you start

Optional — no setup required. For context, skim Moonlight overview first.

How it works

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.

TermMeaning
ActionA method on a service invoked by name in JSON ("action": "list"listAction)
AppRealmThe booted application container returned by app() / realm()
DeskFlowThe canonical docs example — a task board API for Northwind Studio
EnvelopeJSON response shape: returnCode, returnMessage, returnData
GenericServiceBase class that provides CRUD actions for one database table
MoonlightPionia’s { service, action } dispatch model over versioned /api/v1/
PormPionia’s fluent SQL layer (table(), where(), joins) — lives in your app
returnCodeBusiness outcome in the JSON body (0 = success); distinct from HTTP status
ServicePHP class holding business logic; registered on a switch
SwitchVersioned API entry (e.g. MainSwitch for /api/v1/)

DeskFlow services

ServiceExample actionPurpose
tasklist, createTasks on the team board
memberlogin, profileTeam authentication
projectlistClient 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" }

Common mistakes

  • Confusing returnCode with HTTP statusreturnCode: 0 can arrive with HTTP 200; errors may use 422 or 401 with a non-zero returnCode.
  • Calling it a “route” — Moonlight uses one POST URL per version; service and action select the handler.
  • Uppercase JSON keys — v3 expects lowercase service and action.

What’s next

Building your API

How terms connect in practice.

Moonlight overview

Full request flow diagram.

API tutorial

Use the vocabulary hands-on.