See Finnish train schedules in real-time. The site uses an MQTT connection to keep the data fresh and updates in a matter of milliseconds.
Pnpm workspaces with Turborepo is used to keep internal packages in sync. Each of the packages have their own suite of automated tests that can be run from the workspace root or the package in question. Documentation is available in the Wiki.
The repo consists of three main packages:
-
The site, built on Next.js and deployed to a VPS. Tested with unit tests and automatic Storybook integration tests.
-
A minimal wrapper for Digitraffic's REST endpoints. Also provides some extra features such as localized stations for Finnish and English.
-
Utilities for working with Digitraffic's MQTT APIs. For example, you can listen to trains just by initiating the client and asynchronously looping over any updates:
for await (train of client.trains) { console.log(`Train updated: ${train.trainNumber}.`) }
Node.js version 20 is required; 20 and 22 are tested.
- Clone the repository.
- Junat.live uses pnpm for package management so you should have it installed. If you don't, you can simply run
corepack enableto enable shims for it. - Run
pnpm install. - Configure environment variables.
- For the first run running
pnpm devfrom the workspace root builds the packages.
Copyright (C) 2026 Jasper Nykänen
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.