This web app is yet another variation on the "how can I possibly display the timetable for the 6 next trains in any way I can imagine" theme. This project started an AJAX and Javascript exercise for myself, but a handful of people have convinced me to make this public. Only this time, it tries to be classy. It is primarily intended for display on medium (tablet/desktop) or large screens (TVs), while trying not to break too badly on cellphones.

See it in action at http://monrer.fr/.


You will need the following Perl modules:

  • DateTime
  • DateTime::Format::Strptime
  • DBI
  • DBD::mysql
  • Dancer
  • Dancer::Plugin::Redis
  • LWP::Protocol::https
  • JSON::XS
  • RRD::Simple
  • Text::CSV
  • Template::Plugin::Decode
  • XML::Simple
  • YAML

You will also need git for the install.sh script to work.

Any kind of DBMS will do; however, you will need to load SNCF's rather massive GTFS data into it and therefore, I recommend MySQL, PostgreSQL or anything somewhat beefy. I have tested this with MySQL without any problems.


Copy config.yml.example to config.yml and edit it to suit your needs.

Log into an account with administrative access on MySQL and create the database holding the data:

mysql> CREATE DATABASE sncf_gtfs CHARSET utf8 COLLATE utf8_general_ci;

Create a user which only has the necessary privileges. This is optional, but highly recommended (not to mention a good security practice):

mysql> CREATE USER 'rer-web' IDENTIFIED BY 'some-password';
mysql> GRANT SELECT, EXECUTE ON sncf_gtfs.* TO 'rer-web'@'localhost';

Finally, run sh ./install.sh. This install script will download a GTFS parsing script, download the GTFS-formatted timetable data from SNCF's website, import it into the database, and import a custom-made station database as well.

Note: SNCF update their data once a week. In order to reimport the data, simply run ./install.sh again.


Deploy this as you would any Perl Dancer application. If you really have no idea how to do this, read the Dancer::Deployment Perldoc page.


This program is licensed under the 3-clause BSD license.

This program uses the following datasets supplied by SNCF under its Open Data License (in French):

This program also contains a custom database derived from the following datasets, also supplied by SNCF under the same terms: