Case study by Gonzalo Luque Martin, October 2026
Plopp: health data on the edge, privacy-first
Plopp is my own consumer app: a calm bathroom companion that logs gut health, offers something light to read and lets you collect pixel-art mascots. Under the playful surface it processes health data, so it was designed like a regulated product from the first commit.
| What | Bowel-movement log (Bristol type, effort, satisfaction, duration, notes), a reading surface and a collection game |
|---|---|
| Where | iOS App Store (live since July 2026), web app, installable PWA, and as a connector inside ChatGPT and Claude |
| Languages | English, Spanish, Italian, German, French |
| Stack | TypeScript monorepo, React and Capacitor clients, Hono API on Cloudflare Workers, D1, Queues, Durable Objects |
| Regulation | Swiss FADP as home law, GDPR via Art. 3(2), health data under Art. 9 GDPR |
Architecture: one API, many clients
The backend is a single Hono API running on Cloudflare Workers, with the web app, the iOS shell and an MCP server as independent clients. I kept the SPA and the API strictly separate because a native app cannot consume a server-rendered layer, and I used the MCP server as a second client to prove the API was truly client-agnostic: it shipped with zero API changes.
- Shared contract. One package of Zod schemas defines every request and response, and the pure business logic (streaks, rewards, collection rules) lives there too, so clients and server cannot drift.
- Data in Western Europe. The core database and a separate analytics database both run in Cloudflare D1 in Western Europe. Analytics live apart so telemetry can never crowd the core database or its single writer.
- Latency is round trips, not rows. D1 is single-region, so hot reads are designed as one round trip, and scheduled jobs run as set-based SQL per time zone instead of loops per user.
- Background work uses Queues for push notifications and cron triggers for nudges and housekeeping.
- AI assistants as clients. Inside ChatGPT and Claude, the app runs through an OAuth-protected MCP server. The embedded view gets a short-lived, reduced-privilege token that cannot perform destructive or cross-user actions.
Privacy by design, in concrete terms
Treating the log as health data shaped the product, not just the privacy policy:
- Explicit, versioned consent. A separate unticked checkbox, recorded with its version. The server refuses to store a log without it, and withdrawing consent switches off sharing in the same atomic write. When the scope of processing changes, a version gate asks for consent again.
- Collect less. Some fields were left out on purpose. Date of birth is checked and discarded; only the fact "confirmed 16+" is stored.
- Private by default. Social features share nothing unless the user turns on individual fields, and masking happens on the server, not in the client.
- Sensitive fields never leave. Context tags and check-ins can never be shared, and push notifications never contain health data. Web push is end-to-end encrypted.
- Pseudonymous third parties. The subscription provider only sees an internal ID, the ad network a one-time nonce.
- Analytics without people. The analytics database holds no user IDs and no health data, enforced by a server-side allowlist of event names and properties. Events are aggregated at write time, so the data grows with days, not with users. Users can opt out.
- Rights as endpoints. Full data export and hard account deletion are API endpoints, not support tickets. Deletion also removes the user at the subscription provider. Retention periods are defined per data type, and residual backup copies are disclosed honestly.
- The paperwork matches the code. A record of processing activities, a data protection impact assessment, a processor register, an EU and UK representative under Art. 27 GDPR, and a privacy policy in all five languages.
Security
- Sign-in with Google, Apple or email. Passwords use peppered PBKDF2 at 600,000 effective iterations, chained because Workers caps a single call at 100,000.
- Responses that do not reveal whether an account exists, with timing equalised on failed logins.
- Session tokens with server-side revocation, and accounts linked only through verified email.
- Rate limits per route class, shared input validation, and atomic database batches for anything involving rewards or trades.
- Logs are signal-only: errors, slow requests and jobs. Health data is never logged.
- Deployment refuses to run if secrets are missing, stored as plain variables, or if the CLI is logged into the wrong Cloudflare account.
Testing and delivery
CI runs type checks, unit tests for the shared logic, dry-run deploys, and around 25 integration suites against a local Worker, including tests that GDPR erasure really deletes everything and that the analytics allowlist holds. CI never holds production credentials. Product rules that matter, such as wording rules and fairness invariants of the game, are encoded as tests rather than as notes.
What I learned
- App store policy is architecture. Google Play only accepts health apps from organisations, so Android ships as a PWA for now. Apple rejected an early build over wording near gambling, which became a tested rule for all user-facing copy.
- Change the policy and the consent version in the same release. Shipping a new data field before the privacy policy covered it meant asking every user to consent again. Now both move together.
- Aggregate early. Replacing a raw event log with aggregates removed personal data, cut storage, and made analytics cheaper to query.
- Guard the deploy, not just the code. The cheapest security controls were the boring ones: account pinning, secret checks and least-privilege tokens.
Building something that touches health, insurance or financial data? This is the kind of design I bring to client projects.