CMS and Patient App
Two products that are really one. The platform runs an eye clinic's day, from the front desk to the prescription. The app is what the patient sees of it afterwards, and for children on a myopia programme it is where the treatment actually happens, between visits. I own product on both. The app I built end to end. The platform I share with one other developer.


The Decisions
- 01
Referential integrity lives in the service layer, not in foreign keys
The database does not enforce the relationships. Roughly 35 domain services do. It costs a safety net, and it buys the thing a clinic needs at 9am: a receptionist who breaks a rule gets a sentence in Vietnamese telling them what went wrong, rather than a driver error nobody in the room can read. Constraint violations are a user-facing moment in software like this, not an exception to log.
- 02
The API contract is written once, in Go
A generator reads it and emits the TypeScript clients and the React Query hooks. So the frontend cannot drift from the backend. Not “should not”: a change that would break the client fails at build, not in a clinic. On a product two people are shipping into live use, the drift is the thing that gets you.
- 03
Every timestamp is UTC, converted only to display
Nothing is stored in local time, anywhere. The market is UTC+7, and naive date handling there does not throw. It silently moves an appointment to the wrong calendar day, which you find out about when a patient arrives and nobody is expecting them. Migrations run against live production data for the same reason: every schema change needs a backfill plan before it needs a merge.
- 04
Kid mode cannot book, pay, or change anything
The app has two faces. Parents get a calm clinical one. Children get their own palette, an animated companion and a journey map, and none of the controls. A myopia programme is a multi-year commitment being asked of a seven-year-old, so the child half has to be somewhere they want to return to. It also has to be somewhere they cannot accidentally cancel an appointment.
- 05
Frames are sized from a measured pupil distance, not a fixed scale
The AR try-on tracks the face with MediaPipe and renders 3D eyewear in three.js inside a WebView, locked to the face at 30fps, with no native dependency. Scaling the frames to a constant would have been simpler and would have looked fine in a demo. An optician fits to inter-pupillary distance, so that is what it measures and sizes against. A try-on that lies about fit is worse than no try-on.
What Shipped
The whole clinic journey. One deployment serves several clinics without their data meeting.
Front desk to the till
Reception runs the queue, clinicians write up the visit, cashiers take payment.
Go underneath
About 35 domain services on Postgres, Redis and MinIO. Access is checked per request, by capability, not by role.
The patient app
Patients book and read past visits in plain language. It shares about 85% of its logic with the web app.
The myopia programme
Tracks a child's outdoor and screen time, and projects how their prescription might move.
- Go
- PostgreSQL
- Redis
- MinIO
- React 19
- Vite
- TanStack Router
- TanStack Query
- Zustand
- React Native
- NativeWind
- MediaPipe
- three.js
- Go
- PostgreSQL
- Redis
- MinIO
- React 19
- Vite
- TanStack Router
- TanStack Query
- Zustand
- React Native
- NativeWind
- MediaPipe
- three.js
The Patient App
What the patient sees of all this, and where a child's treatment actually happens.
Between visits is where a myopia programme is won or lost, and between visits there is no clinic. So the app carries the part that has to happen daily: outdoor time, screen time, the care plan, and charts that show a prescription moving rather than a number in a letter.
It has two faces. Parents get the clinical one. Children get their own, with a palette, a companion and a journey map, and none of the controls that could cancel an appointment.
I built this one on my own, and it shares about 85% of its logic with the patient web app.
A week logged, and the chart it feeds. Demo patient.
Where It Is Now
The platform is in use. The app is in pilot, going out through TestFlight, with the AR try-on the most recent thing to land.

