One device on your Wi-Fi becomes a content server. Everyone else opens a browser and reads — and searches — a library that never asks the internet for anything.
Three parts, and only one of them is clever.
A Node HTTP server that serves the page, the library and the search index. Copy it to a laptop, a Raspberry Pi, or a phone that runs Node. Nothing to install.
Every imported file is hashed and measured. On every load those hashes are checked again, and a pack that no longer matches is quarantined instead of served with pages missing.
No app to install, no account to make. A phone joins the Wi-Fi, opens the address the host prints, and searches. That is the whole client.
The demo below runs the same
lib/search.js the host runs — in your
browser, over a pre-built copy of the starter pack. Nothing is fetched from anywhere.
The chips there are derived from the library itself. A document containing the whole query as a phrase outranks one that merely carries the words — that is the phrase bonus, not luck.
Each row is asserted in the test suite, not promised in prose.
| Situation | What Lantern does |
|---|---|
| A path tries to leave a pack | Refused at import and refused again at request, with 403. |
| The disk is full or read-only | The pack is not added, the files that did not land are named, and nothing half-written is left behind. |
| A pack no longer matches its manifest | Moved to .quarantine/, reported in the Packs card, and neither served nor searchable. |
| No peers, no internet | Nothing changes. The library opens on the host and says how many documents it holds. |
| A bundle that is not JSON | Refused with the reason shown, and the library keeps serving. |
It prints the address a phone should open. No build step, no install.
$ node server.js
Lantern is serving 3 document(s) on port 8080
Open on any device on this Wi-Fi:
http://192.168.1.24:8080/
No internet is used at any point.