Back to projects

Tourengenie

I built and operate Tourengenie, the software a Berlin maintenance company uses to plan its routes every day.

Role
Development and operations
Period
since August 2026
Status
live
Links
tourengenie.de
fewer routes
about 30 %
more maintenance jobs per route
about 50 %

Background

I built Tourengenie on my own for a maintenance company in Berlin and run it on my server. The company services sewage lifting stations for over 100 customers on a fixed schedule. The office used paper notes and lists to draw up the monthly plan. There was no suitable software for this work.

What Tourengenie does

Tourengenie turns due maintenance jobs into routes assigned to vehicles and days. When a customer accepts, cancels or reschedules an appointment, the software recalculates the plan. Confirmed appointments stay fixed. The dispatcher decides which appointments to arrange with customers.

Tourengenie planning view for December: on the left the month's tours by status, on the right tour 3 with six stops, driving and arrival times. Five stops are confirmed and locked, one is still open.
Fig. 1 The planning view: tour 3 is being agreed with customers; five of six appointments are confirmed and fixed.

Results

The company uses Tourengenie to plan its routes every day. The company reports that since the switch, it runs about 30 % fewer routes and completes about 50 % more maintenance jobs per route. The office no longer needs paper notes or lists for planning.

Planning

I model the whole month as a Vehicle Routing Problem (VRP). The model represents which vehicle visits which stops and in what order. I solve it with PyVRP, an open-source solver. A single run assigns maintenance jobs across all days of the month.

The lexicographic objective ranks the goals in a fixed order. First, the plan should include all jobs that are due. Next, it should use as few routes as possible. If plans use the same number of routes, travel time decides. Distance only decides if travel time is also equal. I also give overdue maintenance jobs priority according to their urgency levels.

An independent checker verifies each result by recalculating it. If the checker finds an error, Tourengenie does not publish the plan.

A fixed ranking in the objective Four rows, each with a rank number, a goal and a note on when that level decides. Rank 1: all due jobs planned, always counts first. Rank 2: as few tours as possible, if the same number of jobs is planned. Rank 3: as little travel time as possible, if the tour count is equal. Rank 4: as short a distance as possible, if the travel time is equal. A bracket on the right joins the four rows: a fixed order, each level outweighs all levels below. Rank 1 is highlighted. 1 All due jobs planned always counts first 2 As few tours as possible if the same number of jobs is planned 3 As little travel time as possible if the tour count is equal 4 As short a distance as possible if the travel time is equal Fixed order: each level outweighs all levels below
Fig. 2The goals in a fixed order. A level only counts when all levels above it are equal.

Replanning

Every change triggers a new planning run. Confirmed routes stay fixed within the confirmation window. The model reschedules the remaining maintenance jobs. This keeps the confirmed arrangements in place even if the plan for the rest of the month changes.

The calculation runs in the background. If several changes arrive close together, I group them into one run per month. I apply the result as an atomic update. The dispatcher sees either the old plan or the complete new plan, never a partial plan.

Dialog for moving an appointment at Hotel Seidel, currently Friday 4 December on tour 4. The recommendation is Thursday 3 December on the existing tour 5 with one minute of extra driving. The other days in the two weeks would each need a new tour with 66 to 76 minutes of extra driving.
Fig. 3 Moving an appointment: Tourengenie suggests days and tours and shows the extra driving time for each option.

Travel time cache

I need travel times between stops to plan the routes. I cache this travel time matrix in PostgreSQL. The entries are directed edges, with a separate entry for each direction between two stops.

When a location is saved, Tourengenie warms the cache in the background. If a new stop is added to n existing stops, the software only needs 2n more edges. These cover trips from the new stop to the existing stops and trips back. Recalculating the entire matrix would require n² edges. The travel times come from an external routing service. I batch the requests to keep costs as low as possible.

With cached travel times, replanning takes a few seconds. In the October measurement, a run with a warm cache took under two seconds. With a cold cache, it took about 16 seconds.

A new stop needs only 2n edges Square travel time matrix with seven rows and seven columns, cells of 22 pixels with three pixel gaps. The top left holds the six existing stops as a 6 by 6 field, filled quietly. The seventh row and the seventh column belong to the new stop and are the only accent area. The bottom right cell, new stop to new stop, stays empty. The axes are labelled: to on top, from on the left, new under the seventh column and beside the seventh row. The legend on the right reads: n existing stops occupy n² edges in the cache; a new stop needs only 2n new edges, there and back; recomputing the whole matrix would mean n² edges. to from new new n existing stops: n² edges are already cached New stop: only 2n new edges, there and back Recomputing the whole matrix: n² edges
Fig. 4A new stop only adds its own row and column to the travel time matrix.

Operations and infrastructure

I used a script to set up and harden my server, and I monitor it continuously. Development, staging and production run separately. Staging is the environment where I can check changes before the company uses them.

The CI/CD pipeline runs tests and security scans. The pipeline signs releases and deploys them automatically at night. If a deployment fails, an automatic rollback restores the previous version.

I write backward-compatible migrations so that the previous version can keep working with the database after a rollback. Before deployment, I test the migration against a copy of the latest backup.

From development to production Three boxes from left to right: development, staging, production. Above the first arrow: tests and security scans; above the second: signed release, shipped nightly. Below production lies the previous version in a dashed box. A dashed path runs from production down and back up with two arrow heads, labelled deploy fails: automatic rollback. Production is highlighted. Development Staging Production Tests and security scans Signed release, shipped nightly Previous version Deploy fails: automatic rollback
Fig. 5From development to production. If a deploy fails, the previous version runs again.

Company data

In production, Tourengenie uses the company's customer data. The application supports multiple tenants. I use Supabase and apply row-level security to every table in PostgreSQL. The database itself determines whether a tenant can see each row, without relying on the application to make that decision. I test these rules in CI.

Encrypted backups run every night. An automated restore test checks every month whether the data can be restored from a backup. Tests and coding agents have no access to production data.

Agentic Software Engineering

I built Tourengenie with AI coding agents. The agents work on branches. Each change goes through mandatory checks in a pull request. I use a fresh agent that did not write the change to review it.

Another agent checks the change in the running app. I approve migrations, changes to authentication and secrets, and releases myself.

Current status

Under the name Tourengenie, I am now testing the software with other companies.