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

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.

SourceREADMEAll the examples

What it shows#

Screenshots#

The timer at 25:00 in a ring, the Focus and Break tabs above it, and today's count below
The timer
On a phone-sized browser: a break of 5 minutes after a focus session, the ring and buttons in green
A break, in a phone's browser
The same page on Android's emulator, drawn as native views: the ring, the time, the buttons and the day's bar
The same page, as Android views

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 dev

To 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