Current state of the Dojo (part 1): architecture

Posted 02-08-2024 00:00:00 by Orestis Malaspinas ‐ 5 min read

This post summarises at a high level the techonological and architectural choices made for the Dojo project

Foreword

The Dojo project aims at providing a modular, extensible, decentralized, collaborative platform to perform programming exercises and reusing very widely adopted open source technologies. We think that this strong choice not only allows for a sustainable development, but also helps students familiarize themselves with very widely adopted tools that will help them in their future working environment.

The Dojo features

In this section we briefly describe the necessary features we think are needed by the Dojo and the technological choices we made.

The Dojo is split in three major parts that are the Dojo backend, the Dojo CLI, and the Dojo website. We will describe them below but first we quickly describe the desired features and some technological choices.

Desired features

The Dojo is a platform for teachers to propose programming assignments and for students to perform them as exercises for any computer science class.

Exercises can be performed in class or in a completely asynchronous manner and not related to any particular class. Therefore when an exercise is performed it must be evaluated quickly to give immediate feedback to the student as whether the solution is correct or not. One might also want to be able to give more complete feedback by using linters, static code analyzers, etc. Finally the completed exercises should be usable as a "portfolio" at any point in time by the student in an easy manner.

Students should be able to collaborate with their peers when performing an exercise, and should be able to ask for help from their teachers easily who should be able to quickly access the code in order to provide guidance. Students should be able to see solutions to the exercises proposed by either teachers or other students.

In order to encourage students to use the platform independently from classes, we want also to implement a part about gamification, that is currently under heavy development.

Gitlab based

With this in mind we wanted to use an environment that was as flexible, open and feature full as possible and therefore built the Dojo on top of the Gitlab infrastructure which offers the following great features:

  • Built on top of the git version control system which is nowadays a standard in the industry,
  • Offers CI/CD pipelines to evaluate automatically any kind of code (including unit tests),
  • Offers collaborative tools such as issue tracking, wikis, etc,
  • Offers an open API to handle repositories,
  • Can be self-hosted.

Therefore each assignment or exercise (see here for more info) for more details about the terminology) is nothing else than a standard Gitlab repository. Each repository is managed by the Dojo user, which is a special Dojo account on the Gitlab instance that has the permission to create/delete repos, adds users to repos, run CI/CD pipelines, etc. This special user is very important to manage the Dojo assignments and exercises and is strongly linked with the Dojo backend that we will briefly describe hereafter.

Since the Dojo assignments are nothing else than standard repositories one can interact with them as with any other repository by creating issues, branches, merge requests, etc which allows allows the students to familiarize themselves with tools and workflows commonly used in the industry.

The Dojo backend

In order to manage the communication with the Gitlab instance, the accounts of the user and their permissions (students, teachers, admin), assignments/exercises creation and deletion, search, etc., and other possible features (related to gamification for example) there is the need to store informations about the platform in a central database.

Although one could also directly interact with the Gitlab instance through the Gitlab API, we think that storing a reasonable amount of informations about the Dojo assignments and exercises inside a database greatly enhances the performance of the system while relieving the Gitlab instance from the load when searching assignments, checking exercise success rate, etc.

The backend is developed using the TypeScript programming language that is a modern alternative technology to pure JavaScript and was chosen for its type safety, maturity of the ecosystem, and large availability of libraries.

The Dojo CLI

The main way to interact with the Dojo is through the Dojo CLI which allows users authentification, assignment or exercise creation/deletion/edition, etc. The choice of the CLI seemed natural since it is a central skill for computer scientists to be able to use such interfaces in their everyday job. Also it removes some of the burden of developing first complete websites that, while being more user friendly for beginners, take much more time to develop since the UI/UX takes a large portion of the development.

The Dojo CLI is therefore responsible for handling the communications between the users, the Gitlab instance, and the Dojo backend and will always be the principal way to interact with the Dojo, while the web interface that undergoes heavy development currently will be mirroring the functionalities of the CLI.

Dojo CLI development

The CLI is also developed using TypeScript (as the backend) for uniformity of the technological stack. Currently only the most important features are implemented in the CLI. It handles all the important functionalities for authentification (login/logout), assignment (creation, publication, edition, deletion, etc.), exercise (creation, check for correctness, etc).

It now need a lot of quality of life extensions such as search, filtering, etc of assignment and exercises which are currently under heavy development. We believe that with the tutorial that exist it is relatively straightforward to implement new CLI features.

The Dojo website

To increase the use of the Dojo, we believe it is very important to offer a more beginner friendly interface such as a website. The website is currently under development and as pointed out in the previous section will mirror all functionalities from the CLI and render them in a more user friendly fashion.

The technogical stack will be based on angular.