TripMania
Your Perfect Trip Crafted by AI
The problem TripMania solves
✈ Wandr — AI Travel Itinerary Planner
Stop spending hours on Google. Get a personalized, day-by-day travel plan in seconds.
The Problem
Planning a trip is exhausting. A typical traveler spends 8–12 hours before a trip doing this:
- Googling "best places to visit in Manali"
- Opening 15 tabs of travel blogs written in 2019
- Cross-referencing Google Maps to check if places are near each other
- Manually building a day-by-day schedule that makes geographic sense
- Checking opening hours for each attraction one by one
- Finding out at the destination that a place is temporarily closed
- Repeating this for restaurants, hotels, and activities separately
The result is either a half-baked plan or decision fatigue before the trip even starts. Most people either over-plan and burn out, or under-plan and waste time figuring it out on-site.
Wandr solves this in under 60 seconds.
What It Does
Wandr is a full-stack web application that takes your destination, trip duration, group size, and travel vibe — and instantly generates a complete, ready-to-use travel itinerary powered by AI and real place data.
Input
- Destination — type any city, town, or region (or detect your current location)
- Travelers — how many people in the group
- Days — trip duration from 1 to 14 days
- Vibe — Adventure, Foodie, Relaxation, Culture, Nightlife, Shopping, or Family
- Budget — Budget, Moderate, or Luxury
Output
A complete trip plan with:
- Day-by-day schedule broken into Morning / Afternoon / Evening slots
- Real places with names, addresses, and ratings
- Live open/closed status for every place (so you never show up to a closed attraction)
- Walking/driving distances between stops so the route makes geographic sense
- Meal recommendations for breakfast, lunch, and dinner each day
- An interactive map with numbered markers for every stop
- Travel tips, safety notes, local currency, emergency numbers
- A downloadable PDF of the full itinerary for offline use
The Solution — How It Works
User Input
│
▼
Nominatim (OpenStreetMap)
│ Converts "Manali" → [32.24°N, 77.18°E]
▼
Overpass API (OpenStreetMap)
│ Fetches 25 real nearby places filtered by vibe
│ (temples, restaurants, parks, museums, markets...)
▼
Gemini AI (Google)
│ One API call — plans the full itinerary:
│ • Assigns places to days and time slots
│ • Writes day narratives and themes
│ • Adds meal recommendations and transport tips
│ • Generates trip overview, currency, language, tips
▼
ItineraryService (Spring Boot)
│ Assembles the response:
│ • Calculates real distances between stops (Haversine)
│ • Estimates walk/drive time between each place
│ • Applies open/closed status from OSM opening_hours
│ • Falls back gracefully if Gemini quota is exceeded
▼
Frontend (Thymeleaf + Leaflet.js)
│ Renders the itinerary:
│ • Interactive tabbed day view
│ • Live Leaflet map with numbered markers + route line
│ • Color-coded status badges per place
▼
PDF (iText html2pdf)
└ Generates a styled, printable PDF for offline travel
Key Features
🗺 Real Place Data — Not Hallucinated
Places come from OpenStreetMap via the Overpass API — a crowd-sourced database of millions of real-world locations. The AI only arranges and narrates; it doesn't invent place names.
🕐 Live Open/Closed Status
Every place card shows whether it's open right now, what today's hours are, or if it's temporarily/permanently closed — pulled directly from OSM opening_hours tags. Permanently closed places are filtered out entirely and never shown.
📐 Geographically Logical Routes
Stops within each day are arranged so nearby places are visited together. The Haversine formula calculates the real straight-line distance between every consecutive pair of stops and estimates whether it's a walk, drive, or taxi ride.
🤖 Gemini AI — Single Optimized Call
The entire AI plan (day schedule + narratives + tips + overview) is generated in one Gemini API call, minimising quota usage. If the quota is exhausted, the app falls back to a fully functional rule-based itinerary builder — the app never breaks.
📄 Offline PDF
The complete itinerary — including all places, times, addresses, open/closed status, meal suggestions, tips, and emergency info — is exported as a professionally styled PDF. No internet needed once downloaded.
🗺 Interactive Leaflet Map
A fully interactive OpenStreetMap-powered map shows every stop as a numbered, color-coded marker (color = day). Clicking a marker shows place details. A dashed gold route line connects all stops in order.
Tech Stack
| Layer | Technology | Why |
|---|---|---|
| Backend | Spring Boot 3.2 (Java 17) | Production-grade, widely deployed |
| AI | Google Gemini 2.0 Flash Lite | Fast, generous free tier |
| Places | OpenStreetMap + Overpas |
Challenges we ran into
Challenges Faced While Building Wandr
A honest log of every major problem hit during development and how each one was solved.
1. Google API Billing Wall
Problem: The project was designed around Google Places API, but creating a billing account kept throwing errors. Without billing enabled, the API key had zero quota — making the entire places layer non-functional before the project even started.
Solution: Replaced Google Places, Geocoding, and Static Maps entirely with free OpenStreetMap alternatives — Nominatim for geocoding, Overpass API for place search, and Leaflet.js for the map. No account, no credit card, no quota limits.
Lesson: Always validate whether your chosen API actually requires billing before building your architecture around it.
2. Overpass API — 400 Bad Request
Problem: Every call to the Overpass API returned a 400 Bad Request with the error Unknown type "%". The queries were being built correctly in Java but arriving at the server corrupted.
Root cause: URLEncoder.encode() encodes spaces as + and % characters as %25, but the encoded string was then being passed as a GET query parameter — which caused double-encoding. Overpass received %25 and %2B instead of the actual query characters.
Solution: Switched from GET + URL encoding to HTTP POST with application/x-www-form-urlencoded body (data=<query>). This is the correct way to call the Overpass API and completely eliminates the encoding issue.
3. Cannot resolve symbol 'client'
Problem: IntelliJ showed a red error on RestTemplateBuilder — specifically on the .connectTimeout() and .readTimeout() methods.
Root cause: Spring Boot 3.x removed these two convenience methods from RestTemplateBuilder. They were tied to the deprecated Apache HttpClient 4.x library which was also removed in Spring Boot 3.
Solution: Replaced RestTemplateBuilder with SimpleClientHttpRequestFactory, which uses Java's built-in HttpURLConnection. No external HTTP client dependency needed at all.
4. Gemini Model — 404 Not Found
Problem: After getting everything else working, every Gemini call returned 404 — models/gemini-1.5-flash is not found.
Root cause: gemini-1.5-flash had been deprecated and removed from the v1beta endpoint between the time the project was designed and when it was run.
Solution: Updated the model name in application.properties to gemini-2.0-flash-lite, which is the current lightweight model on the free tier.
5. Gemini 429 — Quota Exhausted
Problem: After fixing the model name, the app immediately hit 429 RESOURCE_EXHAUSTED with limit: 0. The original design made 5–6 separate Gemini API calls per itinerary request (one for the plan, one per day narrative, one for the overview), burning through the free daily quota in just a few test runs.
Solution — two-part fix:
- Reduced all 5–6 Gemini calls to a single combined call that returns the full itinerary, day narratives, tips, currency, and emergency info in one JSON response.
- Built a complete fallback itinerary builder that uses real OpenStreetMap places to construct a functional day-by-day plan without any AI — so the app never breaks even when the quota is zero.
6. PDF Generation Crash — iText CSS Error
Problem: Downloading the PDF threw a CssRuleSetParser exception: Invalid selector string: 400;700&display=swap.
Root cause: The PDF HTML template had a Google Fonts @import url('https://fonts.googleapis.com/...') at the top of the <style> block. iText's html2pdf tries to parse this as CSS and chokes on the URL string because it cannot make external HTTP requests during PDF rendering.
Solution: Removed the @import entirely from the PDF template. Replaced Cormorant Garamond and DM Sans with Georgia and Arial — fonts that iText has built-in support for. The PDF now generates cleanly with no external dependencies.
7. Also had itextpdf 5.x and html2pdf 4.x at the same time
Problem: The original pom.xml included both com.itextpdf:itextpdf:5.5.13.3 (legacy iText 5) and com.itextpdf:html2pdf:4.0.5 (iText 7). These are completely different libraries under the same group ID — they conflict at runtime and cause ClassNotFoundException errors.
Solution: Removed itextpdf 5.x entirely. html2pdf 4.x already pulls in iText 7 kernel, layout, and IO as transitive dependencies — nothing else needs to be declared.
8. Leaflet Map Not Showing — Blank Container
Problem: After generating an itinerary, the Trip Map section either showed nothing or rendered a grey/blank box with no tiles.
Root cause — three separate issues stacked on top of each other:
- The results section had
display:nonewhenrenderLeafletMap()was called. Leaflet measured the container as0px heightand built a zero-size tile grid. - The map
divhad no explicit height set — it relied on
Tracks Applied (2)
