Examples · examples/plate
Plate
A food diary for a phone: the USDA's 7,500 foods seeded into its database, packets looked up by barcode in Open Food Facts, recipes that log like foods, targets worked out from a profile, and charted trends.
What it shows#
- Search as you type, over full-text search
- Another service called with Http.fetch!, with a stand-in for it in the tests
- Rules run on both sides: an amount's nutrients, worked out as you type
- A phone-first layout, with tabs along the bottom
- A password only when one is set, with packages/auth's sessions (90 days)
Screenshots#
What it's made of#
- Its browser half
- 433.5 KB
- wasm, brotli; 581.0 KB gzip
- Pages and endpoints
- 11 + 19
- route files' pages, and handlers
- Lines of Roc
- 4,047
- its own .roc and .rocx, blank lines left out
- Tests
- 105
- 91 expects, 14 node tests
- Weighs
- 433.5 KB of wasm, brotli (581.0 KB gzip, 1590.8 KB raw)
- Made of
- 11 pages · 19 endpoints · 4,047 lines of Roc · 91 expects · 14 node tests
- Uses
- SQLite, packages/auth, packages/charts, packages/crypto, packages/forms, packages/testing, packages/tools
Measured on 2026-11-29 at commit 74eec5b. The wasm is the app's browser half, built with --opt=size; every page also loads start.js, the page's JavaScript, 22.8 KB brotli. All the examples says how they're measured.
Run it#
With the toolchain set up (just setup), start it from its own directory: it builds, serves at http://127.0.0.1:8080 and builds again when you save. Its README says what to look at.
cd examples/plate && ../../bin/rocx devTo build it, check it and run its tests, from the repository's root:
just examples plate
just examples-release plate # as deployed: rocx build, then the tests against a server built --opt=speed