17 topics, 12 example apps

The guide to writing an app

For a person or a model about to write an app; a model gets the same text from oad guide.

What a person or a model needs to write an Open App Definition app without the specification at hand: topics short enough to read on their own, whose every example is checked against the reference implementation.

It is written for a reader who has never seen OAD and has nothing else at hand. A reader with only the first topic should be able to write a small app that passes oad validate at the first or second try; one who also reads two or three more should be able to write an app with records, a form, a flow and a permission. It is the same text a model reads through oad author before it writes an app, and it is in full in llms-full.txt. The text on these pages is the repository’s, from packages/authoring/guide/, with the reference parts generated from the core catalog.

Where the guide is short, the specification says everything.

  1. Writing your first app

    What an app is, the smallest complete app, a list you can add to and change, the fields of a record, the controls and list functions a first app uses, the examples to start from, how to work, and the mistakes every newcomer makes; enough for a first app.

  2. State

    Stored, derived and sourced values, their types, where each value lives (scope) and who sees it.

  3. Expressions

    The expression language: where the leading = goes, operators, functions, dates and times, list macros, and the habits from other languages that break here.

  4. Actions and steps

    Actions with input, allow, require and confirm, every step kind, handling failures, and doing an outside effect once.

  5. Views

    The visual surface: views, nodes, props, bindings, handlers, view state, forms, navigation and main sections, and the card an app of one view is drawn as.

  6. Controls

    Every core control with its props, events and slots, generated from the core catalog, with advice on which to use.

  7. Capabilities and grants

    Using the outside world through a capability contract, asking for permission with a grant request, when each request is asked, and every core capability with its operations, generated from the core catalog.

  8. Sample data

    How a sample document answers for a service so an app runs without one, and how to write it.

  9. Mistakes and their fixes

    The mistakes nothing reports, then the diagnostics a writer meets most, each with its cause and its fix.

  10. Rules

    Reacting to changes, events, time and the app opening: triggers, edges and timers.

  11. Flows

    State machines for processes with named stages: singleton and collection flows, transitions, guards and timers.

  12. Code modules

    Logic that expressions cannot say, or would have to say in several places, written once as a small sandboxed function: when to write one and when not, how an action calls it, and its limits and failures.

  13. People and roles

    Several people on one app: shared state, ids and names, roles, only the owner may, who uses the app, and who may act.

  14. Agents

    What an app gives an agent: tools, resources, events and instructions, and how to keep what is private off the agent surface.

  15. Parts: apps inside apps

    Including a whole app inside another, for a piece several apps share or one that is useful alone and inside a larger app (most apps need none): exports, uses.definitions, parts, and how to work with both apps as drafts.

  16. Changing an app

    Editing an app in small steps with patches, the changes that need a person's yes, history, versions, and what happens to the data of people who use it.

  17. Texts in several languages

    An app's own texts in several languages: the localization table, keys, blanks and forms, t() in expressions and =t('key') in fixed places, adding a language or a key, right to left, looking as a reader of a language, and what each check of it means.

  18. Example apps

    The 12 small apps the topics quote, each a whole definition.