Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.78 KB

File metadata and controls

57 lines (38 loc) · 2.78 KB

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.

Coverage Mozilla Observatory Grade

Junat.live mockup

Project structure

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:

  • site

    The site, built on Next.js and deployed to a VPS. Tested with unit tests and automatic Storybook integration tests.

  • packages/digitraffic

    A minimal wrapper for Digitraffic's REST endpoints. Also provides some extra features such as localized stations for Finnish and English.

  • packages/digitraffic-mqtt

    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}.`)
    }

Developing locally

Node.js version 20 is required; 20 and 22 are tested.

  1. Clone the repository.
  2. Junat.live uses pnpm for package management so you should have it installed. If you don't, you can simply run corepack enable to enable shims for it.
  3. Run pnpm install.
  4. Configure environment variables.
  5. For the first run running pnpm dev from the workspace root builds the packages.

License

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/.