Dokeza - Contributing to legislative bills

Client
Mzalendo Trust
We love abstract art

Mzalendo Trust is a non-partisan organisation that keeps an eye on Kenyan Parliament with a mission to facilitate public participation in Parliamentary processes through Information Sharing, Research and Networking.

In 2017, Mzalendo Trust, known as Mzalendo around the Civil Society circles, reached out to Red Afro, a software development and consulting firm that Afroshok works with. Mzalendo asked for a proposal to develop a web platform, where the Kenya public would be able to submit comments on the legislative bills being crafted by the Kenya Parliament.

We came up with the name, Dokeza, which in Kiswahili means, “to hint at, to suggest, to highlight”. We adopted this with a tag line of ‘Share your Idea’. We developed the brand identity, extended the Mzalendo Trust brand identity, to create room for sub-brands such as Dokeza.

We scoured the Web for a platform that is used in any country where the public are allowed to debate the contents of a legislative bill being developed by a body of political or legal technocrats. We were impressed to find Jadili, is an interactive a civic-engagement platform which offers technical capacity for public participation, hosted by Strathmore University in Kenya. It is based on a platform called Madison. Madison is a government policy co-creation platform that opens up laws and legislation previously off-limits to individuals and the Internet community. It was developed by The OpenGov Foundation, a non-profit that develops open source products for use in the federal and state governments of the USA.

By the time we were looking at the Madison code base on GitHub, we realised that it was not being actively worked on. However, we found the technology Madison used for annotating of documents. It used Annotator, an open-source JavaScript library, to easily add annotation functionality to any webpage. __

The Build – Version 1

For the first version of Dokeza, we developed an annotation system based on the Annotator library. We had the opportunity to add 3rd party plugins allowing the annotation of PDFs, EPUBs, videos, images and sound. Dokeza Version 1 - Bill page Dokeza was built using the Python-based web development framework known as Django. The Annotator library was interacted into the Django HTML template, and the data collected was stored in the user’s profile.

We went further and architected Dokeza following the 12 Factor Methodology. This was very important, considering the data and material we would be handling on the platform. Dokeza also needed to scale quickly in case of a spike in traffic incase a particular bill attracts attention.

Dokeza was officially launched on the Tuesday, 4th April 2017, and it was successful in strengthening Mzalendo’s parliamentary monitoring work.

Matters Arising

With time, as Dokeza grew, specific needs arose, and they needed to be addressed. These were:

Mzalendo came back to us and asked what it would take to collect the annotations and their respective comments and collate the comments in a specific bill, formatted into a Memorandum document, to be sent to the Parliament secretariat and submitted to the respective house committee.

The Research

We went together with the Mzalendo team to the Kenya Parliament Secretariat and later to The Kenya Law Reform Commission to see how we would receive the “official” versions of the legislative bills as they pass through the “reading” stages, especially the public participation stage. We found that only the Government Press could issue official documents, establishing one source of truth. Many official documents are put together using the Microsoft Word® file format and exported to PDF with their metadata. This detail comes in handy.

Document Formats

We believed that we would need to create a tool that is based on the Open Document Format, an international family of standards that is the successor of commonly used deprecated vendor specific document formats such as .doc, .wpd, .xls and .rtf. We found that there were toolkits for developers to use ODF on their preferred programming languages.

As we specced out the features of our new annotation application, we found out the while officially ODF is the ISO/IEC JTC1 SC34 (2005) certified document interoperability standard. However, Microsoft’s Office Open XML is the ISO/IEC 29500-1 and ECMA-376 standard, and is really the de-facto standard.

The entire Kenya government creates documents in OOXML formats using Microsoft Office, (thanks to the ubiquitous “Windows Packages” training in the late 1990s and early 2000s). We knew we needed a “free” OOXML solution for document handling, since we were not going to subscribe for a Microsoft Office licence for the Dokeza platform.

OnlyOffice

We were looking around for any document application suite that could be used to access OOXML documents and is open source. That is when we came across OnlyOffice. At that time, it did not cover all the API used to process OOXML, but it was good enough for what we wanted.

The Build – Version 2

The second version of Dokeza needed to have two important capabilities:

These two points were addressed when we found that OnlyOffice has a Document Builder that we could use to integrate it into Dokeza. However, there was no Python integration plugin, so we developed our own. We plan to submit our Python version through a “pull request” to the OnlyOffice’ Document Builder Integration Example code repository. Dokeza Version 2 - Bill page

Memoranda Module

We built the Memoranda module as a a tool that allows a Mzalendo assigned editor to compile annotations and comments contributed by the public around a particular legislative bill. There is a Bill Administration portal where a button is pressed and the comments are collated. Generate Memoranda view Once the button is clicked, a memoradum in DOCX is created and downloaded to the editor’s computer desktop. The editor can use any application that can open the Microsoft Word® document. Memoranda view NOTE: In case you do not have Microsoft Office on your computer, you can download a FREE office suite from OnlyOffice.

Alternitavely, the editors have their individual “desks” within their profiles where they upload the downloaded memoranda that has the automatically collated comments and make changes online. The desktop only accepts documents that can be converted to an OOXML document format. Desktop view Once the editors are done, all they do is press the “send memorandum” arrow button and off the memorandum goes.

Scaling Dokeza

During the development period, there was talk that instances of Dokeza would be deployed to support Kenya’s 47 county assemblies. In the process, we did some research and ran a dev instance of Dokeza, on Docker Swarm and a Kubernetes cluster, (K8s) on Canonical’s microK8s and later used skaffold to deploy a minimal K8s cluster on Digital Ocean. We used Portainer to carry out a CI/CD process using GitHub Actions to make changes to both the Docker Swarm and Kubernetes clusters.

This was an interesting exercise, and we found out that one really needs a big, complicated setup to justify a K8s cluster. If one must use K8s, then start with K3s or even K0s. 😁

Conclusion

We settled Dokeza to run off docker compose so that we can code our infrastructure and control the different environments — development, staging, and production. At present Dokeza has hundreds of daily users from all over the world.