Overview

Milestones

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

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

Required Skills

It is highly recommended 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 Backend

Our app needs a backend 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.

We recommend basic Linux command line and SSH knowledge.

Create the Necessary Data To Be Served Later by the Backend

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 ported over to a development or production instance of Trufi Server Modules or Trufi Multi-Instance Server.

Do I Need To Execute GTFS Data Builder To Generate GTFS?

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 it can’t provide you with a GTFS and you need to create it yourself. This is usually the case 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 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 Server for Backend 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 communities 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