Inspiration
Every road trip starts with the same question Google Maps can't answer: when should I actually leave?
You know the route. You've had it for years. What you don't know is whether leaving at 7 AM beats the school run, whether the afternoon sun will blind you on the mountain pass, or whether half of Slovenia is on a national holiday when you drive through on your way to the Adriatic.
WhenGo was born from that frustration. Not another navigation app — a departure intelligence layer that reasons over the signals Maps ignores: hourly traffic patterns, weather windows, daylight hours, and public holidays across every country your route passes through.
What it does
WhenGo takes a route, a date, and an optional departure window, then scores every hour of the day across four dimensions:
- Traffic — live and historical delay data from the Google Routes API, fetched per departure hour
- Weather — precipitation, wind, and temperature from Open-Meteo
- Daylight — sunrise/sunset timing, penalising night driving
- Holidays — public holidays not just at origin and destination, but in every country the route passes through, detected by sampling 19 waypoints at 5% intervals
Departure windows are ranked best-first. A Gemini-powered narrative explains why the recommended hour is best in plain language. A live traffic banner shows current or historically expected delays on your specific route. Elasticsearch stores every plan so the system can learn your preferences over time.
How we built it
The stack is deliberately cloud-native:
- Next.js 15 (App Router, standalone output) deployed on Google Cloud Run
- Vertex AI / Gemini 3 Flash for the trip narrative and departure reasoning
- Google Routes API (
TRAFFIC_AWARE_OPTIMAL) — parallel calls per candidate hour to get real hourly delay data - Google Maps JavaScript API for the interactive route map
- Google Places Autocomplete for location suggestions with keyboard navigation
- Elastic Cloud Serverless for saving and retrieving trip plans
- Open-Meteo for hourly weather forecasts
- Cloud Build for CI/CD — every deploy goes through
gcloud builds submit
The scoring engine weights each factor by travel mode: a cyclist cares more about rain than a driver; a motorist cares more about congestion. Past departure hours are automatically excluded when planning for today.
Challenges we ran into
Traffic API timestamps. Every Routes API call was silently returning 400. The error, buried in Cloud Run logs: "timestamps must end with 'Z'". Departure times like 2026-06-11T09:00:00 need an explicit UTC suffix — 2026-06-11T09:00:00Z. One character, 17 broken calls.
Holiday detection for thin transit countries. Sampling waypoints at 25/50/75% completely missed Slovenia on a Berlin → Poreč drive. Slovenia spans only ~13% of that route near the 85% mark. The fix was 19 waypoints at 5% intervals — enough resolution to catch even narrow transit countries.
Next.js standalone and static file serving. The Cloud Run build refused to serve a PNG from the public directory, returning 400 instead of the image. The workaround was routing the logo through a dedicated API route that reads and streams the file directly, bypassing the standalone static file handler.
React hook ordering. Adding state after a conditional return caused a cryptic React error #310 at runtime. All useState calls had to be hoisted to the top of the component before any early returns.
Accomplishments that we're proud of
- Per-hour traffic scoring using real Google Routes API data — not estimated, not guessed
- Holiday detection that covers transit countries, not just origin and destination — caught Slovenia on a Berlin → Poreč route that most tools would miss
- A live traffic banner that reuses already-fetched data to show current delays with zero extra API calls
- A planning progress screen with step-by-step feedback so users understand what the agent is doing while they wait
- A clean, opinionated UI that surfaces a single recommended departure time front and centre, with full reasoning behind it
What we learned
- The Google Routes API is powerful for per-hour traffic modelling — but it only works with UTC-absolute timestamps, not local time strings
- Sampling a route for transit countries requires much higher resolution than intuition suggests; three points is not enough for Europe
- Next.js
output: 'standalone'is excellent for Cloud Run but has real quirks: Sharp isn't available in Alpine images,revalidatecache options can break in standalone mode, and the public directory sometimes needs a workaround - Gemini on Vertex AI with Application Default Credentials is zero-config on Cloud Run — no API key needed, just the correct IAM role on the service account
What's next for WhenGo
- Return trip optimisation — score the best time to leave for the return journey on the same trip
- Multi-day window — compare departure on Friday vs Saturday vs Sunday for weekend trips
- Personalisation loop — use Elasticsearch to learn from rated trips and adjust scoring weights per user
- Mobile app — push a departure reminder when your optimal window is 30 minutes away
- More modes — motorcycle routing with weather-weighted scoring for mountain passes; bicycle routing with weather and wind scoring for exposed routes; walking mode with heat index and shade weighting for city trips
Built With
- elastic-cloud-serverless
- gemini-3-flash
- google-cloud-build
- google-cloud-run
- google-geocoding-api
- google-maps-javascript-api
- google-places-autocomplete-api
- google-routes-api
- next.js-15
- node.js
- open-meteo
- sunrise-sunset
- tailwind-css
- typescript
- vertex-ai
Log in or sign up for Devpost to join the conversation.