HealthLive on the App Store
iOS case study
MedicaProf Pro
The practitioner app of the MedicaProf platform: verified onboarding, clinics and booking schedules, appointments with video consultations and practice statistics for doctors in France and Syria.
- Client
- MedicaProf · France
- Role
- iOS Engineer · built and shipped the app
- Platform
- iPhone · iOS 17+ · English, Arabic & French
- Scale
- ~51K lines of Swift in 222 files · 24 features · 2 country backends



The challenge
Give doctors one app to get verified, set up clinics and booking rules, and run their day of appointments and video visits, without data from different accounts, flaky networks or two countries' rules ever getting mixed up.
What the app does
- Sign-in with email or phone and password, a backend-controlled OTP second step, trusted devices and optional Face ID / Touch ID.
- Country choice (France or Syria) that selects the backend and local rules: phone formats, the required verification document and weekend presets.
- Mandatory onboarding gates: upload a medical licence or RPPS document and follow its review, verify email and phone by OTP, and add a first clinic.
- Clinics with a map-confirmed location, consultation reasons and prices, a photo gallery with cropping, and password-confirmed deletion.
- A five-part schedule editor per clinic: booking rules, available dates, weekly hours, recurring breaks and cancellation policy.
- A month calendar filtered by clinic, with cancel and reschedule using slots generated from the clinic's schedule.
- A Today view grouped into morning, afternoon and evening, with a live starts-in / in-progress / overdue status for each appointment.
- TeleMed video consultations in the app, from 5 minutes before the start until 30 minutes after the end.
- A Home dashboard with badge counts, a notification centre, push notifications that open the right screen and live refresh while the app is open.
- Notes and tasks with instant updates, and activity statistics with a weekly bar chart.
- Profile, photo and cover editing, in-app search across screens, and English/Arabic/French with light and dark mode.
What I built
- A feature-modular SwiftUI architecture (MVVM, Use Case, Repository) on a hand-written async/await URLSession client, with no networking or DI libraries.
- Verified onboarding with country-specific identity rules for France and Syria, from document review to OTP checks and a server-forced password change.
- Secure sign-in: two-factor OTP, trusted devices and Face ID / Touch ID backed by device-only Keychain items that are wiped on reinstall.
- A multi-step Add Clinic flow that checks the server before retrying, so a lost response never creates a duplicate clinic, plus the five-part schedule editor.
- A client-side reschedule engine that computes free slots from availability, booking rules, buffers, breaks and existing bookings in the clinic's time zone.
- TeleMed consultations through Jitsi in a hardened web view that stores nothing and loads only approved hosts.
- Push notifications (APNs, FCM, backend) with in-app routing, a foreground WebSocket with keep-alive and backoff, and activity statistics with Swift Charts.
- A 103-item code audit, run with AI-assisted tooling under my review, with 100 findings fixed: concurrency races, time-zone bugs, decoding, accessibility and security hardening.
Under the hood
- Session generations: a new session ID on every login and logout, checked before and after each request, so a late response from a previous account can never touch the next one.
- An actor merges simultaneous 401 responses into one token refresh with a single retry, and a 401 caused by a wrong password never logs the user out.
- Logout clears credentials on the device first, then does remote cleanup with time limits, and forces a fresh push token at the next sign-in if that cleanup failed.
- Request IDs and generation counters are checked after every await, so stale results are dropped and cancelled tasks never show up as errors.
- Notes and Tasks update optimistically with temporary IDs, rollback and matching to the server copy, because the backend returns no IDs.
- A tolerant JSON layer handles inconsistent backend types, sends explicit nulls, converts Arabic and Persian digits (never inside passwords) and sends tokens only to the app's own API.
- Uploads run on their own session; images are downscaled with ImageIO, cropped and compressed off the main thread to a target file size.
- Push tokens are de-duplicated with a SHA-256 fingerprint, and the WebSocket reconnects after a token refresh with 2–30 second backoff.
- Runtime English/Arabic/French switching with full RTL and an Arabic font, on a token-based design system with Dynamic Type, Dark Mode, Increase Contrast and Reduce Motion.
- Release safety: four build configurations and two schemes for production and development, print() blocked at compile time, and a forced-update check.
Results
- Live on the App Store.
