Microtoll Engine pre-1.0 · the locks, pre-built

Invites — the second example

What a share link cannot do: inviting a known person directly, with no link and nothing to forward, through a mailbox only the two of you can compute. Built on the notes example (../notes-app/notes.js) plus @microtoll/mailbox; invites.js is everything this example adds (about 150 lines).

Run it

cd examples/invite-app
docker compose up

Then open http://localhost:8089, in two browsers or a normal and a private window, as Ada and Bea:

  1. Both: Boot, Sign up, type a name.
  2. Ada: New note, share by link; Bea pastes the link, Open link, then join as member.
  3. Both: remember people on that note. Each now holds the other's keys from the note's own roster — nothing was exchanged with the server.
  4. Ada: New note, then invite Bea directly. Bea's page is woken by the live watch and collects the invitation; the note appears with read access. Nobody made a link.
  5. Bea: open it — her app tells Ada it was seen. Ada: invitations shows "collected, seen".
  6. Ada: another note, invite Bea directly, then take back before Bea's page collects it. Bea's next collection finds nothing.

docker compose down -v throws the database away.

What the server learns, honestly

It does not learn a name, a note's key, who invited whom, or that an invitation was seen (the acknowledgement is a drop like any other).

Where things are