SaaS.Dev

Give my team an admin

Say "give my team an admin" and every Noun gets a list, a record page and two forms, derived from its definition with nothing else to write.

Your team reads and changes records through screens derived from your Nouns and Verbs, with nothing to write beyond the definition. Each Noun gets one list, one record page and two forms.

Before it runs
NeedsAt least one Noun, such as Lease in leaseclock.com
Who says yesNo one: reading the definition changes nothing
You leave the chatNever

What you get

For the Lease Noun of leaseclock.com, the definition alone derives these parts. Each part comes from one named rule.

What you get for LeaseRule
1list of leases at the key leases, titled Leaseskey, labels
4screens: the list, a record page, a create form and an edit formscreens
7list columns, residentName to status, in declared orderlist-columns
1search box over every leaselist-search
1record page titled by residentName, such as Maya Ortizrepresentation
4one-line text boxes: residentName, residentEmail, listingUrl and statuscontrol-text
2date pickers, for startsOn and endsOncontrol-date
1number box, for monthlyRentcontrol-number
1multi-line box for notes, full width on the record pagecontrol-long-text, wide-fields
1formatted terms block on the record page, with no inputcontrol-json
1documents field on the record page, left out of both formsform-omits-arrays
4required inputs that refuse an empty value: residentName, startsOn, endsOn, monthlyRentrequired-input
1picker that searches Property records by namereference-forward
2buttons, Renew and Terminate, on each row, the record page and the edit formverb-action
1notice after a Verb completes, then the record reloadedverb-result
1reason a refused Verb gives, with the screen left as it wasrefusal-message

Property gets the same four screens, and its units property takes a number box. Every rule lists the edge cases behind each row.

Your agent does

Your agent reads the definition, and the rules turn it into screens. No call writes anything.

Give my team an admin.
Give my team screens to edit leases.
Let my ops person fix a lease without the API.
{
  "api": "https://api.sb/leaseclock.com",
  "$type": "Noun",
  "nouns": [
    { "$id": "https://api.sb/leaseclock.com/nouns/noun_1", "$type": "Noun", "name": "Property" },
    { "$id": "https://api.sb/leaseclock.com/nouns/noun_2", "$type": "Noun", "name": "Lease" }
  ],
  "meta": { "limit": 20 }
}
  1. Your agent reads every Noun with Noun.list, a read each Interface serves.
  2. It applies the rules to each property, each reference and each Verb.
  3. It shows you the screens for each Noun, row by row, as under What you get.

Every button runs its Verb, and the Verb's rules decide. A second Renew on a renewed lease is refused, and the record page shows why.

PlanServing the screens to your team

In the design, your agent adds one App folder of kind admin, and the screens serve at leaseclock.com/admin.

apps/admin/app.mdx
---
kind: admin
nouns: [Property, Lease]
---

Each teammate gets in through Give a teammate access, holding the admin Access Level. A teammate opens the same screens your agent showed you.

Change it

Each ask changes the definition, and the screens follow it.

SayThe definition gainsThe screens show
"Add a pets-allowed switch to every lease."petsAllowed?: boolean on LeaseA switch in both forms and yes or no on the record page, by control-boolean. The list already holds 7 columns.
"Track the deposit on each lease."deposit: number on LeaseA required number box in both forms, and the amount on the record page.
"Name each lease by its unit."name: string on Lease, such as 14 Elm, unit 3The record page titled by name, which outranks residentName.

PlanOverrides

In the design, an override changes one part without touching the definition. It sets a Noun's icon, the field that names a record or a hidden field.

Under the hood

PartEntries
NounsApp, Noun, Verb, Access Level, Human
CallsNoun.list; Human.invite through Give a teammate access
RulesEach rule by id on App rules
EventsHuman.invited, when a teammate is invited

Contents