[01]
Two apps, one domain layer
Separate customer and operations deployments share auth, database and UI packages. Fifteen Mongoose models define the domain once.
A telehealth commerce platform connecting medical intake, clinician approval, prescriptions, payments, despatch and subscriptions across customer and operations apps.
* ONE ORDER, END TO END
[01] The problem
Medical intake, checkout, clinical approval and fulfilment often live in separate tools. That fragments the patient journey, slows prescription handoff and makes payments, subscriptions and refunds difficult to reconcile.
[02] The constraints
Treatment continuity made a late renewal more serious than an ordinary delivery delay. It drove early despatch, idempotent retries and monotonic order states.
AI can summarise intake and suggest a plan, but a clinician must make the prescribing decision. The workflow speeds up review without removing that control.
Approvals, despatches and renewals are always in flight. Health checks and error tracking had to surface failures before patients reported them.
[03] The approach
I built a customer app and role-based back office over shared auth, data models and UI packages. The subscription lifecycle was designed around treatment continuity rather than billing dates.
[04] The trade-offs
[01]
[02]
[03]
[04]
[05] The build
[01]
Separate customer and operations deployments share auth, database and UI packages. Fifteen Mongoose models define the domain once.
[02]
Signup, medical intake, checkout, review, prescription and pharmacy handoff form one stateful pipeline. Royal Mail labels and tracking update the order directly; renewals and refunds are explicit branches.
[03]
A retrieval-augmented pipeline compares intake answers with treatment indications and contraindications, then gives the clinician a suggested plan and reasoning. The prescriber still reviews and decides.
[04]
Admin, pharmacist, doctor and marketing roles share one back office with server-enforced route permissions. Clinical data never depends on hidden interface controls for protection.
[05]
The marketing team manages blog and campaign content from the same admin without requiring an engineering release.
[06]
A phased dependency upgrade cleared every high and moderate finding across 1,127 packages. Query optimisation and edge caching also took 1.8 seconds off page load and 35% off API response time.
[06] The result
250+
Live subscriptions
* £19/mo base, 3- and 6-month plans
£31K+
Subscription revenue
* booked across those plans
-45%
Approval turnaround
* review to prescription, vs. manual handoff
-85%
Order despatch time
* after Royal Mail label + tracking sync
4
Back-office roles
* admin · pharmacist · doctor · marketing
Subscriptions and revenue are booked platform figures. The −45% compares clinician review with reasoned recommendations against raw intake; the −85% compares integrated Royal Mail despatch with manual labels and tracking. Both are before-and-after averages on the same flow, not controlled experiments, and not a guarantee for any single order.
[07] What I’d do differently
The dependency cleanup was reactive after 34 findings accumulated. I would enforce audit thresholds in CI so the graph cannot drift that far again.
Need something like this built?
Next case study [03]
Golegal
AI Legal Workspace
Read the case study →
