# Flat-file database

The prototype state is a single JSON document at `storage/state.json`.

It stores:

- anonymous reader cookie IDs;
- owned demo Books;
- progress and bookmarks;
- saved immutable Paths;
- active Journeys and return stacks;
- immutable shared Trails;
- prototype payment intents;
- lightweight product analytics events.

Writes use PHP `flock()` so simultaneous requests do not normally overwrite one another on a standard single-server PHP host.

This is intentionally appropriate for a demo and early private testing. It is **not** the long-term persistence design for a high-traffic public release. Because all access goes through `lib.php`, storage can later be moved to another backend without changing the reader contract.
