Back to projects
Trainfo logo

A platform for Belgian train info from the NMBS/SNCB, built as a mono-repo of eleven cooperating services on top of the Belgian Mobility Company data.

11 services
Docker Compose
GTFS-RT

Trainfo is a complete platform for Belgian train info from the NMBS/SNCB. It runs as a Docker Compose mono-repo of eleven cooperating services that share a design system, Jinja templates and SQLAlchemy models. The data comes from the Belgian Mobility Company (BMC) through GTFS and realtime feeds, which are turned into fast and clear interfaces.

Trainfo preview

Tech stack

In short

Architecture

Data source

BMC GTFS BMC Realtime

Backend & API

TreinfoTracker accounts_service tracing_api

Frontend & UI

TreinfoWeb TreinfoMap TreinfoLogger TreinfoCatcher TreinfoTransfer TreinfoPlanner TreinfoSpoorbaron

The 9 services

Every service has its own role within the platform. Below you can read what each one does.

01 data & api
TrainfoTracker

Data owner, REST API and realtime worker.

This is the platform’s data owner. The service fetches the GTFS and realtime feeds of the Belgian Mobility Company (BMC), processes them into live departure boards and train compositions, and exposes everything through a REST API. A separate worker runs the realtime processing continuously in the background.

02 frontend
TrainfoWeb

The main web frontend for travellers.

This is the main web frontend where travellers land. It offers the liveboard, the train and station views, the journey planner and the current disruptions, all in the shared glassmorphism design.

03 map
TrainfoMap

Live map of NMBS/SNCB trains.

This service shows all running NMBS/SNCB trains live on a map. It consists of a tracing API that computes the positions and geometry, and a map frontend that visualises everything.

04 planner
TrainfoPlanner

Journey planner for train loops with a minimal number of rides.

This journey planner builds train loops and day plans with as few rides as possible. The service reads the rail graph read-only from Postgres, generates candidate loops and maps them onto the real timetable through the route planner.

05 logger
TrainfoLogger

Backend-For-Frontend to log trips and spottings.

This is a lightweight Backend-For-Frontend that lets you log your train trips and spottings. The service bundles data from the Tracker API, the tracing API and the account service.

06 game
TrainfoCatcher

Gamification to catch train types by location.

This is a playful app inspired by Pokémon Go. You catch NMBS/SNCB train types based on your location, giving train spotting a fun gamification layer.

07 util
TrainfoTransfer

Private file sharing in WeTransfer style.

This is a private file-sharing service in WeTransfer style for the Trainfo family. Uploading requires an approved account, downloading is account-free through a share link or short code, and files are cleaned up automatically.

08 game
TreinfoSpoorbaron

Rail management game in the style of Transport Tycoon.

This is a management game in the style of Transport Tycoon, built in vanilla ES modules without a build step. You build your own Belgian rail company, buy rolling stock, draw lines, plan timetables, manage depots and fulfil event contracts.

09 auth
accounts_service

Shared authentication and account service.

This is the shared authentication and account service. It handles registration, login and JWT tokens, and manages permissions for all apps in the Trainfo family.

Other project