Demos as static snapshots
For whoever wants to show a private product on a public site: at the end the demo reads a reviewed file, and the site calls no service.
- Based on
- Updated
- ·
Before you start
-
A product with a public API or an export file from which the demo's data can be copied.
-
A static site that is built from files.
-
A list of names that must not reach the published file: people, clients, vendors.
Steps
Decide what the demo shows and name the fields
The demo's fields are listed before the code: only those are copied. The schema rejects unknown fields, so a new field needs a decision and cannot slip in by accident.
Write one export per snapshot, run by hand
The export reads only the source it is given, copies the allowlisted fields, validates the file against the schema, runs the redaction scan and writes the file only when every check passes. There is no scheduled refresh.
Print a review report in two parts
The top of the report says what the file holds and whether the computed figures agree with the source; it may go into the pull request. The bottom names the dropped rows and the source's internal ids; it stays in the terminal.
Review the file in a pull request of its own
The snapshot is committed alone, and the owner writes the review on the pull request before the merge. The file is never edited by hand: a fix goes into the export and is run again.
Build the page from the file at build time
The page reads the file during the build and says the source and the date. Nothing is fetched at run time. A missing file removes the demo, not the page: the page shows its description without the demo, and the links to the demo disappear.
Let age warn, never fail
The site check warns when a snapshot is older than its limit but does not block the build: an old demo is still true, only stale, and the page shows the date.
When not to use this
-
Freshness is the point of the demo, as in a price alert or a live dashboard: then it needs a real application, not a snapshot.
-
The data cannot be published even sanitised: show the structure and the aggregates, not the rows.
-
The demo would imply a hosted service: no sign-in, no forms that send data, no application structured data.
Where it comes from
This site's three demos work this way: the working-method replay reads a sanitised event log, the Hintapiste.fi demo a copy from the public product API and the search-visibility chart daily totals from Search Console. Each has its own export, schema and review.