Blog

Image present

21st April 2018

6 Open Source Government Projects You Need


GDS have been in business for many years now. They are the Government Digital Agency, and work to improve the various digital services offered by the UK Government. The best example of their work is the https://gov.uk website. Which is informative, useful, clear, and accessible. We’d argue it’s one of the best websites produced.

The great thing about GDS is that nearly everything they do is open source. This means they attach a license to their software that says you can use it as you like, and put it for free on the internet.

The upshot of this is that while the government has invested a significant amount of money building the tools that it needs, all of it is available on for free on the internet. Which is handy should you also happen to need the same tool.

There are two licenses that are typically used, MIT and Crown Copyright. Both permit the use of the software by any other person or organisation (including commercial use), but you must keep the license file attached.

Image cat

GDS has a certain style...

We've looked through over 800 different open source tools GDS have published, and we've found 6 great tools you can use for your company. Almost all of these tools are some form of API. The Gov.UK website is effectively a massive content management system (CMS) with some very advanced tooling. You can easily use these tools with you current CMS, and give it super powers without all the extra effort!

  • Transition & Bouncer
    This is actually a couple of different tools that combine to a really clever service. It is designed to help the government migrate from the multitude of old websites to gov.uk. It will help you manage all your 301 redirects from your old site to your new one. Transition is the tool to help you manage the redirects, and Bouncer is used to redirect the traffic.
    Source Code: https://github.com/alphagov/bouncer, https://github.com/alphagov/transition

  • Imminence
    So first off this is powered by MapIt, but could be easily adapted to use Google Maps. This is a simple service that allows you to manage lists of locations of things, then then query to 'find my nearest'. Maybe you have a lot of customer-service locations, or depots, or just offices. This service helps you organise the address data for them, and provides an API to find the nearest office to the user.
    Source Code: https://github.com/alphagov/imminence

  • GovUK Crawler Worker
    This is a super handy tool for offlining a website. The idea here is that the tool can be given a start URL, which it will begin crawling, store the page source to disk, then begin visiting linked pages. It can be restricted by host to prevent it drifting onto the wider internet. It is also a great example of using Go's Channels to do work. It's very dependent upon a particular queueing technology (GDS use Rabbit MQ), but swapping out for NSQ of similar should be straight forward. A great use-case here is to convert all your dynamic CMS pages to flat HTML, to be stored as an archive, or to build a static publishing mechanism.
    Source Code: https://github.com/alphagov/govuk_crawler_worke

  • Accessible Autocomplete
    Autocomplete is great, but make sure you do it for all your users. This handy little front-end component is designed to implement auto-suggest in a way that is accessible. So that the browser knows when options change and these can read out to users with screen readers.
    Source Code: https://github.com/alphagov/accessible-autocomplete

  • Fourth Wall
    This is a very useful utility for larger teams. It is used to notify you how long a given pull request has been open against your codebase. You can see which codebase (repository) is involved, who raised the requests, and how long it's been sitting, waiting for someone to review it. Honorable mention goes to `seal` which does something similar, but posts every day to Slack, reminding your team to keep getting their work reviewed.
    Source Code: https://github.com/alphagov/fourth-wall

  • GitRob
    Every developer knows the terror of realising they pushed some security credentials to the source control system. GitRob is a utility that can be run to check you haven't accidentally uploaded your AWS keys to GitHub by looking for patterns of files - i.e., your configuration files. This is a super useful tool that can be run as a script (i.e., automated) and set off alarms as soon as one of your team makes a mistake. Definitely one for the development team, but a fantastic safety net to work with!
    Source Code: https://github.com/alphagov/gitrob

There are also a few honorable mentions that we find a little more niche. These are also lacking a permissive license, but we suspect GDS would add one if asked.

  • Maslow is a tool for managing user needs, but it's quite tied into how GDS do things.
    https://github.com/alphagov/maslow - no license file is attached.
  • Search Analytics is for importing Google Analytics data into your system, so you can use it to power 'popular' features on your search results. Being able to feed analytics back into your CMS is great, but this requires quite a lot more work to integrate.
    https://github.com/alphagov/search-analytics - no license file is attached.

It is easy to see this as tool being given away for free. Really, developing in open source is to invite others to contribute. If you add a major feature to the code, remember to offer it back to GDS. They may have saved you months, and you may only save them years, but open source software is about contributing back to the community.

Not many of GDS's repositories are turn-key solutions. They all tend to rely on some other aspect of GDS's infrastructure or services. However, it's relatively simple to swap out these components (OAuth login is quite common) for whatever you need.

If you're interested in some of this functionality for your own team and need a little help getting started, feel free to drop Space Indent a line. We didn't build any of these wonderful tools, but we're a big fan. They are there to be used, so why spend the money rebuilding them?