Delivered remotely for a business based in Brisbane, Australia. Names withheld by agreement.
Project Overview
When a clinician calls in sick hours before an overnight ward rotation or an acute care unit needs rapid backup across a multi-campus hospital network in Brisbane, static monthly PDFs and manual call-around sheets collapse under pressure. Coordinators spend hours calling practitioners one by one, clinicians cannot verify their upcoming shifts while moving between dead-zone hospital corridors, and urgent response alerts lack proof of who acknowledged the call. We engineered a unified clinician scheduling, shift-matching, and urgent paging system spanning a Laravel backend, a web roster console, and native Java Android and Objective-C iOS applications equipped with local SQLite persistence.
Business Bottleneck
Care-team operations suffered from two tightly coupled failures: scheduling friction and alert ambiguity. On the scheduling side, broadcasting an uncovered shift via group emails or SMS triggered chaotic reply-all races where coordinators accidentally double-booked staff or assigned clinicians lacking campus-specific credentials or mandatory rest intervals. On the response side, urgent paging lacked closed-loop confirmation—dispatchers could not tell whether a clinician's handset was offline in a radiology bunker, silenced, or actively responding. Mobile tools also failed when staff walked underground corridors where live web views timed out.
Architectural Strategy
We decoupled authoritative roster state from real-time notification delivery and offline mobile read paths. MySQL holds the source of truth for campuses, credential matrices, fatigue rules, and shift assignments, while Redis enforces single-winner concurrency on shift claims and powers wave-based alert escalations. Both the Java Android and Objective-C iOS clients treat local SQLite as their primary UI data store, hydrating screens instantaneously offline and reconciling deltas whenever Firebase signals a state change or connectivity resumes.
Core Capabilities
- Rule-Gated Shift Marketplace: Unfilled shifts route only to clinicians holding matching specialty credentials, site inductions, and compliant rest gaps between adjacent rotations.
- One-Tap Swap & Coverage Requests: Clinicians initiate partial or full shift handoffs from mobile, subject to automated eligibility checks and coordinator approval workflows.
- Wave-Based Urgent Paging: High-priority alerts target designated campus responders first and automatically cascade to standby tiers if unacknowledged within strict SLA windows.
- Offline Roster & Directory Access: SQLite stores upcoming shifts, site protocols, and colleague call trees locally so staff never hit blank loading spinners inside shielded clinical zones.
- Multi-Campus Operations Console: Web dashboard for coordinators to visualize coverage gaps, override emergency assignments, and audit alert response timelines.
Technical Architecture
Flow: Android (Java) / iOS (Objective-C) with Local SQLite <-> Laravel PHP API -> MySQL (Schedules/Rules) + Redis (Locks/Waves) -> Firebase Cloud Messaging
Each mobile device registers an authenticated push token paired with its platform capabilities and OS notification permissions. When a coordinator publishes a gap or triggers an urgent response alert, Laravel evaluates target recipients in MySQL, pushes serialized jobs into Redis queues, and dispatches high-priority Firebase Cloud Messaging payloads. Upon receiving a high-priority data message, the Android Java service or iOS handler wakes local alert UI, persists the payload to SQLite, and posts an immediate delivery receipt back to Laravel.
Claiming a shift executes an optimistic client action backed by a strict Redis distributed lock (SET NX PX) in PHP. Once the winning clinician passes fatigue and overlap checks inside a MySQL transaction, Laravel clears the lock, writes the assignment, and fires silent Firebase invalidation messages so every other device removes the open vacancy from its local SQLite cache.
Technology Stack
| Category | Technology detail |
|---|---|
| Backend API & admin | Laravel (PHP) REST API and multi-campus roster management console |
| Central database | MySQL storing facilities, credentials, shift templates, and alert logs |
| Distributed coordination | Redis for atomic shift-claim locks, rate limiting, and alert queues |
| Android client | Native Java application with background wake-lock alert handling |
| iOS client | Native Objective-C application tailored for rapid shift and page response |
| On-device persistence | SQLite local stores on Android and iOS for offline roster and protocol access |
| Real-time delivery | Firebase Cloud Messaging (FCM) with high-priority data payloads |
| Conflict rules engine | Server-side credential, fatigue-window, and overlap validation in PHP |
| Background processing | Laravel Horizon-style worker queues for broadcast waves and digest sync |
| Monitoring & diagnostics | Delivery receipt telemetry tracking FCM handoff to mobile acknowledgment |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Native Java/Objective-C vs. cross-platform wrapper | Reliable background wakeups, custom notification channels, and strict battery-exemption handling for urgent clinical pages behave differently on Android and iOS. Native Java and Objective-C implementations gave direct access to OS power-management and SQLite lifecycle hooks without bridge latency. |
| Server-side locking vs. database unique constraints alone | Relying solely on SQL unique errors forces noisy exception handling and partial rule checks under broadcast spikes. Combining Redis short-lived mutex locks with MySQL row transactions kept conflict resolution deterministic and clean. |
| Full schedule sync vs. incremental SQLite deltas | Multi-campus rosters span thousands of shifts across weeks. Syncing by updated_at high-water marks and clinician-scoped subscriptions keeps mobile SQLite writes fast and minimizes cellular bandwidth. |
| Notification payload richness vs. data minimization | High-priority FCM envelopes transmit concise operational metadata and alert severity rather than sensitive patient identifiers, fetching extended response notes only over authenticated TLS endpoints once the app opens. |
Security & Reliability
Authentication binds bearer credentials to verified staff profiles, enforcing role-scoped authorization across campus boundaries so a roster coordinator in one facility cannot alter schedules in another without explicit multi-site permissions. All API traffic runs over TLS, while local SQLite databases store only operational shift metadata and encrypted session references—never raw patient records.
To prevent silent notification failures, the mobile clients periodically report push-token health and OS notification permission status to Laravel during delta syncs. Coordinators see an immediate visual warning on the web console if a scheduled on-call clinician has disabled critical alert permissions or holds a stale push registration.
Performance & Scale
Burst traffic concentrates around shift-release windows and urgent campus broadcasts when hundreds of clinicians open the app simultaneously. By reading schedule feeds against indexed MySQL views warmed via Redis cache keys and serving mobile UI views straight from local SQLite, API read pressure stays low even during shift-change peaks. Queued Firebase fan-out jobs batch recipient tokens cleanly and throttle retries with exponential backoff so transient network blips never block urgent escalation timers.
Operational Outcomes
Roster coordinators moved away from manual phone chains to deterministic, rule-verified shift matching across campuses, eliminating accidental double-bookings and credential mismatches. Clinicians gained reliable offline access to their schedules inside hospital dead zones and clear, closed-loop urgent paging that confirms when a colleague has actively accepted responsibility for an incident.