How LearningML code is organized

With this post I start a series dedicated to the development of LearningML. The intention is to reveal, and at the same time document, how the tool has been built. I start by describing the organisation of the code at the repository level.

The LearningML platform consists of 7 code projects, each of them organised under version control in their respective gitlab repositories:

URL del proyecto en gitlabDescripción
https://gitlab.com/learningml/learningml-editorThe LearningML editor. This is where Machine Learning models are created and evaluated. From this same application you can access our Scratch clone to develop applications that use the model. So that we understand each other, it is this application.
The language used is Typescript and the framework is Angular.
https://gitlab.com/learningml/lml-scratch-guiThis is the Scratch graphical interface, modified for LearningML.
The language used is javascript and the React framework.
https://gitlab.com/learningml/lml-scratch-vmThis is the Scratch virtual machine, modified to support LearningML models. The virtual machine is the heart of Scratch, where all the blocks are defined with the language instructions, including the LearningML blocks.
The language used is javascript and the React framework.
https://gitlab.com/learningml/lml-scratch-l10nThis project contains the translations of the Scratch blocks, including those of LearningML and EchidnaScratch (in a future post I will clarify what this is).
The language used is javascript and the React framework.
https://gitlab.com/learningml/brain-bowBoth this project and the following one contain a series of functions necessary for encoding text in numerical vectors.
The language used is javascript.
https://gitlab.com/learningml/brain-textIdem
https://gitlab.com/learningml/learningml-apiIt is the software that makes it possible to create user accounts and store and share projects in the cloud.
The language used is Python and the Django framework.

The learningml-editor and learningml-api projects are completely original, while the three Scratch projects: lml-scratch-gui, lml-scratch-vm and lml-scratch-l10n are modifications of the original scratch-gui, scratch-vm and scratch-l10n projects respectively. In a future post on learningML development I will explain how the latest versions of the original Scratch are kept in sync with the modifications made for learningML. Finally, the code for brain-text and brain-bow is a hodgepodge of functions that I’ve picked up here and there on the net, especially from Stackoverflow. I must confess that these last two projects need a thorough reorganisation as many of their functions are not used in the current learningml-editor code.

Organisation of the branches of the learningml-editor project

In the learningml-editor project, two branches are maintained: main and develop. The first one contains the stable code that is deployed on https://learningml.org/editor, while the second one contains the code that will be part of the next release.

When a new feature is to be developed or a bug is to be fixed, the developer in charge of the task must fork the project and create a branch with the name of the feature in his local copy. Once he has finished the task he makes a push request on the develop branch of the original repository and, if everything works correctly, the changes are merged with the develop branch and later with the main branch, so that the changes will be ready in the next release. All this is explained in more detail in the CONTRIBUTING.md file.

Organisation of the branches of the learningml-scratch projects

In the lml-scratch-gui and lml-scratch-vm projects, two branches are maintained: main and echidna. The first one is the one containing the stable code that is deployed at https://learningml.org/scratch while the second one is the one containing the stable code deployed at https://scratch.echidna.es/. The latter is a modification of Scratch that, in addition to incorporating the LearningML blocks, allows the echidna boards to be programmed.

Scratch projects are expected to have fewer external contributions, so no develop branch has been created in the repository. However, if circumstances require it, it will be done.

About licenses

The self-made applications: learningml-editor and learningml-api, I have distributed them under a free licence called GNU Affero GPL. This licence is specifically designed to ensure cooperation with the community in the case of software running on network servers. The essential thing, apart from maintaining author attribution in case of modifications, is that if the modified application is deployed on a server, the new code must carry the same licence and be freely distributed.

The fundamental reason for choosing this type of licence is to make it possible to collaborate with other developers, companies or institutions to improve and evolve the project through the free software philosophy. In the CONTRIBUTING.md file of the project you can read the rules to actively contribute to the development of LearningML.

On the other hand, the lml-scratch projects carry an MIT licence. This licence is less restrictive, and does not oblige you to do anything. However, I have preferred to publish the code I have modified under the same licence. It is very important to realise what an enormous contribution to software development these licences make. Thanks to them I have been able to start from a block programming platform like Scratch, well known and stable, and adapt it to incorporate blocks compatible with the models built with LearningML.

And that’s all in this first entry, a general overview of how the LearningML platform code is organised. In future posts I will be explaining other aspects such as:

How the official version of Scratch is synchronised with the LearningML and Echidna modification.
The architecture of the Learningml-editor project.
The architecture of the lml-scratch projects.
The new functionalities that are being added to the project.
And all the things that come to my mind about the development of the platform.