🌏 Inspiration

Planning a trip in India usually means opening five or six tabs: one for trains, one for flights, another for buses, a hotel site, maps, and finally a pile of blogs and videos to figure out what to actually do each day. The tickets end up scattered across emails and SMS, and the "plan" lives in your head.

I wanted one place that takes you from "Delhi to Jaipur, 3 days, 2 people" to booked tickets plus a personal day-by-day plan, in a single flow.

🛠️ What it does

  1. Search once: source, destination, date, number of days, travellers, one-way or round trip.
  2. Compare and pick in three tabs: Travel (trains, flights, buses, onward + return), Stay (hotels and hostels with photos, map, amenities and house rules) and Where to eat.
  3. Book what you need: travel only, stay only, or both.
  4. Enter details once, pay once by UPI or card.
  5. Get everything delivered: PDF e-tickets and stay vouchers on email and WhatsApp, a My Trips wallet, and an AI itinerary built from the actual bookings (arrival time, hotel area, travellers' ages, diet and special requests).

Trains are live from Indian Railways: real trains for the route and date, real seat availability (AVL / RAC / WL) and exact fares.

🏗️ How I built it

  • Frontend + backend: Next.js (App Router) with React, TypeScript and Tailwind CSS. UI pages and API routes live in one app.
  • Database: PostgreSQL with Prisma for users, trips, bookings and an API-response cache.
  • Auth: email/password with bcrypt hashing and signed JWT session cookies.
  • Live trains: an IRCTC data API (via RapidAPI) for trains between stations, seat availability and fares.
  • AI itinerary: the booked trip is turned into a structured prompt, and the model returns JSON that is validated against a schema before it is shown. Moving this to the Gemini API is in progress.
  • Tickets and notifications: PDFs generated on the server with pdf-lib, email via Resend, WhatsApp via Twilio.
  • Deployment plan: Cloud Run, Cloud SQL, Secret Manager and Cloud Build on Google Cloud.
  • I used AI coding assistants to speed up development, while designing the product flow, testing every step end to end and making the product decisions myself.

Prices are always re-computed on the server at booking time, so the client can't tamper with them:

🚧 Challenges I faced

  • No public IRCTC API. Indian Railways doesn't offer an open booking API, so I used a third-party data API for schedules, availability and fares. Real ticket issuing still needs an authorised-agent licence, so bookings are a demo for now.
  • A tiny API quota. The free plan allowed only 10 requests per month. Naively, one search costs $$R_{\text{naive}} = 1 + \sum_{i=1}^{T} c_i$$ requests, where $T$ is the number of trains and $c_i$ the classes on train $i$. For one route with 19 trains and about 3 classes each, that's roughly $1 + 19 \times 3 = 58$ requests. I redesigned it so the train list costs 1 request (cached 24 h) and seats are fetched only when the user taps a class (cached 20 min). A search now costs $$R = 1 + k, \qquad k \ll \sum_i c_i,$$ where $k$ is the number of classes actually checked. When the quota runs out, the app falls back to sample trains per journey leg instead of breaking.
  • Coach-wise availability doesn't exist yet. Railways publishes coach-level vacancy only after the chart is prepared, about 4 hours before departure, so live trains show class-level availability like IRCTC does.
  • Reliable AI output. LLM responses can be malformed, so every itinerary is schema-validated, with a template-based fallback, so a booking never ends up without a plan.
  • Flexible booking. Supporting travel-only, stay-only and combined trips meant making every part of the system (pricing, PDFs, emails, WhatsApp messages and itinerary) work when a leg or the stay is missing.
  • Small details that broke things: standard PDF fonts can't print ₹ (so tickets use "Rs."), non-Latin names needed sanitising in PDFs, and Windows setup issues (.env files, PowerShell script policies) taught me to make the setup guide much clearer.

📚 What I learned

  • How to design a full product flow, not just features: search → select → details → pay → confirm → itinerary.
  • Working with real-world APIs: rate limits, caching, timeouts and graceful fallbacks.
  • Prompting for structured output and never trusting model output without validation.
  • Server-side validation for anything involving money.
  • Being honest about what's real and what's demo, and planning a roadmap to make the rest real.

🚀 What's next

  • Gemini API for itineraries, plus chat to edit a trip ("make day 2 relaxed") and plans in Indian languages
  • Real flight and hotel APIs, bus partners, and an IRCTC / B2B partner for actual ticketing
  • Razorpay live payments, launch on Google Cloud Run, and a mobile app

Built With

Share this project:

Updates

Submission history