This is a full-stack web application that uses Oahu Transit Services' Web Services API to show real-time TheBus arrivals and bus locations, plus Skyline rail stations and schedules.
New domain: https://weadabus.com/
Deployed on Railway: https://weadabus.up.railway.app/
This project's goal is to see what could be built with the data offered from this API. Wea Da Bus puts TheBus's live arrivals and bus locations on a map of Oʻahu, so you can find your stop, pick a route, and watch the buses come to you.
This application is free to use, and the information available here could offer new perspectives. It is built mobile-first, for riders checking a phone at the bus stop, and it also works on desktop.
- Full-stack web application deployed with Railway
- Mobile-first design with a desktop layout, and a dark mode that follows your phone's setting
- Interactive map built with the Leaflet library and OpenStreetMap tiles
- Live arrivals and bus locations from the Oahu Transit Services / Web Services API
- TheBus GTFS schedule data (stops, routes, and route lines) stored in MongoDB
- Server-rendered pages, so arrivals show up quickly even on a slow connection
- Accessibility built in: keyboard-friendly map, and animations that switch off when Reduce Motion is on
- Link previews, so a shared stop or route link shows its name and a picture in messages
- Transportation news and @DOTHawaii's posts on X on the home page, saved by a scheduled job that runs every 15 minutes
- Recent stops: the home page remembers your last three stops on your phone and shows their next bus, with no account needed
- Installs to your phone's home screen and opens full screen, like an app
- Home: your last three stops with their next bus, then the newest news releases from the Hawaiʻi Department of Transportation (HDOT) and its latest posts on X. Tap a stop for its live arrivals, or a release to read it on HDOT's site. Clear recent stops forgets them.
- Add to Home Screen: in Safari, Share → Add to Home Screen gives Wea Da Bus its own icon, and it opens full screen like an app.
- Nearby: a map of Oʻahu. Tap Show stops near me to list the closest stops. The app asks for your location only when you tap. Zoom in to street level to see every stop as a pin, and tap any stop for its live arrivals.
- Routes: all 118 routes, listed as Skyline first, then letter routes, then number routes, with a filter box. Each route opens a map that shows:
- both directions in their own colors, solid for the direction you pick and dotted for the trip back, with light dashes that flow in the direction the buses travel
- the route's stops in order, and tapping a stop shows that route's next arrivals
- its buses moving live
- Search: can't find your bus in the list? The button at the bottom of the Routes page looks up any stop by the number on its bus stop sign.
- Stop pages: the next 2 hours of arrivals, with the next bus called out at the top. Each arrival says whether it's tracked live by GPS or only scheduled, canceled trips are marked, and the list refreshes every minute.
- Live buses: buses on a route glide to their newest position about every 30 seconds, and give off a small ring when they report in. Buses heading the other way are faded. Tap a bus to see where it's headed, how early or late it's running, and when it last reported its position.
- Dark mode follows your phone's setting.
- Live data: stop arrivals and bus positions from TheBus's Web Services API.
- Every call goes through this app's server, so the API key never reaches the browser.
- Results are cached for 30 seconds, so riders looking at the same stop or route share one call.
- Schedule data: stops, routes, and route lines from TheBus's GTFS feed, imported into MongoDB. A daily job checks whether TheBus has posted a new schedule and imports it on the day it starts, swapping it in without the site ever showing missing stops or routes.
- News: HDOT's news releases, from its RSS feed, and @DOTHawaii's posts, from the X API. A scheduled job saves the newest ones to MongoDB every 15 minutes, so the home page never waits on HDOT or X.
- Maps: OpenStreetMap tiles, drawn with Leaflet.
- Skyline: stations and scheduled times appear. TheBus's live feed doesn't include train positions yet.
- Search by stop name and route, not just stop number
- Accounts, so riders can save their usual stops
- An on-time tracker showing how reliably each route runs. Since October 2026, a job checks the buses every 5 minutes and records how early or late each one is running, counting only buses that are clearly driving their route.
server.js Express app: security headers, routes, error handling
config/ MongoDB connection
controller/ Page and API handlers
model/ Mongoose models: Stop, Route, RoutePattern, FeedImport, NewsArticle, XPost, ReliabilityHour
routes/ URL routing
middleware/ Input validation, rate limits, and the recent stops cookie
services/theBus.js The only code that calls TheBus's API
scripts/importGtfs.js Loads TheBus's GTFS schedule into MongoDB (a daily Railway cron job)
scripts/fetchNews.js Saves HDOT's newest news and X posts for the home page (a Railway cron job)
scripts/trackReliability.js Records how early or late buses run, every 5 minutes (a Railway cron job)
views/ EJS pages and partials
public/ CSS and browser JavaScript
- Install Node.js 22 or newer, then run
npm install. - Create a
.envfile using the variable names in.env.example:WEBSERVICESKEY: a TheBus API key. Register for one at https://hea.thebus.org/api_info.asp.DB_STRING: a MongoDB connection string.X_BEARER_TOKEN: an X API bearer token, used only bynpm run fetch:newsfor @DOTHawaii's posts. The X API is pay-per-use. Without a token, the job still saves HDOT's news.PORT,NODE_ENV, andSITE_URLare optional when running locally.SITE_URLis the site's public address, used for canonical links and link previews. It defaults to https://weadabus.up.railway.app.
- Run
npm run import:gtfsto load TheBus's stops and routes into MongoDB. Later runs skip a schedule that hasn't changed; add-- --forceto import it anyway. - Run
npm run fetch:newsto load HDOT's newest news and X posts for the home page. - Run
npm run devand open http://localhost:3000.
Route and arrival data provided by permission of Oahu Transit Services, Inc. Map data © OpenStreetMap contributors. News releases from the Hawaiʻi Department of Transportation. Posts from @DOTHawaii on X, through the X API.