Overview

This guide helps you to get our solution to your city. It covers all steps from data aggregation, digitization, server configuration, example code customization, and the final release. Legal steps to take are not covered here. This project will not work entirely without money: You need to buy a server space (which costs money), and for marketing you will also spend some money e.g. to get an advertisement slot in the local newspaper etc.

As this is a digitization project this will not work without skills in working with Linux operating systems (Windows does not count) and modern technologies like SSH, SSHFS (not FTP), and Docker/Docker Compose. So you need to be a person familiar with these things, or you will need to learn.

Milestones

The creation of your very own Trufi App can be divided into four milestones:

  1. Digitize Public Transportation Routes
  2. Create the Back End
  3. Create Your Very Own Trufi App
  4. Release

Required Skills

It is required to have the following knowledge:

1. Digitize Public Transportation Routes

Get Public Transportation Routes

In order for the app to be able to guide the user we of course need the routes the public transportation vehicles are driving. There are two options for obtaining these routes: (A) Getting the data from the responsible government agency, or (B) gathering the transport data by yourself.

Option A: Getting the Data From the Responsible Government Agency

In a city with a collaborative government you should usually obtain this kind of data from an official source, for example Open Data portals, as found in countries with advanced transport networks (e.g. Germany). Usually the data will be in one of the following file formats:  GPX, GEOJSON, KML

If you are unable to work with these formats yourself then kindly ask us for help.

Option B: Gathering the Transport Data by Yourself

If your government or transport authority does not provide this kind of data described in Option A above, then they are missing out on the opportunities offered by Open Data.

Anyway you need to gather this data by yourself on the field. For places where internet access on mobile is a problem or is expensive, we recommend the Android App “GPS Essentials.” For places without any internet connection issues we can recommend Vespucci which enables you to digitize the route the bus drives on the fly into an OSM format while you’re sitting inside the bus. You then just need to do some fixes with JOSM on your computer prior to uploading to OSM. Mapping bus routes with Vespucci can save you time but it is also easier to make errors.

Please also ask your authority if they want to support you and your team somehow e.g. by hosting the community website, sponsoring a Linux server. Or if they want to work with Trufi, we also provide an app for transport operators that allows drivers to indicate if the buses are full and can take additional passengers. The data generated by our apps can help them to improve their public transportation infrastructure.

Adding These Routes to OpenStreetMap

We documented here how to add public transportation routes to OpenStreetMap. That tutorial collection is also available in Spanish and French. We recommend basic OSM and basic JOSM knowledge.

2. Create the Back End

Our app needs a back end and therefore internet connection in order to suggest routes and to display the background map. You may do that on a development server. Your development machine itself will be good enough for doing local tests and figuring out how everything works. Later on you will need to buy or rent a server (e.g. from DigitalOcean) which you will then use as the production server. The app you release to the public will connect to the production server.

Basic Linux command line and SSH knowledge are required.

Create the Necessary Data To Be Served Later by the Back End

We created a simple but powerful toolchain which eases that process. We call this toolchain trufi-server-resources. The data out is ready to be copied over to a development or production instance of Trufi Server Modules or Trufi Multi-Instance Server.

When to Execute the “GTFS Builder

The GTFS format contains the timetable of your public transportation routes in a digital machine readable format.

If your city is running informal public transport then the city government most likely can’t provide you with a GTFS, and you will need to create it yourself. This is common in cities in developing countries. If it applies to you, modify and run the GTFS Data Builder from Trufi Server Resources. Stick to the order of data builder execution as laid out in the README of Trufi Server Resources

If your city is running formal public transport then it will surely have a GTFS file, or the city can create it for you.

Most cities with formal public transport will upload their GTFS file to an Open Data portal. If that is your case you don’t have to execute the GTFS Data Builder; you just need to plot the GTFS file in “./data/<Country-City>/otp/data” in your trufi-server-resources instance. Name the file “GTFS.zip” or any name you want as long as it has the file extension `.zip` and contains the word “GTFS” in its file name.

Preparing the Server for Back-End Infrastructure

We created two different backend structures easing that process. Both are fully compatible with Trufi Server Resources so data generated there can be used directly.

  • Trufi Server Modules for all communities hosting for one city or big area. This setup is recommended for most users and can completely run under Docker on Windows. But for production use we still recommend Linux
  • or Trufi Multi-Instance Server for all communities hosting for one or more cities or (big) areas each having its own version of the app. We run this on our server as we provide paid services for several communes and some unpaid to communities.

Setting Up Production Linux Server

We recommend basic Linux command line and basic SSH knowledge.

Buy one e.g. from DigitalOcean and get started.

3. Create Your Very Own Trufi App

Customize the Template

The repo Trufi Core contains an explanation on how to customize the template at trufi-core/example.

App Testing

Test the app to see if the following works (at least):

  • It compiles without errors
  • It does not hang/crash while using it
  • It display a background map
  • It displays the requested routes

4. Release

Release the final app to the Play Store and Apple Store.

Want Help With Your App? Contact Trufi