Skip to content
Duc Tran

Full-stack · side project

A child health app for families, from schema to deploy

A child growth, vaccination and health-record app for families: Next.js 16 (App Router), PostgreSQL on Neon with Drizzle, Better Auth and Resend; owner, editor and viewer roles, an installable PWA, a demo mode, and end-to-end tests with Playwright and axe.

Stack
Next.js, PostgreSQL, Drizzle, Better Auth, Playwright

Why build it

Notch is a child growth, vaccination and health-record app for families. Parents record a child's measurements, vaccinations and illnesses, and see growth against the WHO Child Growth Standards, the next vaccine on the national schedule, and how the last illness went. It runs in Vietnamese and English at notch-tmd.vercel.app, where a demo with a fictional child, Mây, needs no account.

It is my full-stack project: one person, from the database schema to the deployment, with the same standards as client work.

The stack: Next.js 16 (App Router, Server Components, Server Actions), React 19, PostgreSQL on Neon with Drizzle, Zod, Better Auth, Resend, Sen UI and Tailwind CSS, deployed on Vercel.

Principles that shaped it

  • Each screen answers one question: is the child growing well, which vaccine is next, how did the last illness go.
  • Only occasional events are recorded, and recording one takes at most three taps.
  • It tracks; it never diagnoses or calculates medicine doses.
  • Health data is sensitive. No child names or health details in emails, calendar entries or error reports.
Notch Today page in the demo: Mây is 1 year 6 months, a reminder that 34 days have passed since the last measurement, weight and length cards marked Normal with percentile bars, the next vaccine appointment shown as 25 days overdue, the next 30 days, and the latest milestone.
Today, in the demo. Every record shown belongs to the fictional child.

From schema to screen

The domain logic lives in plain TypeScript packages with no React: @notch/growth computes WHO z-scores and percentiles from the LMS tables, @notch/vaccines holds the vaccine catalog and the national schedule from Circular 52/2025 of the Ministry of Health, and @notch/db holds the Drizzle schema, migrations and queries. The app reads through Server Components and writes through Server Actions, each of which checks the session, the family and the role before it touches the database.

A measurement is never shown as a bare z-score. It comes with WHO's own name for it (normal, stunted, underweight and so on), the normal range at the child's age in kilograms or centimetres, and a note when the curve crosses a line of the chart. The advice stops at "watch the next measurements" or "take the chart to a paediatrician".

Notch growth page: weight, length and BMI cards marked Normal with the normal range, percentile and z-score, above three WHO charts for weight, length and BMI for age with the child's measurements plotted between the -3 and +3 lines.
Growth against the WHO standards: the reading comes first, the percentile and z-score in small print.

Sign-in, roles and sharing

  • Email links only, with Better Auth's magic-link plugin, sent through Resend. There is no password to leak, and a link works once, for ten minutes. Only the owners and the relatives they invite can get one, and the form answers the same for any address.
  • Roles. An owner invites a relative as an editor or a viewer. Viewers see no edit controls, and every Server Action checks the role again on the server.
  • Sharing without an account. An owner or editor can share a child's page for 7 days, 30 days or until revoked. The link carries a random 32-byte token, the page is noindex and no-store, and it never shows the health log or the birth details. A page left open notices within a minute that its link was revoked.
Notch vaccines page: 18 doses given and 13 of 22 diseases covered, a Download calendar button, and appointments for influenza and a six-in-one vaccine marked overdue, hand, foot and mouth disease in 70 days, and meningococcal ACWY with no date yet.
Vaccines: appointments, overdue doses and a calendar download that holds no child details.

Installable, but nothing stored on the phone

Notch is a progressive web app, so it can be added to the home screen. Its service worker caches only an offline page: records always come from the network and are never stored on the device. The demo reads an in-memory PGlite database built on each server instance, so visitors never touch real data.

Tested like a product

  • 1,227 unit tests with Vitest: WHO z-scores, the vaccine schedule, database queries on in-memory PGlite, and app logic.
  • 405 end-to-end tests with Playwright and axe (WCAG 2.2 AA), in light and dark, on desktop and mobile. They sign in through the real email-link flow, reading the link from a file outbox, against fresh PGlite databases, so they need no .env and no Docker.
  • Deployment runs on Vercel in Singapore with Neon in the same region. Every build applies pending migrations before it goes live, and preview deployments use a separate database branch that only holds the fictional child.

Live: notch-tmd.vercel.app · source on GitHub.