Inspiration

We closely observed and studied the Indian Railways system. From train scheduling to station coordinates, zones, and routes — we learned that a lot of data and logic powers the functioning of trains. This inspired us to build something meaningful using this information.

What it does

Imagine a user wants to travel across multiple locations in India, but there’s no direct train available between each of them. Our app helps users find multi-hop train routes — meaning, it suggests combinations of trains through intermediate stations to complete the journey across multiple destinations.
Even if a direct train isn't available at any segment, we intelligently detect nearby stations using geographical coordinates and help the user complete the route via a mix of trains and last-mile connectivity like cab/bus/auto.
We map the user's current location, detect nearby stations, and search through train sequences to suggest the best multi-hop combinations across the entire trip.

How we built it

We used Next.js for both frontend and backend.
The app uses Google Maps Place API and Directions API to geolocate the user and calculate distances.

We processed Indian Railways public datasets to extract station data (with lat/lng), train routes, and sequences.

To efficiently find nearby stations along the user's journey path, we:

  • Used Google Directions API to get the overview_polyline for the full trip (multiple places).
  • Leveraged rbush (a high-performance spatial index) and Turf.js to find the nearest railway stations across this polyline.
  • Filtered those results to select optimal stations to enter/exit the railway network.

We then built a custom algorithm that checks for:

  • Nearby stations (from the user, destination, and intermediate points)
  • Available train hops between them (multi-hop if needed)
  • Total time and distance optimization

The app is containerized using Docker and deployed using Google Cloud Run.

Challenges we ran into

  • Mapping and cleaning railway data — especially when many stations lacked geo-coordinates or had inconsistent names.
  • Building a robust algorithm to find valid multi-hop combinations with minimal wait time.
  • Optimizing Google Maps API calls to avoid quota limits.
  • Time constraints during the hackathon meant we had to hardcode the Maps API key (restricted to our domain).

Accomplishments that we're proud of

  • Built a complete multi-hop train suggestion engine using real Indian Railways data.
  • Learned how to use spatial/geographical logic in transportation planning.
  • Built a working, deployable web app with modern tech stack in limited time.

What we learned

  • How to work with real-world, messy data and normalize it.
  • Importance of spatial search (geo-distance, nearby detection).
  • Optimizing UX for map-heavy and data-heavy apps.
  • Deployment and CI/CD with Google Cloud Run & Docker.

What's next for Multi-hop train finder

  • Add real-time train status and delays using NTES API.
  • Improve search accuracy using user feedback loop.
  • Integrate ticket booking and travel time optimization.
  • Expand the tool to handle bus + metro + train as one unified trip planner.

Built With

Share this project:

Updates