Examples · examples/pomodoro
Pomodoro
A Pomodoro timer: 25 minutes of focus, then 5 of rest, a ring that empties as time passes, and a count of today's sessions. The same page runs in a browser and, unchanged, as native Android views, where a session's end plays a chime and buzzes the phone.
What it shows#
- One page on the web and on Android (rocx dev --android)
- A timer kept by a deadline, not by counting ticks
- A sound and a buzz from a timer: plugins with a phone half
- SVG and percentage widths, drawn natively on the phone
Screenshots#
What it's made of#
- Its browser half
- 239.7 KB
- wasm, brotli; 303.6 KB gzip
- Pages and endpoints
- 1 + 2
- route files' pages, and handlers
- Lines of Roc
- 414
- its own .roc and .rocx, blank lines left out
- Tests
- 21
- 15 expects, 6 node tests
- Weighs
- 239.7 KB of wasm, brotli (303.6 KB gzip, 750.8 KB raw)
- Made of
- 1 page · 2 endpoints · 414 lines of Roc · 15 expects · 6 node tests
- Uses
- SQLite, packages/audio, packages/vibrate
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/pomodoro && ../../bin/rocx devTo build it, check it and run its tests, from the repository's root:
just examples pomodoro
just examples-release pomodoro # as deployed: rocx build, then the tests against a server built --opt=speed