Delivered remotely for a business based in Atlanta, United States. Names withheld by agreement.
Project Overview
Industry: Local business directory and community media.
Solution scope: A native Swift iOS discovery app, public web directory, editorial publication engine, and merchant management portal unified on a Laravel and MySQL backend.
Context: Local directories fail when they feel like static phonebooks, and digital community magazines lose practical utility when readers cannot immediately locate or visit the businesses featured in their stories. Combining curated neighborhood journalism with an accurate, map-first merchant directory turns passive reading into real-world local discovery—provided both systems share reliable location data and disciplined moderation.
Directory & Publishing Bottleneck
Disconnected content and venue records broke reader journeys. Stories highlighting neighborhood makers, restaurants, and independent shops lived in static article templates with hardcoded addresses. Whenever a business relocated or updated seasonal hours, editorial pages went stale even if the directory had been corrected.
Unindexed location queries slowed map browsing. Filtering listings by neighborhood, category, open-now status, and proximity strained naive database queries as catalog depth expanded, causing sluggish map refreshes on mobile cellular connections.
Merchant self-service risked directory quality. Allowing business owners to update their own profiles directly without staging controls introduced formatting inconsistencies, keyword-stuffed descriptions, and broken map coordinates.
Multiple client surfaces complicated authentication. Supporting native iOS users, web readers, business owners managing claimed profiles, and OAuth-connected partner tools required clean token boundaries rather than ad-hoc API keys.
Architectural Strategy
Bind editorial stories to live directory entities. Articles embed structured references to canonical business profiles. Any update to a business's address, phone number, hours, or imagery propagates across both directory search results and every historical magazine feature that references it.
Split authentication cleanly across Sanctum and Passport. First-party sessions—native Swift mobile tokens and merchant web portal authentication—use Laravel Sanctum for minimal overhead. External OAuth2 integrations and partner applications authenticate through Laravel Passport with explicit OAuth scopes and refresh lifecycles.
Design geolocation search around viewport bounding boxes. Instead of computing full-table Haversine distances on every map drag, queries first constrain rows inside indexed coordinate bounds and apply exact ST_Distance_Sphere ordering only to the candidate subset.
Stage merchant edits through lightweight moderation. Claimed business owners edit freely inside a draft revision workflow, preserving live directory integrity until an editor signs off.
Core Capabilities
- Interactive map & neighborhood discovery: Native Swift iOS interface powered by Google Maps with dynamic pin clustering, custom category markers, radius filters, and instant list-to-map synchronization.
- Linked digital publication: Long-form editorial issues, neighborhood guides, and seasonal spotlights with embedded, tappable venue cards pulling live directory metadata.
- Merchant claim & revision portal: Verified business owners claim listings, manage operating hours, upload storefront photography, and submit profile updates into an editorial approval queue.
- Multi-provider OAuth & social sign-in: Seamless consumer onboarding on web and iOS using OAuth flows alongside email authentication, preserving saved favorites and curated lists across devices.
- Structured local web pages: Server-rendered Laravel directory pages optimized with clean URL hierarchies, semantic markup, and deep links directly into the iOS app.
- Editorial & advertising administration: Role-gated tools for managing featured placements, issue schedules, category taxonomies, and flagged listing reports.
Technical Architecture
API & domain layer. Built in PHP with Laravel, controllers are segmented into public catalog/editorial endpoints, Sanctum-protected consumer and merchant endpoints, and Passport-protected OAuth2 partner routes. Dedicated service classes handle geocoding normalization, operating-hours evaluation in local timezones, and revision diffing.
Spatial & relational persistence. MySQL stores business entities, multi-day operating schedules, category trees, editorial issues, revision snapshots, and user bookmarks. Composite indexes on status, category, and coordinate columns support low-latency bounding-box lookups.
Identity & access control. Sanctum issues scoped mobile access tokens for iOS users and session cookies for web portals, while Passport manages OAuth2 clients, authorization codes, and third-party partner permissions.
Native iOS client. Engineered in Swift, the mobile app pairs CoreLocation and the Google Maps SDK with asynchronous networking, image disk caching, and deep-link routing from web articles or push alerts straight to map pins.
Flow: Native Swift iOS app (Google Maps + CoreLocation) & Web UI → Sanctum / Passport OAuth gateways → Laravel API & editorial services → MySQL spatial & content tables → geocoding & CDN media pipeline
Technology Stack
| Category | Technology |
|---|---|
| Backend language | PHP 8 powering API, spatial query, and editorial services |
| Backend framework | Laravel handling directory endpoints, editorial CMS, and moderation queues |
| Database | MySQL with spatial coordinates, full-text indexing, and curated taxonomy tables |
| iOS client | Native Swift application built for smooth map interaction and offline bookmarking |
| Mapping & geolocation | Google Maps SDK for iOS and Geocoding/Places validation on the backend |
| OAuth2 authorization | Laravel Passport for third-party OAuth clients and external partner integrations |
| First-party API auth | Laravel Sanctum for native iOS token sessions and merchant web dashboard auth |
| Media pipeline | Server-side image resizing and CDN caching for storefront galleries and editorial spreads |
| Web frontend | Responsive server-rendered directory pages with structured schema markup for local SEO |
| Verification & testing | PHPUnit feature tests covering spatial queries, OAuth scopes, and moderation states |
Engineering Trade-offs & Solutions
| Challenge | Solution |
|---|---|
| Map panning triggered excessive API calls and database load on iOS | Added gesture debouncing plus a cached viewport-tiling strategy in Swift paired with indexed MySQL coordinate bounding queries. |
| Mixing external OAuth2 partner grants with first-party mobile tokens created security complexity | Isolated third-party OAuth2 flows inside Laravel Passport with strict scopes while keeping mobile and web sessions on Sanctum. |
| Business owners needed self-service updates without risking unvetted live edits | Implemented versioned draft revisions on listings so owners submit changes freely and editors approve diffs in one click. |
| Evaluating "Open Now" across businesses with split shifts and midnight closings | Normalized operating hours into minute-of-week intervals evaluated in the city's timezone rather than naive string comparisons. |
| Duplicate venues appearing from concurrent editorial imports and merchant submissions | Added server-side address normalization and coordinate proximity checks to flag probable duplicates before publishing. |
| Keeping native iOS map pins responsive alongside high-resolution editorial photography | Separated lightweight map-pin DTO payloads from full listing detail and gallery endpoints, with progressive image caching on iOS. |
Security & Identity Boundaries
Strict guard separation. Middleware enforces explicit authentication guards per route group so a consumer mobile token cannot access merchant revision endpoints, and third-party OAuth tokens remain restricted to granted read scopes.
Verified listing ownership. Merchant claim requests require domain-email verification or manual editorial validation tokens before unlocking profile management for a venue, preventing unauthorized hijacking of public business pages.
Input sanitization on rich editorial content. Merchant descriptions and editorial embeds pass through strict HTML allowlists on write, eliminating cross-site scripting risks across web views and native web-content renderers.
Operational Outcomes
- Cohesive media-to-map experience: Readers move effortlessly from neighborhood journalism straight to live directions, hours, and vetted storefronts on iOS and web.
- Trustworthy directory hygiene: Staged merchant revisions and coordinate validation eliminate stale addresses and duplicate map pins without slowing down business owners.
- Fluid native exploration: Swift and Google Maps clustering deliver responsive neighborhood discovery across dense commercial corridors and broad metro areas alike.
- Clean multi-surface extensibility: Separating Sanctum and Passport authorization layers allows partner integrations and new client surfaces to onboard without reworking core user security.