← All posts

Nenuzo, but trains

Nenuzo will soon have support for trains!

Long overdue

It's probably worth setting up the scene. It's 2018. I've finally gotten my first full-time commercial software engineer job (after about a decade of trying - yeah, trust me, it was tough for me to get into the industry).

Now, keep in mind that my in order to get to this job, I'm spending around 70 minutes on trains each way. On top of that, I have 20 minutes walk at either end, so each work day, I'm spending 20+70+20 = 110 minutes from leaving home to getting into the office, and then about the same in reverse at the end of the day. In essence, just over 3.5 hours of commuting every work day.

Relevant context: In the UK, you typically have a single train operator in each part of the country. There is not much in terms of choice. In 2018, Northern Rail (the rail company covering most of the North of England), they were having exceptionally bad service.

So, you can imagine how frustrating it was to get to the station and find out my train was delayed, cancelled, or there were 300 people sharing a shoebox-sized standing space.

In early summer 2018, I was introduced to React Native. Through a colleague of mine, I learned of Expo - ironically, on one of the days where we actually managed to get on the train. Maybe a week or so later, I'd built a small train time app called 'Panther'. I didn't have any idea what to name it, but I had to give it a name.

The idea was simple: Let me see train times with no nonsense. It worked. However, one thing it didn't do was let me see where a train was. Little did I know that this would become such a long-term goal.

In the years since then, I built over commuting apps. Railscope followed on from Panther, and then TheTransportLab followed a few years later. Each was an improvement, but none of them ever managed to deliver that holy grail of train location.

Why is it so difficult?

The main reason is that it's technically impossible. Train API's don't provide GPS for trains, so we don't get an actual fix on them. What we do have are live data feeds, specifically 'train movement', which is events for trains passing through certain parts of the track. There's also a 'TRUST' feed, which can be used for time estimates for services. These live data feeds are NOT GPS. You only get them once every few KM at most in many cases, so you don't know exactly where a train is between them, just that it's somewhere between the points. This is backed up by a lot of static data. Station locations, timetables, track geometry, etc.

Bringing all this together to create 'pseudo-GPS' is difficult. There's a lot of different moving parts to cross-reference. I tried to make it work with TheTransportLab, but couldn't figure it all out.

Fast forward to 2026 and now we have AI. AI is fantastic at spotting patterns, but it's also backed by knowledge of these datasets and how data links together. So, I spent essentially an entire weekend feeding data into AI and asking it to help research how things link together. It was a lot of fun, but ultimately I shelved it to focus on the bus parts of Nenuzo. I figured it was better to get a solid bus tracking app out, and then build rail into it later if it was feasible.

I'm pleased to say that the majority of the work for train position is now complete. There's a few quality of life and UX improvements to make still, but things are lining up.

In the app

Since we don't get actual GPS, we could resort to just displaying trains as they pass points, but that's a sucky UX. You'd lose track of them and they'd jump around. So, instead, we let the server provide us with an itinerary, which includes the stops + times, the route, and values which let it figure out how far between points it is. This information is periodically updated with new estimated times or movements.

Since we're running on that itinerary, we assume that's the truth. We might receive a message that the train passed a point further along. We could teleport it there, but instead, we increase the animation speed so even though it's unrealistic, it's able to catch up to where it was actually reported in a relatively short time.

When will it be available?

As I said earlier, there's a few QoL and UX improvements to implement. I also need to do actual real-world testing and potentially iterate from there. I'm hopeful that it'll be available within a few weeks, but it could be longer than that.

Ultimately, this feature has been 8 years in the making, and I am absolutely intent on making sure it can live up to the standards I set for myself.

What else will it bring?

Like buses, this feature will provide live activity and push notification support, but it's also integrating into the journey planner and search.

Future plans

The following are things I'd like to do, but I simply cannot guarantee.

First: Service notifications. Currently, the push notifications are setup the same as buses - "your train is [n] minutes away". My plan is to expand out to include cancellation and delay notifications for tracked services. Beyond that, I also want to allow people to 'subscribe' to regular trains. For example, your daily commutes - imagine if you could have live activities and push notifications start when your train is on the way. The architecture can already support this, it's just a case that the implementation for it isn't done yet. I could also expand this out to buses too.

Second: multi-modal and multi-leg journey planning. This is a big one. Currently, Nenuzo only supports 'direct' journeys. If you wanted to go from a bus to a train to another bus (multi-modal), it wouldn't support that. Likewise, if you wanted to go from 1 bus to another bus (multi-leg), it doesn't support that either. Supporting this functionality would be huge, but it's computationally intensive, especially for a country like the UK which has really dense transit networks.