Healthcare / Fintech2024Backend Developer
Clinic Booking Platform
Healthcare appointments + payment gateway
Laravel 11PHPLaravel PassportMidtransXenditStream ChatFirebaseAWS S3MongoDBTailwind CSSDocker + Supervisor + Nginx
Problem
Dental clinics in Indonesia need:
- Online appointment booking with doctor specialization matching
- Self-screening questionnaires before consultations
- Payment processing supporting Indonesian gateways (bank transfer, QRIS, GoPay)
- Real-time chat between patients and clinic staff
- Separate admin dashboard for clinic owners to manage operations
Solution
A dual-backend healthcare platform:
- Backend API: Patient-facing APIs — booking, self-screening, payment, chat (5 modules)
- Backend Admin: Clinic management — doctors, schedules, patients, reports (16 modules)
- Payment Flow: Midtrans (primary) + Xendit (secondary) with unified transaction abstraction
- Real-time Chat: Stream Chat SDK with webhook integrations
- Infrastructure: Docker Compose with supervisor processes and nginx reverse proxy
Key Tech Decisions
Dual backend architecture
Separating the patient-facing API from the admin backend prevents:
- Admin traffic spikes from affecting patient experience
- Auth scope leakage between roles
- Deployment coupling — API can scale independently
Payment gateway abstraction
Built a PaymentGateway interface with MidtransGateway and XenditGateway
implementations. Each payment method (bank transfer, e-wallet, QRIS) maps to
the appropriate gateway and channel. New gateways can be added without touching
business logic.
MongoDB for chat metadata
Used MongoDB for chat message storage instead of PostgreSQL because:
- Chat messages are semi-structured (varied content types)
- High write throughput with low query complexity
- Stream Chat syncs via webhooks, not direct DB queries
Metrics
| Metric | Value |
|---|---|
| Backend Modules | 21 (5 API + 16 Admin) |
| Payment Gateways | Midtrans + Xendit |
| Deployment | Docker + Supervisor + Nginx |