CronôBR
An interval training timer for Tabata, HIIT, EMOM, AMRAP, boxing and circuits. It works with no internet and no account, and keeps time when the screen goes dark.
- Role
- Product, design and development
- When
- 2026, rewritten in November
- Team
- Solo, with AI agents on the code
- Status
- In progress, device testing still to come
- 24 templates ready to train, across 11 workout types
- 100% coverage required on business rules, or CI blocks the change
- 99 test files: 81 unit and screen, 18 end to end
- 4 languages on screen, in the voice and in the alerts
The first version of CronôBR counted time by subtracting one second on each tick of the code. In the background that code stops, so the workout resumed from where it had paused. The beep was only a vibration, EMOM ignored the minute mark, and history cut off at 100 workouts without saying so.
Before changing anything, I ran an audit that marked each feature as complete, partial, on screen only or missing. It led to a rewrite: the idea, the templates and the copy stayed, the code did not.
The challengeBuild a timer you can trust with the phone on the floor and sweaty hands: the right time, alerts with the screen off, and nothing that depends on an account, a server or a connection.
The Choices That Shaped the App
- 01
Time Comes from the Clock
The engine stores the moment of each mark (start, pause, phase change) and works out the position from it. A slow screen, a suspended app or a reopened one adds no error. If the device clock changes in a way that cannot be trusted, the workout closes as interrupted and no time is made up.
- 02
Scheduled Alerts for a Dark Screen
With the app in view, the app itself alerts you with sound, voice and vibration. Off screen, a local notification covers each phase change and is rebuilt on every pause or resume. No silent audio playing to keep the app alive.
- 03
A Lock Against Stray Taps
The screen locks when you start. Pausing and finishing stay one long press away, while skipping, going back and closing are out of reach. Holding the padlock for a second unlocks it.
- 04
Three Views of the Same Workout
Ring shows progress through the step, Focus fills the screen with the phase color so you can read it from afar, and List shows everything that is left. All three read the same timeline, so the preview never differs from the workout.
- 05
File Backup, No Cloud
Routines and history leave in a .cronobr file, a documented and versioned JSON that is the same on Android, iPhone and the web. Whoever receives it sees a preview, chooses what to do with duplicates and can undo the restore.
- 06
A Metronome on the Audio Clock
The 30 to 240 BPM pulse does not rely on the language timer: each beat is queued ahead of time on the audio clock. It also works as cadence inside a step, and goes quiet when the voice or the countdown needs to speak.
From the First Tap to the History
The home screen opens with shortcuts and workout types. From there you start a template, build your own routine or keep several timers running together.
-
01 Home. Shortcuts, last routine and workout types on one screen. One tap opens the templates.
-
02 Ring. Ring: step time, round, total and what comes next.
-
03 Focus. Focus: the phase color fills the screen, so you can read it from afar.
-
04 List. List: what is done and what is left, step by step.
-
05 Editor. Routine editor: blocks, rounds and steps, with the total updated on the spot.
-
06 Timers. Several timers at once, with a single clock behind them.
-
07 History. History with no record limit, a calendar and a way to repeat a workout.
Under the Hood
An app that keeps everything on the phone has no server to repair broken data. So writes are atomic, reads are suspicious and every rule has a test.
Stack
- React Native 0.88
- Expo SDK 58
- Expo Router
- TypeScript
- SQLite
- Reanimated
- Web Audio
- Zod
- GitHub Actions
Safeguards
- SQLite with a single queue and a transaction on every compound write: finishing saves the history and closes the session together
- Routines and imported files validated against the same limits as the editor, before anything is written
- Import refuses a truncated, oversized or future-version file, and keeps a restore point
- Data from the first version imported only once, in one transaction, without deleting the originals
- Ads are still test ads, only at the end of home and history; a test makes sure a workout never shows one
- No account, no microphone and no tracking prompt
Tests and Quality
- Jest
- Testing Library
- Playwright
- axe
- knip
- gitleaks
- OSV-Scanner
- Jest and Testing Library with a real SQLite database in the tests, and injected failures on write commands
- Playwright on the web build, in light and dark themes, with axe checking WCAG 2.2 AA and touch targets of 44 px or more
- Performance as a test: E2E fails if a tap goes over 200 ms or a phase change is off by more than 400 ms
- A browser test is not proof for the phone: the requirements matrix splits logic, Android and iOS, and the last two columns still read not tested
What You Would See in the Repository
The code is private. Here is what it has, with the path or the number behind each point, as a script for a technical conversation.
Architecture
-
Pure rules kept apart
src/domain · 26 modulesEngine, timeline, metronome and import have no React Native and no clock: the current time comes in as a parameter.
-
Thin routes, screens by feature
14 folders in src/featuresThe route reads the parameters and calls the screen. Each feature has its own folder, with its tests next to it.
-
Device behind ports
cues/port.ts · transfer/file-port.tsxSound, voice, vibration, notifications, files and ads are interfaces. The real adapter sits on one side, the fake one for tests on the other.
-
Decisions written with a reason
138 decisions · docs/evolucaoEach choice has a number and a why, in the stage where it came up. It serves as memory for me and for the agents.
Types and Data
-
TypeScript at its strictest
tsconfig.json · src/i18n/messagesstrict, with index access and optional fields handled. Translated text is a type too: a key missing in one language breaks the compile.
-
Versioned migrations
6 migrations · user_versionEach database step runs in one transaction along with the version change. A version newer than the app is refused.
-
A format open to new fields
docs/spec/formato-cronobr.mdUnknown fields are ignored and an unknown workout type opens as custom, so a new file does not break an older app.
Tests and CI
-
100% where the rules live
coverageThresholdThe domain blocks CI if line, branch, function or statement coverage drops below 100%.
-
Usage with a ceiling
e2e/desempenho.spec.tsStartup, taps, phase changes and memory with 1,000 routines have limits. One measurement caught the home screen drawing them all at once.
-
Offline for real
e2e/fluxos.spec.tsA test cuts every outside request on first launch, and the app keeps working.
-
A gate before commit and in CI
lefthook · GitHub ActionsFormatting, lint, types, unused code, leaked secrets and known vulnerabilities. The preview only publishes when all of it is green.
Today
All eight stages of the evolution plan have code and tests in place, and the web preview runs the app in the browser, minus notifications, vibration and ads.
What is left only a phone can answer: produce the Android package, run the scripts for locked screen, audio and battery, and fix what turns up.
Next come the store accounts, the published privacy policy and a closed test on Android. iPhone is planned and has not been tested yet.
Have a Similar Project in Mind?
I like problems with real people on the other side. Tell me what you need.