What is TourVista?
TourVista is an AI travel guide for iOS and Android that narrates nearby landmarks, suggests itineraries based on the traveler's real-time GPS location, and keeps working offline. I was the Lead Flutter Engineer and mobile system architect, and the app went from architecture specification to release on the App Store and Google Play in 28 days.
What problems did the TourVista prototype have?
TourVista approached me with an early concept: an intelligent travel companion that could sense when a traveler was approaching an international landmark and automatically provide contextual historical storytelling, real-time translations, and tailored itinerary recommendations.
The initial prototype faced three severe production blockers:
- Response Latency: Waiting 2–4 seconds for OpenAI to generate complete paragraphs left users staring at loading spinners while standing directly in front of monuments.
- Connectivity Loss: In historic districts and underground tunnels, mobile connectivity dropped completely, breaking cloud-dependent navigation.
- Battery Depletion: Continuous high-accuracy GPS polling drained smartphone batteries within 2 hours of walking tours.
How was TourVista built? Architecture decisions and trade-offs
Three decisions fixed the prototype's latency, battery and offline problems: streaming AI responses instead of waiting for full replies, polling GPS based on movement speed, and caching landmark content on the device.
1. Server-Sent Events (SSE) Streaming vs. Standard REST
Instead of blocking on full JSON responses, I implemented real-time token streaming using Server-Sent Events (SSE) through an authenticated Firebase Cloud Function proxy. The first token arrives in under 500ms, giving the user immediate visual feedback as the AI narrator writes in real time.
2. Adaptive GPS Polling Engine
To solve the battery drain, I engineered a velocity-based location polling algorithm in Dart. When the device accelerometer detects the user is stationary or walking slowly (< 5 km/h), GPS polling frequency drops to every 60 seconds. When movement speeds increase (e.g., in a transit vehicle), polling dynamically scales up to 10-second intervals. This single optimization reduced background battery consumption by 35%.
3. Offline Geospatial Caching (SQLite & Drift)
When connected to hotel Wi-Fi, TourVista proactively downloads compressed vector polygon boundaries and synthesized audio clips for nearby landmarks. If network connectivity drops to zero, the app seamlessly falls back to the local SQLite database without displaying an offline error modal.
What were TourVista's results?
- Store Delivery: 28 days from initial architecture specification to production release on the Apple App Store and Google Play Store.
- Crash-Free Rate: 99.9% across live production releases.
- Perceived Latency: First words now appear in under 500ms instead of after a 2–4 second blank wait.
