Examples
Each example is a complete small App. Copy it into the project from the Quickstart and run it with one command. Its page shows everything the App prints, and the lines behind each thing it does.
Support tickets with an SLACustomers open tickets, agents resolve them, and a ticket nobody resolves within four hours turns overdue by itself. Shows: people who see only what they opened, an hourly check, a count for each queue.
Employee onboarding checklistsA person who joins gets a checklist of tasks, and the checklist closes when the last task is finished. Shows: an App that imports another, a count that goes up as tasks are finished, a daily reminder.
Sales pipeline with stagesDeals move from lead to won or lost, and each stage allows only the next sensible moves. Shows: a move the App refuses, a daily check for stale deals, wins counted for each rep by month.
Room bookings that refuse a clashPeople book a room for a time slot, and the App refuses a slot that overlaps a booking of that room. Shows: a check before each save, a room that finds its own bookings, a slot freed when a booking is canceled.
What every example has in common
Section titled “What every example has in common”- The App is 100 to 120 lines long, and its page shows all of it.
- One command,
PYN_ENV=local npx tsx run.ts, runs the App on SQLite. - The script,
run.ts, adds the people it needs, and makes every call to the App as one of them. - The clock starts on 1 January 2020 and moves only when the script moves it.
Recipes
Section titled “Recipes”Each recipe answers one question on one page, with a few lines from one of these Apps or from the Tutorial’s App, and what they print.
| Recipe | What it uses |
|---|---|
| Do something after a write commits | An Event and a Listener |
| Send a reminder when something sits too long | A schedule kept to one state |
| Let people see only their own items | A Role on a Template, and a Grant |
| Move an item to a new state at a deadline | A due time, an hourly schedule, a transition |
| Roll a number up to a parent | A parent Listener |
| Count things month by month | A Metric, read with one query for each month |
To build an App from nothing, one step at a time, follow the Tutorial. To keep an App running as a server, read Run it as a server.

