Files
ridebus-website/README.md
2026-10-02 20:31:49 +03:00

1.8 KiB
Raw Blame History

RideBus landing

Development

Use Node.js 24 or newer. Install dependencies with yarn install --immutable, then run yarn dev.

Next departures

Copy .env.example to .env.local and configure RIDEBUS_API_KEY with an authorized RideBus API key. The default API address is https://api.ridebus.by/; override it with RIDEBUS_API_BASE_URL if needed. Restart the server after changing environment variables.

The server route /api/departures reads the city catalogue, stops for the selected city, and ETA for the selected stop. Only normalized public fields reach the browser. The API key stays on the server. Cities are cached for one hour, stops for five minutes, and departures for 30 seconds; concurrent requests share the same upstream request.

Departure times use scheduledTime. Historical delay is removed from the ETA countdown, so the board consistently displays timetable information. The board refreshes every 30 seconds while the tab is visible and shows an unavailable state when the API connection has not been configured. It never substitutes sample data.

The city and stop menus use the landing’s custom menu style. Long catalogues have search and a bounded scroll area. Stops with the same name share one menu entry; direction chips retain their separate stop IDs and use the API’s stop description. Countdown labels show hours and minutes. Menus support keyboard navigation and Escape, and interface animations respect reduced-motion preferences. The homepage FAQ explains the timetable and links to the contribution page.

For Docker Compose, supply RIDEBUS_API_KEY and optionally RIDEBUS_API_BASE_URL through the shell environment or a local .env file. Environment files are excluded from the image build context. Do not commit credentials.

Checks

yarn test
yarn typecheck
yarn lint
yarn build