portal
Write down what your organisation does. Portal runs it as a site.
A machine hire, a housing co-op, a planning office, a club: each is a handful of questions people come with, the forms that answer them, and the stages a case goes through until someone decides. In portal you write that down in YAML, in a Git repo, and the repo is the site.
What you write
A page asks a question. Each answer a visitor can give is an alternative, and what they fill in becomes a record:
# questions/hire.yaml
name: When do you need a machine?
alternatives:
- name: Book a machine
record_as: hires
action: /hire/thanks
features:
- name: Free on your days
resource:
source: { bucket: machines }
public: true
requirements:
- { name: from, label: First day, type: date }
- { name: until, label: Last day, type: date }
- { name: machine, label: The machine, type: record, of: machines }
The stages a record goes through, and what it keeps busy on the way,
are one more file, beside a machines bucket of what you hire out:
# aggregates.yaml
aggregates:
- bucket: hires
initial: confirmed
attended_by: the counter
states:
confirmed: { event: confirmed, text: Confirmed }
out: { event: out, text: Out with the customer }
returned: { event: returned, text: Returned }
transitions:
confirmed: [out]
out: [returned]
holds: { what: machine, from: from, until: until, while: [confirmed, out] }
That is a booking site:
The list shows only machines free on the days asked for, two people
can never book the same machine for the same day, and a machine
brought back early is free again at once. The whole site, with a
counter desk, a calendar of who has which machine when and a
confirmation mail, is in
docs/examples/machine-hire.
Try it on your own machine in a few minutes.
What you get
- Forms with the browser’s own fields: dates, times, how long, numbers with units, patterns, checkboxes, files, a place on a map.
- Records that remember everything: every move is in the record’s log, with who made it and when.
- Desks: a page for a group (
qualifies:) lists the cases waiting for them, and its buttons move them on. “Desk” is only what we call such a page. - Nothing waits unseen: a signed-in person’s name in the header says when something waits for them (a question a program asks, a change waiting for their yes) and opens onto the list.
- Programs ask people: a program beside the site asks the owners, or one person, a question with alternatives to pick between, and gets the answer, secrets sealed for it alone.
- Lists the way the work looks: rows, cards, a table, a board, a calendar, a map, or a count; live as records change.
- Mail out, and replies back onto the case they answer.
- Payments asked for with a state, and the case moving on when the money comes.
- A conversation per case for the people working on it.
- Search in plain words: a visitor says what they need and is shown which option is theirs.
- Access from the content itself: who may open, read and move what is compiled from the pages, and the lint shows it as a table.
- Owners change their own words: whoever answers for a page says what should read differently, sees exactly what would change, and it is live on their yes. A change to how the work goes is drafted the same way and handed to whoever maintains the site.
- Programs that help: a scanner at the counter or an automation moves records the way a desk does, only the moves you allow.
- Cases handed on: a state can read its record through a template and hand it to a program beside the site (a model that sorts, a courier that files), and the answer moves the case, with what was sent and what came back kept beside it.
- A handbook to hand over: a PDF of how the site works, every need and role, written from the content itself for the board, and one for each group, linked from its invite and its desk.
- In your language: everything portal says itself, in English, Bokmål, Nynorsk, Swedish, Danish or German.
- Sealed backups every six hours, to storage you choose.
- No third parties in the page: scripts, fonts, maps and icons all come from the site itself, so a visitor’s browser talks to nobody else unless your own content links out.
How it runs
One process and one file per site. The process serves the pages, and the file keeps every record, every log and the work waiting to go out, each change written whole or not at all. Mail, payments, search and chat are small programs beside the site; each dials it with a key of its own and does only what that key is named for. Anything else, n8n or a script, talks to it over HTTPS with a token.
Content is checked before it reaches a site: the lint refuses what the site could not serve honestly, and a site loads new content only once all of it checks, keeping the last good content until then.
Where to read next
Writing a site
| Try it | A site on your own machine in a few minutes: a folder of YAML and one command. |
| Bringing your people in | From an empty sign-in to everyone at their own desk. |
| Content reference | Every key a content repo may write. |
| State machines | Stages, who moves a case, mail, deadlines, holds, payments. |
| Access | Who may do what, as the content says it. |
| Storylines | One site told several ways, one way per visitor. |
| Memberships | Groups portal keeps itself: a membership as a case. |
| What a site sends, and the replies it keeps. | |
| Rooms | A conversation for each case and each group. |
| The lint | What a content repo’s CI runs before anything reaches a site. |
| The handbook | The site’s own manual as a PDF, for the people who run it and for each group. |
| Languages | The six languages portal speaks, and how to add one. |
Running a site
| Operations | Releasing, deploying, adding a site, the environment, backups. |
| Architecture | What the engine is made of and where each piece lives. |
Building a site from a description
| Training a site | bratac plan and bratac build: a business in plain words becomes a content repo. |
| Learning | How the search box’s model is trained and measured, for whoever retrains it. |
Programs in the same family carry their own docs: gdo delivers mail and brings replies back, kron asks for money and says when it came, kino is the chat, a room per group and a thread per case, and varde keeps copies with trusted peers.
Designs not yet built are issues on this repo: a proposal is opened as an issue and closed when it is built, with a note on what differed.