A live bus tracking app that shows real-time movement along popular routes in Surat, Gujarat. Built with R Shiny and Google Maps to simulate how public transit tracking works in the real world.
Watch a bus travel from Udhna Darwaja to Sachin GIDC, stopping at 10 major locations along the way. The red marker shows where the bus is right now, updating every 2 seconds. Perfect for understanding how transit apps work behind the scenes.
-
Install R packages:
install.packages(c("shiny", "shinydashboard", "googleway", "dplyr"))
-
Get a Google Maps API key:
- Visit Google Cloud Console
- Enable Maps JavaScript API
- Create an API key
-
Add your API key:
- Update
api_key.Rwith your actual key - Keep this file private (never commit to GitHub)
- Update
-
Run the app:
shiny::runApp()
Hit "Start Bus" and watch it move! The blue line shows the complete route.
app.R- The main applicationbus_routes.csv- Bus stop coordinatesapi_key.R- Your Google Maps key (keep private)
Built for a data science project, this demonstrates real-world transit tracking concepts using familiar Surat locations.