Skip to main content
BlogNewsRelease NotesTechnical

Open sourcing the Mycroft Backend

By October 6, 2019 No Comments
Mycroft hearts open source

“You can’t claim to be an open source company unless all your code is open source.” This, or a variation of it, is something we hear a lot. All of the software running on a device using the Mycroft stack has been open source for years. But we have kept what we call the “backend” (web applications, APIs, etc.) in private repositories.

Why not make the backend open source? Well, something else we are often asked is “How does Mycroft make money if the software is free and the data collected is not sold?”. One potential revenue stream is leveraging our backend software. There was concern that open sourcing the code could prevent us from realising any of this revenue.

On the other hand, there are some benefits to releasing the backend code into the wild. One of these benefits is that Mycroft has a great community of developers contributing to our open source repositories. Mycroft is a small company so presenting the community with an opportunity to supplement our efforts makes a lot of sense. Making the backend code available to the public also shows that our code does what we say it does, a demonstration of Mycroft’s commitment to transparency and privacy.

So, we started asking ourselves if there was a way to generate revenue from our backend and make it open source. We wanted to go all Hannah Montana and get the best of both worlds

Enter the AGPL 3.0 license. I know this license has its fair share of detractors, but the arguments against it are usually not from the point of view of the small startup publishing the source code. In our case, this license allows us to make the source code available for anyone to use and pursue dual licensing when dealing with our enterprise customers.

Introducing… Selene

We call the backend product “Selene”, named after one of Mycroft’s aliases in The Moon is a Harsh Mistress, Adam Selene.  Selene consists of two repositories:

  • The selene-ui repository is three web applications written in the Angular framework (account, marketplace and single sign on). It is licensed under Apache 2.0. There is no business logic in this repository. It is purely a thin UI layer that displays the data retrieved from the API.
  • The selene-backend repository is a Python and SQL implementation of APIs, database schemas and scripts. It is licensed under AGPL 3.0. There are four APIs, one for each of the web applications in the selene-ui repository and the API used by Mycroft Core. This repository also contains library code shared by each of the APIs and the DDL necessary to build a Postgres database.

The README files in each repository give detailed instructions on how to setup your own instance of Selene. It is built to be lightweight. I can run the entire code base on my high-end laptop. In production, we run it on a handful of small virtual machines.

I know many of you have been looking forward to this for quite some time. As with all our open-source repositories, we appreciate any contributions no matter how big or small. On a personal note, the UI code represents my first foray into using Angular. I remember how awful my first lines of Python code were years ago. Feedback from any seasoned Angular developers out there would be appreciated!