myHHD

Under the hood

How myHHD is built

For the curious: technology, tests, architecture and numbers. Everything on this page is calculated automatically on every deployment. It describes version 1.0.1 of 11 November 2026. Česky

737
unit tests of calculations, storage and sync
294
browser test runs, on iPhone and in Chrome
13
known vulnerabilities in the libraries used (npm audit)
102kB
downloaded by the browser on first start, compressed

Tests

No green, no release

Health records and supplies cannot afford a calculation error. Deployment therefore runs the type check and all tests by itself. If anything fails, the new version is not released.

Unit tests

737 tests in 78 files (Vitest): usage, forecast, orders, schedule, corrections and cancellations, input validation.

Browser tests

147 scenarios in 40 files (Playwright). Each runs on iPhone 13 mini (WebKit, the Safari engine) and in Chrome on a computer.

Sync crisis scenarios

Two devices recording without signal, an outage in the middle of sync, a damaged or deleted file in Drive, restoring from a backup. Nothing may be lost or duplicated.

Accessibility and appearance

Automatic accessibility check (axe), text contrast in light, dark and high-contrast modes, measured size and colours of buttons.

Performance

A generated 10-year history of about 25,000 records. Recalculating the state must stay under 50 ms.

Real history

Calculations are also compared with the history previously kept in a spreadsheet. The real data stays outside the repository, which contains only a made-up set with the same structure.

Architecture

The diary as a series of events

The app does not store a "current state" but every action as a separate event. Supplies, the diary and the forecast are recalculated from them every time (event sourcing).

  1. Record

    A dialysis session, delivery, stock count or correction becomes a new event with a unique ID (UUID v7, sortable by time).
  2. Device

    The event is saved straight away in IndexedDB on the device. Nothing is overwritten or deleted, data is only added.
  3. Google Drive

    In the background it is uploaded to the device's monthly file in your Drive, plus a daily backup. Other devices read it from there.
  4. Calculation

    The state is calculated from all events. Corrections and cancellations are further events, and the result does not depend on the order in which they arrived.
  • 19 event types
  • data format version 2
  • correction = new event
  • saved to the device first

How it was made

Built with Claude Code

The author did not write myHHD alone. Most of the code, the tests, the translations into 15 languages and this page were written by Claude Code, the AI coding assistant from Anthropic.

The author decides what the app should do and how it should look, approves every change and tests everything on their own iPhone in daily use. The rules Claude follows while working (data protection first, events are never deleted, no treatment recommendations, no release without passing tests) are written down in the repository, and automatic tests guard many of them.

First came about a week of preparation: the author wrote the specification and thought through the technical design. Development started only once the outline of the specification and the technology were clear. Everything essential was then built in 5 working days, including all 737 unit tests. The rest is fine-tuned along the way, during the author's own home dialysis.

  • about 1 week of specification
  • 5 working days of development
  • fine-tuning in daily use
Try Claude Code

Technology

What it is made of

A progressive web app (PWA): it runs in the browser, can be installed on the home screen and works without signal. No server framework, no database at the author's end.

Library and version What it does
Svelte 5.57.2 User interface. Compiles to small JavaScript without a runtime framework.
TypeScript 6.0.3 Types in strict mode, errors are found before running.
Vite 8.3.4 Build and splitting the code into parts loaded only when needed.
vite-plugin-pwa 2.0.0 Service worker (Workbox): the whole app on the device, updates in the background.
Dexie 4.4.6 IndexedDB storage in the browser.
Tesseract.js 7.0.0 Reading delivery notes from a photo right on the device (WebAssembly).
jsPDF 4.2.1 Exports and orders as PDF.
write-excel-file 4.1.1 Exports to Excel (XLSX).
uqr 0.1.3 QR codes for payments in the About the author section.
Cloudflare Workers 4.151.1 Hosting and exchanging Google sign-in keys. Health data never goes there.
Claude Code Coding assistant from Anthropic, wrote most of the code, tests and translations.
Vitest, Playwright, axe 5.0.5 · 1.64.1 · 4.14.0 Unit tests, browser tests, accessibility check.

Code

In numbers

48,918
lines of app code in 199 files, including 73 Svelte components
12,602
lines of tests
16
languages, 23,411 lines of interface text
700
commits and 292 deployments

Security and privacy

The data has nowhere to escape

Strict Content Security Policy

The browser may only run scripts from the myHHD website and send data only here and to Google Drive. Even a bug in a library cannot send records anywhere else.

Minimal permissions

drive.file: in your Drive the app sees only the files it created itself.

OAuth sign-in with PKCE

The long-term permission stays on the device. A small function on Cloudflare only exchanges keys, stores nothing and never receives health data.

No tracking

No cookies, analytics or ads. A problem report is an email with the version and device, without health data.

Few dependencies

8 libraries directly in the app (41 packages including their dependencies), 575 including development and test tools.

Size

2.4 MB is stored on the device, after which the app starts without a network. Reading from a photo (14.1 MB) is downloaded only on first use, like PDF, Excel and individual screens.