A real-time bus departure display built with Next.js. Shows upcoming departures for selected bus lines at a chosen stop, with live updates and service messages.
- Real-time bus departure info from Entur API
- Weather information from yr.no - Shows current temperature and conditions
- Select stop and bus lines to display
- Shows delays and service messages
- Responsive, modern UI
- Customizable number of departures per line
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
Open http://localhost:3000 in your browser.
To find the stop place ID, use the Entur GraphQL Explorer:
- Entur GraphQL Explorer – Journey Planner V3
- Search for your stop by name and look for the
idfield in the results. - Tip: Use the search function and look for "id" in the response.
- On first launch, enter the stop place ID and select which bus lines to display.
- Choose how many departures per line to show.
- The display updates automatically every 30 seconds.
- Service messages (if any) are shown in a yellow bar under the relevant bus line.
- Ctrl + Shift + S is used to setup a new stop or change settings on current stop.
- Edit
app/page.jsxfor main display logic. - UI components are in
components/ui/. - Styles are in
app/globals.css.
Uses Entur’s Journey Planner GraphQL API for live data.
Weather data is fetched from the Norwegian Meteorological Institute's LocationForecast API (yr.no) every 30 seconds, displaying:
- Current temperature
- Weather conditions (clear, cloudy, rain, snow, etc.)
- Appropriate weather icons
- Default location: Trondheim (coordinates can be customized in the code)