Tramchester is a mobile web application Thoughtworks built to help people to navigate the public tram network in Manchester, UK. Ian Cartwright, a technical principal consultant on the project, talks to Suzie Prince about the project and what's next for the app.
Can you tell us how Tramchester got started?
Tramchester started as a short six-week innovation project which got out into the wild and we have been looking after it ever since.
For the project we were working on, we were given six weeks to investigate a new tool or technology. The tool we investigated was Neo4j, a graph database. We used Neo4j to model the tram network and calculated the best route between two tram stations using a path finding algorithm.
We wanted working software, in a production environment, at the end of the six weeks. There’s often a temptation to have manual steps or workarounds, but we were striving to show how something (like Neo4j) would work in the real world.
What has happened since Tramchester went live?
We’ve made it much easier to release a new version. It is much less hassle now: we just get a new timetable and upload it. When we first did the project some things were hard coded.
How often do you change Tramchester?
Maintenance activities are mostly triggered by tram timetable updates. The tram network continues to expand and they do a lot of work, so over time so we do have to accommodate those changes. When we see work happening on the trams, we will check for timetable changes.
Was there anything special you wanted from your tools to support this?
We knew we wanted to manage our deployments as part of our build process. We really wanted to do one click deployments.
In Snap CI, we have a dev, a UAT and a production environment. We have a compile/pass stage, a test stage, an upload stage, deploy to dev, deploy to UAT and deploy to prod.
What are the tools that helped you deliver Tramchester?
We started by using GoCD hosted on AWS. As we no longer have a core team and we are only investing a few hours here and there, we wanted a solution that was cheaper than a AWS instance and easier to maintain. Moving to Snap CI gave us a service running in the cloud. It’s ready to go, it’s maintained, and it’s kept up to date. From our point of view, it took away the need to maintain or patch our CI tool.
Also, we wanted a way to monitor build statuses in a secure way. With Snap, we got authentication for free and could easily and securely monitor the build status.
Security gets forgotten but it’s really important. The secure environmental variables Snap CI had for managing our credentials was really helpful. We were able to create a specific IAM user for Snap CI, and then lock it down so that it’s only got the bare minimum permissions it needs to deploy the app. Prior to this we had to do a lot of work to keep things secure. Security is now such a key focus: I consider this a “must have” feature. We are trying to maintain the principle of “least privilege” all the way through. Anything that makes it easier to manage credentials and security is very welcome to me.
Cloud formation was important. We have it so we can recreate the entire environment from an empty VPC up to an application, working in about 15 minutes. As we tag our resources we can also use Amazon’s cost explorer to see the cost by environment and even build number. So we can easily say “How much does build number 100 cost vs build number 98?”
We are also using CFNAssist which is an open source tool we wrote for another project. Originally when we did the deployments it was basically a bunch of shell scripts but now we have migrated to CFNAssist. It has let us delete a lot of the shell scripts and replace them with something that is a lot better tested.
How was Tramchester received?
I think people were excited to see a transport app specifically for Manchester, of course there are now far more of those available now. The idea of something that helped plan a tram journey was appreciated as well, as the tram network gets more extensive there are more options and hence more need for something that can help out.
[Thoughtworks and Tramchester won the Big Chip "Best Application of Technology" in 2014 for its use of graph database technology to make a transport app that was quicker, more efficient, and more flexible in the face of future demands.]
What’s next from Tramchester?
As the tram network continues to expand we need to look at usability again, the list of stations is getting very long! We are also looking at how other data sets could be loaded into the path finding solution, perhaps other cities or other types of transport.
This article was originally published on Snap CI's The Pipeline blog.
Disclaimer: The statements and opinions expressed in this article are those of the author(s) and do not necessarily reflect the positions of Thoughtworks.