S.M.I.L.E: booking and payments for a dental clinic network
Practice management for a multi-clinic dental network.



- 4NestJS services behind one gateway
- 5PostgreSQL databases, one per bounded context
- 145test files across the NestJS services and the front end
Overview
A practice management platform for a multi-clinic dental network: four NestJS services on Bun, one of them the API gateway, five PostgreSQL databases, Redis and a Next.js front end. I owned the parts where a bug costs a patient money or a seat.
Booking: two patients cannot claim the same doctor's slot, even with simultaneous requests, because the check happens in the database, not in application code. Availability updates in the UI in real time.
Payments: VNPay by QR or redirect, callback handling, refunds with an approval workflow, and payment history in the service's own database. A Redis-backed idempotency key means a retried request never charges twice; the VNPay callback is signature-verified and replay-guarded.
Identity: a standalone Python OCR service reads Vietnamese citizen ID cards, and the IAM service uses it to gate who may book. I also shipped a LangGraph booking assistant with Qdrant retrieval for clinic policy questions.
Retries and double bookings, simulated
0 payments created
0 marked paid
One dentist's Monday. Two patients press Book on 09:30 within the same millisecond.
- 09:00
- 09:30
- 10:00
- 10:30
A simulation of the rules the services enforce, not the live system. Keys and amounts are made up.