We’re working heavily at present on our open-sourcing initiative.
Already our mobile apps and the Cyclescape project are open-source:
- iPhone (iOS) app
- Android app (on which we’ll be having a hack day soon – possibly in February)
- HTML5 mobile web app
- Cyclescape campaign group toolkit (plus deployment)
If you can help with any of those, or find the code useful, please do get involved!
The main site is not yet open-sourced, but work is in progress.
Our key aim here is to make it much easier to get other people involved. Over the last year we’ve had a number of enquiries from fellow cycling programmers about getting involved, but there have been very confusing aspects of the codebase – mainly very old code that had not been upgraded, and the setup has been difficult to say the least.
So our work at present is focussed on:
- Modularising the code much more, so that – for instance – people wanting to work on the interface don’t need to get a Python/C++ -based routing engine installed
- Setting up and securing a journey planner endpoint for the same reason (so that a repository download can work without the routing engine installed)
- Untangling key bits of code that have long been very problematic, even for us
- Splitting up classes further to reduce dependencies (currently there are over 150 classes and this is growing by the day – see screenshot below)
- Re-scripting various installation routines
- Making things more self-documenting
- Parametrising site-specific switches in the code related to specific non-core sites that we are paid to run
- Migrating to Git and then Github (we currently use SVN)
- Deciding whether any sections should be closed-source
We’re doing these before open-sourcing because – realistically – we simply do not have the time resource at present to hand-hold people through an installation process that is currently more difficult than it should be. We know from our experience from our hack day back in 2010, that any barriers here will stifle involvement. This is also forcing us to deal with some of the nastier architectural design flaws that have constantly held back some work.
Much of the code is actually in a reasonably good state, however. It runs on Windows, Linux or Mac OSX without changes (though getting the core routing component running on Windows might be interesting!). It is mostly in PHP5 (error_reporting=2047), written in a traditional class-interaction format (not MVC), though there are many established design patterns such as front controller pattern, a central application resource, common data formats, common class extension principles, all database interactions through an abstraction layer, etc.
A few key issues for us, once open-sourced, are:
- Whether we should aim to push people towards running a single, central installation, and encourage people from abroad to contribute funds and code towards that
- The extent to which we can realistically give any support for other sites (given that we’re pushed as it is to get everything done)
- The use of the name ‘CycleStreets’ if we give any support for sites we don’t control
- Maintaining quality-control of hosted sites that we are paid to run
- Ensuring that the Photomap isn’t closely-coupled with the journey planner
- Addressing the lack of test coverage
- Internationalisation work
We’d welcome any feedback (in the comments below) on these points. For us the key problem is time – and funding if the system is to expand to other countries!
We don’t yet have a timescale, but the code cleanup is going quite fast now, and in fact is accelerating, as the removal of hacks is making things quicker to deal with.
Screenshot of our current classes, where most of the code is: