Delivered remotely for a business based in Helsinki, Finland. Names withheld by agreement.
Project Overview
Outdoor treasure hunts bridge digital gameplay and physical foot traffic, turning city blocks, parks, and retail districts into interactive game boards. Unlike couch-bound mobile games, location-based experiences operate under unpredictable outdoor constraints: fluctuating urban GPS accuracy, battery drain from continuous polling, crowded pop-up venues, and bad actors attempting to spoof coordinates from home to harvest limited prizes.
This platform combines native Android (Kotlin) and iOS (Swift) player applications with a Laravel and PHP backend, a Blade and Bootstrap organizer portal, MySQL transactional storage, and Firebase real-time services. Organizers launch multi-stop hunts with custom geofences, timed clue drops, and sponsor rewards, while players explore neighborhoods smoothly without draining batteries or battling server lag at checkpoints.
Business Bottleneck
Experiential agencies and local event operators repeatedly run into technical failures when building location games on generic web wrappers:
- Battery exhaustion and sluggish geofence triggers: Continuous high-accuracy polling drains player phones halfway through a two-hour city trail, while coarse polling misses checkpoints entirely.
- Coordinate spoofing draining prize budgets: Without server-side velocity and device-integrity checks, rooted or mocked devices teleport across checkpoints and exhaust sponsor gift cards immediately.
- Oversold limited drops: Concurrent players arriving at a physical pop-up chest trigger race conditions when inventory counters lack atomic locking.
- Rigid campaign tooling: Hardcoding routes or clue media forces developer intervention every time a sponsor relocates a booth or adjusts opening hours.
Architectural Strategy
We chose native mobile fidelity paired with a pragmatic monolithic control plane. Kotlin and Swift clients leverage platform-native geofencing and sensor APIs so background proximity detection uses minimal power until a player approaches an active zone, at which point high-precision ranging activates briefly to guide the final meters.
On the server, Laravel serves as the single source of truth for hunt eligibility, anti-cheat verification, and MySQL prize inventory, while Firebase handles ephemeral real-time fan-out—pushing flash bonus drops, countdown hints, and live leaderboard updates across thousands of concurrent walkers.
Core Capabilities
- Geofenced Trails & Mystery Zones: Supports sequential clue chains, open-world multi-node hunts, and time-boxed flash treasure drops displayed on interactive native maps.
- Multi-Modal Checkpoint Verification: Combines GPS radius matching with optional QR scans or photo/riddle answers for indoor retail checkpoints where satellite lock weakens.
- Anti-Spoofing & Fair-Play Guardrails: Evaluates travel speed between check-ins, OS mock-location indicators, and cooldown rules before unlocking points or rewards.
- Sponsor Prize Vault & Redemption: Generates time-limited QR/PIN vouchers redeemable at partner storefronts or digitally, backed by real-time stock tracking.
- Blade & Bootstrap Campaign Studio: Gives organizers map-based pin placement, radius sliders, clue scheduling, and live participant heatmaps without leaving the web console.
Technical Architecture
Native Kotlin and Swift clients synchronize active campaign manifests via Laravel REST endpoints and cache clue assets locally in Room and CoreData for uninterrupted play through transit tunnels or dead zones. Firebase Cloud Messaging wakes clients for nearby bonus drops, while Firebase Realtime Database streams live leaderboard positions.
Flow: Kotlin (Android) & Swift (iOS) Native Apps ↔ Laravel PHP REST API & Blade/Bootstrap Portal → MySQL (Hunts, Check-ins & Prize Ledger) + Firebase (FCM Drops & Live Standings)
When a player enters a checkpoint radius, the native app bundles filtered GPS coordinates, horizontal accuracy, timestamp, and step-counter deltas into a signed check-in payload. Laravel validates travel plausibility against the player's previous check-in in MySQL, locks the reward pool row if a prize applies, commits progression atomically, and pushes updated rank snapshots to Firebase.
Technology Stack
| Category | Technology detail |
|---|---|
| Android Application | Native Kotlin using Fused Location Provider and Jetpack components |
| iOS Application | Native Swift using CoreLocation, MapKit, and background region monitoring |
| Backend API | Laravel (PHP) REST endpoints for hunt state, clue unlocks, and claims |
| Campaign Admin Portal | Laravel Blade views styled with Bootstrap for map and clue authoring |
| Relational Database | MySQL storing spatial coordinates, hunt progression, and prize stock |
| Real-Time & Messaging | Firebase Cloud Messaging and Realtime Database for live drop alerts |
| Anti-Fraud Telemetry | Device motion, speed-jump checks, and mock-location signal validation |
| Local Clue Caching | Encrypted on-device storage (Room on Android, CoreData on iOS) |
| Media & Map Assets | Compressed checkpoint badges and sponsor clue imagery served via CDN |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Cross-platform frameworks struggling with background OS geofence limits | Built separate Kotlin and Swift clients for CoreLocation and Fused Location access; accepted dual mobile codebases in exchange for reliable battery life and sensor precision. |
| Urban signal bounce causing false misses right outside a venue | Combined smoothed rolling GPS windows with configurable radius tolerances and optional physical QR fallback triggers inside participating stores. |
| Race conditions when multiple players reach a capped reward chest together | Enforced InnoDB lockForUpdate() transactions in MySQL around remaining prize counts instead of optimistic cache decrements. |
| Polling Laravel APIs draining servers during live city-wide events | Offloaded live leaderboard updates and flash-drop broadcasts to Firebase Realtime Database and FCM, reserving Laravel strictly for verified state transitions. |
Security & Reliability
Location games attract coordinate spoofing, replay attacks, and scripted reward farming. Both Kotlin and Swift apps sign check-in payloads with rotating session secrets and flag developer-mode mock providers or suspiciously static coordinate variance. Server-side, Laravel compares spherical Haversine distance against elapsed time between checkpoints; physically impossible jumps immediately quarantine the session for review without tipping off automated scripts.
In the Blade and Bootstrap portal, role-based access separates full campaign administrators from retail sponsor staff, who can only validate presented redemption codes and view their own store's foot-traffic tallies. Rate limiting and strict request validation protect Laravel check-in endpoints when crowds gather at a launch milestone.
Performance & Scale
On mobile devices, region monitoring registers only the nearest upcoming checkpoints within OS limits (such as iOS's 20-region ceiling) and dynamically swaps active geofences as the player advances along a trail. Clue illustrations and audio prompts pre-fetch on Wi-Fi or early in the route and stay cached locally, preventing cellular congestion when hundreds of participants converge on a finale plaza.
On the backend, spatial bounding-box queries indexed in MySQL filter nearby active hunts swiftly, while Firebase absorbs read-heavy spectator traffic for live event leaderboards without touching relational database connections.
Operational Outcomes
Combining native mobile location engineering with a structured Laravel and Firebase backend transformed outdoor activations from fragile stunts into repeatable campaigns:
- Dependable outdoor playability: Battery-aware CoreLocation and Fused Location pipelines keep players active across multi-hour city trails without premature power drain.
- Protected sponsor prize pools: Velocity heuristics and atomic MySQL inventory locks ensure genuine attendees claim rewards fairly.
- Rapid event operations: Marketing teams launch, relocate, and pause checkpoints through the Blade and Bootstrap portal in minutes rather than waiting on engineering deployments.
- Smooth finale surges: Separating Firebase live broadcasts from MySQL transactional check-ins keeps checkpoint unlocks responsive even when crowds converge simultaneously.