Skip to content

Demo mode

Terminal window
./bin/form-gateway -demo

Demo mode makes a fresh instance playable in a single step: mail output, tenants, and site keys are available immediately, without having to set anything up in the admin UI. Meant for trying things out, for demos, and for local development — not for production use.

Everything the mode creates is ordinary configuration: after startup, the routes and tenants can be viewed and changed in the admin UI just like any other.

An embedded SMTP sink listens on 127.0.0.1:2525 (if the port is taken, it automatically picks another). It accepts every mail but forwards nothing — instead it saves it as an .eml file under <data-directory>/demo-mails/. Nothing leaves the machine.

Two SMTP routes point to this sink, so both delivery paths can be tried out:

RouteRole
Demo-Postfach (geteilte Default-Route)serves all tenants without a dedicated route
Demo-Firmenserver (eigene Route)permanently assigned to one tenant

Two tenants, deliberately different from each other:

TenantOriginsRoutePoW bitsQuota
Astro-Demohttp://localhost:4321, http://localhost:4322shared default route8500/day
Demo-Firmenseitehttps://www.firma.examplededicated route12100/day

The second origin set isn’t arbitrary: it demonstrates tenant isolation. A form on localhost:4321 cannot submit using the Demo-Firmenseite site key — the origin doesn’t match.

The console output shows the sink port, the storage directory, and the site keys for both tenants — plus the two lines that go straight into the Astro-Demo’s .env:

PUBLIC_GATEWAY_URL=http://localhost:8080
PUBLIC_SITE_KEY=site_…

The output appears on every startup of demo mode, not just the first — so the site keys aren’t lost if the terminal gets closed.

  1. Start ./bin/form-gateway -demo and copy the output.
  2. Write the two lines into examples/astro-demo/.env, then start the Astro-Demo.
  3. Submit a form.
  4. Seconds later, the .eml file appears in <data-directory>/demo-mails/ — open it with any mail client or a text editor.

It’s also worth checking the admin UI at the same time: under the Astro-Demo tenant, the submission shows up with its status and history.

The runnable Astro site with forms covering every field type lives in the repository under examples/astro-demo.

Seeding is idempotent: a second startup doesn’t create anything twice and doesn’t overwrite any changes made in the admin UI. It just prints the site keys again.

Demo mode is deliberately simplistic so you can get moving quickly:

  • The demo routes speak unencrypted SMTP (plain) to the local sink.
  • The sink delivers nothing — it just writes files.
  • The demo tenants use made-up recipient addresses (…@demo.local, …@firma.local) and low protection thresholds.

For real-world use, create your own route with TLS and your own tenant (see Operation) and start the gateway without -demo. The demo objects can then be deleted in the admin UI.