Skip to content

About

Architecture and privacy showcase for Chart35: encrypted fertility charting, Couple Sharing, web/PWA, Capacitor phones, Tauri desktop, and native watch clients.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Chart35

Chart35

Your fertility chart, encrypted before it leaves your device.

Chart35 is an offline-first, end-to-end-encrypted charting app for the Creighton Model FertilityCare™ System (CrMS). The web/PWA, iOS and Android phone apps, and macOS and Windows desktop shells share a TypeScript application. Standalone watchOS and Wear OS clients have their own native engines and compatible encrypted sync. Daily observations become the classic 35-column Creighton chart with auto-computed stamps, a monthly calendar, and cycle-trend insights.

New in October 2026: Couple Sharing. Two people can use one encrypted chart through separate accounts and passwords, with one Chart35 Sync subscription covering both. It is released to all accounts on the web and available to phone shells running current web code. Released desktop builds through 2.4.4 and both watch clients cannot sync a shared chart yet; see compatibility.

This is a public showcase of the architecture and engineering - not a source mirror. The full application (web, native shells, sync API) stays private. What is public and maintained:

  • This repo - architecture, privacy model, screenshots, and links into the production stack
  • Extracted packages Chart35 dogfoods in production (below)
  • Case study on stephens.page (narrative + diagrams)

An older AGPL web-client snapshot, Chart35Client, remains on GitHub as an archive for historical audit. It is not the live deploy path and is no longer updated.

Why it exists

Fertility observations are sensitive health data. Chart35 keeps them on the device by default. If you choose account sync, the app encrypts the chart before upload, and the server stores ciphertext. Sharing a chart should preserve that boundary while letting the people you choose read it on their own devices.

Stack

Concern Choice
Web / PWA TypeScript, Vite, Dexie.js (IndexedDB), Web Crypto API, vite-plugin-pwa
iOS / Android phones Capacitor shells loading the live web app
macOS / Windows Tauri 2 shells with bundled web assets
watchOS Standalone SwiftUI app, SwiftData, CryptoKit + CommonCrypto
Wear OS Standalone Kotlin / Compose for Wear OS app, local storage, Android Keystore
Sync server Node.js, Express, SQLite, HTTP-only JWT cookies, bcrypt
Chart encryption PBKDF2-HMAC-SHA256 (600,000 iterations) → AES-256-GCM; web uses @stephenspage/webcrypto-envelope
Couple Sharing key handoff ECDH P-256 + HKDF-SHA256 + AES-GCM through Web Crypto
Billing Stripe Checkout, server-owned entitlements, @stephenspage/webhook-verify
Delivery GitHub Actions verification and deployment, Apache, Let's Encrypt TLS

Architecture at a glance

  • Local charting without an account. Observations and chart computation stay on the device. The web app works offline after its first load. Capacitor phone shells need a network connection for first launch, then use the service worker; desktop and watch apps bundle what they need to render.
  • One rule set, three implementations. The web engine also powers phone and desktop shells. Swift and Kotlin engines power the watches. All three run the same language-neutral stamp-conformance corpus to check colors, peak-day rules and post-peak counts.
  • Account isolation. Encryption keys, chart attachment and pending uploads are scoped to an account. Sync checks that its session and chart claim are still current before applying results, so a delayed response cannot write into a different account's chart.
  • Explicit chart choices. When the device and account hold different charts, one comparison decides whether to combine them, take the account's chart, or back up the device's chart. Replacement flows offer a complete JSON copy and ask for confirmation.
  • One chart renderer. The personal chart, sample chart and practitioner viewer use the same chart derivation and grid. Imported files, downloaded backups and shared payloads pass through the same chart-vocabulary validation.
flowchart LR
    D[Local chart] --> E[Encrypt on device]
    E --> B[Encrypted account backup]
    B --> O[Decrypt on an authorized device]
    D --> F[Remove free-text notes]
    F --> S[Encrypt with separate share key]
    S --> V[Encrypted practitioner payload]
    K[Share key in URL fragment] --> P[Practitioner browser]
    V --> P
    P --> C[Decrypt and render chart]
Loading

Encryption and privacy boundaries

Personal-chart keys are derived on-device from the account password and a per-user salt using PBKDF2-HMAC-SHA256 at 600,000 iterations. AES-256-GCM envelopes use a random 12-byte IV and a 128-bit authentication tag:

base64(iv):base64(tag):base64(ciphertext)

The web, Swift and Kotlin implementations share this envelope format. Crypto tests include independent key-derivation vectors and web-generated ciphertext fixtures; stamp parity is checked separately by the conformance corpus.

Practitioner links carry a separate random key in the URL fragment. The fragment is not sent in HTTP requests; the practitioner decrypts in their browser. The encrypted payload includes chart observations and the first name, with free-text notes removed. Newly issued links expire after 90 days and can be revoked or replaced.

Encryption protects uploaded chart content. The service still handles account identity, authentication and billing metadata. Local chart storage and JSON exports are readable on the device; exported files include notes and should be treated as sensitive. A password reset restores account access but does not, by itself, decrypt an older backup. See the public privacy policy for the full boundary.

Concurrent edits and offline recovery

Background uploads name the backup revision the device last agreed with. If another device has replaced it, the server refuses the stale upload; the client reads the newer backup, merges and retries a bounded number of times. Deliberate overwrites remain a separate, confirmed action.

Each day's edits carry lineage as well as a timestamp. Merge follows a known successor before comparing competing edit times, with a deterministic tie rule. Deleted days travel as encrypted deletion records, so an offline device cannot bring back an older copy. Chart Settings travel with the chart; theme, default view and reminder time remain personal device preferences.

