Delivered remotely for a business based in Abu Dhabi, United Arab Emirates. Names withheld by agreement.
Project Overview
Combining interactive mobile gameplay with measurable sports performance tracking introduces two distinct engineering tracks: responsive client-side mechanics on iOS and Android, and rock-solid subscription accounting across two incompatible app store ecosystems. Working with a consumer sports-gaming venture in Abu Dhabi, we engineered a React Native mobile application, a React administrative portal, and a Laravel/MySQL backend on Google Cloud. The platform handles everything from real-time drill challenges via Firebase to end-to-end Apple App Store and Google Play subscription lifecycle automation.
Business Bottleneck
Subscription mobile products routinely leak revenue and frustrate paying customers when entitlement logic lives inside client code. Earlier builds could not reconcile asynchronous store events—such as family sharing changes, billing-retry grace periods, promotional offers, and user-initiated refunds—leaving support teams blind when players reported locked levels despite active bank charges. At the same time, releasing new sports training drills required full app binary submissions, delaying content cadence while review queues cleared.
Architectural Strategy
We decoupled content delivery, gameplay telemetry, and store billing into clean server-governed subsystems. The React Native client authenticates players via Twilio-verified phone onboarding and pulls structured drill packs dynamically from Laravel and Google Cloud Storage. Every in-app purchase passes through server-side receipt verification before unlocking entitlements in MySQL, while App Store Server Notifications v2 and Google Play Real-Time Developer Notifications via Cloud Pub/Sub drive an auditable subscription state machine. Live multiplayer challenges and re-engagement alerts flow through Firebase, and internal teams manage cohorts and content releases from a dedicated React web dashboard.
Core Capabilities
- Cross-Platform Game & Drill Engine: React Native delivers unified challenge loops, reaction timers, and sports performance scorecards across iOS and Android.
- Full Store Lifecycle State Machine: Tracks trials, active renewals, grace periods, billing holds, upgrades, downgrades, and refunds across Apple and Google Play.
- Dynamic Content & Challenge Publishing: Designers release new drills, scoring curves, and seasonal challenges via the React portal without waiting on store binary reviews.
- Realtime Leaderboards & Push Engagement: Firebase synchronizes live challenge progress and delivers targeted FCM notifications for streak milestones and friend invites.
- Phone-Verified Player Accounts: Twilio Verify secures account creation, prevents duplicate free-trial abuse across devices, and handles security alerts.
- Support & Entitlement Diagnostics: Customer support staff inspect exact store webhook timelines and manually resolve edge-case receipt disputes inside the React console.
Technical Architecture
Flow: React Native (iOS/Android) & React Admin -> Laravel API (Google Cloud) -> MySQL Entitlement Ledger <- Apple Server Notifications / Google Play Pub/Sub; Realtime Sync -> Firebase / Twilio
When a player initiates a purchase on iOS or Android, React Native submits the store transaction token to Laravel rather than unlocking features locally. Laravel verifies the signed payload directly against Apple's App Store Server API or Google Play Developer API, records the initial period in MySQL, and issues updated capability claims to the app.
Ongoing renewals, cancellations, and billing retries arrive asynchronously: Apple posts signed JWS payloads to a dedicated webhook route, while Google Play pushes messages through Google Cloud Pub/Sub. A queued Laravel processor verifies cryptographic signatures, normalizes both store vocabularies into unified lifecycle states (trialing, active, grace_period, on_hold, expired, revoked), and logs every transition in a subscription_events audit table. Meanwhile, active drill telemetry batches at session completion to MySQL while live challenge state syncs across participants via Firebase.
Technology Stack
| Category | Technology detail |
|---|---|
| Cross-Platform Client | React Native (iOS & Android interactive game loops and drill tracking) |
| Operations Web App | React SPA for cohort analytics, drill publishing, and entitlement lookup |
| Backend Core | Laravel (PHP 8) managing store webhooks, entitlements, and telemetry APIs |
| Relational Database | MySQL (Cloud SQL) storing canonical subscription state and performance logs |
| Realtime & Messaging | Firebase Realtime Database / FCM for live challenges and push triggers |
| Cloud Platform | Google Cloud Run/Compute, Cloud Pub/Sub for Play billing, Cloud Storage |
| SMS & Identity | Twilio Verify and SMS notifications for phone onboarding and security alerts |
| Store Lifecycle Engine | App Store Server Notifications v2 & Google Play RTDN reconciliation |
Engineering Trade-offs & Solutions
| Challenge | Architectural Solution |
|---|---|
| Divergent Apple and Google Play billing semantics | Normalized webhook adapter translating store-specific JWS and Pub/Sub payloads into one canonical MySQL subscription state machine |
| Repeated free-trial farming on reinstalls | Phone-number verification via Twilio Verify tied to trial eligibility checks before store offer presentation |
| Dropped frames during network telemetry calls | Local session buffering in React Native with asynchronous batch upload at drill completion instead of per-second API calls |
| Out-of-order store webhook delivery | Monotonic event timestamp and original-transaction-ID ordering checks so stale webhooks cannot overwrite newer entitlement states |
| Slow mobile release cycles for new sports drills | Data-driven drill definitions stored in MySQL/Cloud Storage and authored dynamically via the React operations portal |
Security & Reliability
Store webhook endpoints validate Apple JWS certificate chains and Google Cloud Pub/Sub bearer tokens prior to queue ingestion, blocking spoofed entitlement grants. Player authentication pairs Twilio OTP checks with short-lived API tokens, while sensitive administrative routes in the React dashboard require elevated operator roles and strict CORS enforcement. MySQL stores immutable event logs for every subscription state mutation, giving finance and support teams deterministic proof during chargeback or refund inquiries. Automated Cloud SQL backups and dead-letter queue alerts on failed store webhooks ensure no renewal or revocation notice disappears silently.
Performance & Scale
Gameplay responsiveness depends on keeping network round-trips off the critical interaction path. React Native caches unlocked drill assets locally with checksum validation against Google Cloud Storage, allowing athletes to train even with spotty gym or field connectivity and sync performance metrics once back online. On the backend, entitlement checks hit indexed user-capability columns in MySQL backed by short-TTL memory caching, while Firebase handles fan-out for live challenge updates without overloading relational database connections. Cloud Run and Compute Engine workers autoscale smoothly during weekend tournament pushes and scheduled workout reminders, preventing notification bursts or receipt storms from delaying interactive API traffic.
Operational Outcomes
Centralizing App Store and Google Play lifecycle tracking inside Laravel eliminated manual support guesswork around renewals, grace periods, and refunds. Product and content teams gained the agility to publish fresh sports drills and seasonal challenges directly through the React console without triggering app store review cycles. Players benefit from smooth cross-platform training gameplay, seamless multi-device account recovery, and accurate performance history tracking across every tier transition.