Roc Solid
Markup in Roc · pages on a native server · components in WebAssembly

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.

SourceREADMEAll the examples

What it shows#

Screenshots#

The trends page: energy each day as bars, an average day, and weight
Trends
Today's diary on a phone: a ring of the energy eaten against the target, and the meals
Today, on a phone
A food's page on a phone: the amount, what it has, and its nutrition facts
A food, its amount worked out as you type

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 dev

To 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