Couple Sharing

Couple Sharing was released to every account on October 11, 2026. It gives two verified accounts the same chart capabilities without sharing a password. The invitation and acceptance name the Chart Owner and require explicit consent. Sending an invitation requires the sender's own active Sync grant; accepting and starting sharing require a grant on either account, and one grant covers both people's uploads.

The source device creates a fresh Chart Key, encrypts the chart under it, and seals access to the recipient's ECDH public key. Each account's private access key is encrypted under its own password-derived key. Setup can proceed asynchronously, and a fresh device can open the shared chart using its account's password. The source account's personal encryption key is never handed to the recipient.

Shared-chart requests must name the current Chart Key generation, and uploads also name their base revision. The server checks membership, generation and revision before granting access. A joining person's existing account backup is set aside privately, and a device holding its own chart requires an explicit switch instead of silently combining histories.

Competing edits produce encrypted Chart Conflict Notices showing both attempts and the result kept, without recording authorship. Notices stay outside chart exports, practitioner payloads and email. Ending sharing revokes server access and the practitioner link; the owner then secures the chart under their own key before further uploads. Copies already downloaded or exported cannot be recalled.

Published primitives

The web client's crypto and Stripe webhook verification are not one-off helpers left inside the app. They were extracted into small, dependency-free packages that Chart35 still runs in production, so the same code path is public, versioned, and reusable.

Concern Package Notes
Password vault + AES-256-GCM envelope + zero-knowledge seal/open @stephenspage/webcrypto-envelope (repo) Powers Chart35's E2E sync and provider-share fragment keys on web. Wire format is the iv:tag:ciphertext string above.
Wire-compatible Go twin webcrypto-envelope-go Same envelopes open in either language; cross-language fixtures live in both test suites.
HMAC webhook verifiers (Stripe / GitHub / Twilio / Mandrill) @stephenspage/webhook-verify (repo) Chart35's billing API verifies Stripe-Signature with constructStripeEvent rather than only the Stripe SDK helper.
Go twin webhook-verify-go Parity vectors shared with the TypeScript package.

TypeScript releases publish to npm via GitHub Actions with OIDC Trusted Publishing (provenance on every version, no long-lived npm token).

Product shape (private monorepo)

These paths describe the private application repository; this showcase contains documentation and images only.

src/                  Shared web app, chart engine, storage, encryption and sync
packages/contracts/   Validated client/server contracts and entitlement views
server/               Express API, encrypted backups, sharing and Stripe billing
ios/                  Capacitor iOS shell
android/              Capacitor Android phone shell
src-tauri/            Tauri macOS and Windows shells
watchos/              SwiftUI watch app + Swift engine/crypto package
wearos/               Compose watch app + Kotlin engine/crypto package
conformance/          Stamp fixtures shared by TypeScript, Swift and Kotlin
scripts/              Deployment, releases and real-API browser smoke checks

Verification and delivery

The application has Vitest client and server suites, HTTP integration tests, Swift package tests, Kotlin core tests and the shared stamp corpus. The Couple Sharing browser workflow uses independent browser contexts, the real API, an isolated database, captured mail and real encryption. It exercises a fresh device while the source is offline, concurrent edits, deletion propagation, exports, account switching, coverage changes and departure.

GitHub Actions lints, tests and builds the web app and API before deploying the triggering main-branch commit, then checks the live site and its deployed commit marker. Deployment SSH access is limited to deploying a commit already on main. Desktop releases have a separate signed updater path.

Screenshots

Existing captures of the chart, insights and earlier native UI; they do not show the new Couple Sharing flow.

The 35-column Creighton chart Cycle-length trend insights
The classic 35-column chart with auto-computed stamps. Cycle insights and length trend.
Trend zoom Earlier native UI in dark mode
Trend zoom for scanning many cycles at once. Earlier native UI in dark mode.

Status and compatibility

Architecture checked against the current application source on October 15, 2026.

Surface Current shape Couple Sharing
Web / PWA Live at chart35.com; local charting and optional Chart35 Sync Released to all accounts
iOS / Android phones Capacitor shells loading the live site Current web code supports it; physical-device checks of native exports and key persistence remain outstanding
macOS / Windows Tauri shells with bundled assets and signed updates Released builds through 2.4.4 predate it; use the web until an updated desktop release
watchOS Standalone SwiftUI implementation; distribution work remains Shared-chart sync is unsupported
Wear OS Standalone Compose implementation; Play Wear distribution work remains Shared-chart sync is unsupported

The server refuses unsupported shared-chart reads and writes with an update message. Browser automation verifies the shared web flow; it does not establish native hardware or store-release verification.

Public entry points for hiring / audit:

Surface Role
This repository Architecture + privacy narrative + screenshots
stephens.page case study Long-form writeup
@stephenspage/webcrypto-envelope Production web E2E crypto primitive
@stephenspage/webhook-verify Production Stripe webhook verification
Chart35Client (archived) Historical AGPL web snapshot - not current

Questions or interest: open an issue here, or email [email protected].


(c) 2026 Jacob Stephens. The Chart35 name, application, and source are proprietary. This repository documents the project; it does not grant a license to the application or its code. Chart35Client, where still available as an archive, was published under AGPL-3.0-or-later.

The Creighton Model FertilityCare™ System is a trademark of FertilityCare Centers of America, used here descriptively only. Chart35 is an independent project and is not affiliated with, endorsed by, or sponsored by FertilityCare Centers of America, Creighton University, or the Saint Paul VI Institute.

About

Architecture and privacy showcase for Chart35: encrypted fertility charting, Couple Sharing, web/PWA, Capacitor phones, Tauri desktop, and native watch clients.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors