The morio git repository
The source code for Morio is available as a git repository, hosted at:
- codeberg.org/certeu/morio (primary)
- code.europa.eu/certeu/morio (mirror)
It is a so-called meaning that it includes code for all the various components that make up Morio.
Quickstart
First clone the repository, then run the kickstart :
git clone git@codeberg.org:certeu/morio.git
cd morio
npm run kickstart
This will setup dependencies, and get your repository in a state that is ready to go.
Development environment setup
While the notes below are for Debian based systems, any Linux system with the required dependencies should make for an excellent development environment.
While we do welcome contributions from people who use MacOS or Windows as their development platform of choice, we do not provide support for these platforms as a development environment.
Install dependencies
Docker & git
To develop Morio, we’ll need docker and git, so let’s install those.
sudo apt install git docker.io
If you are on a different flavor of Linux, the docker package might have a different name. Alternatively, you can install from docker.com
Install NodeJS
While you can get away with minimal changes without NodeJS, any non-trivial development work will require you to have NodeJS on your system, since we rely on run-scripts to automate tasks within the repository.
We recommend using nvm to install NodeJS: https://github.com/nvm-sh/nvm
We will be using NodeJS 22, specifically the LTS release known as jod. So install it:
nvm install lts/jod
Optional: Install Go
If you want to contribute to, or work on, the Morio client, you will also need Go on your system.
To install Go, please follow the instructions on go.dev.
Clone repository
Via SSH:
git clone git@codeberg.org:certeu/morio.git
Or via HTTPS:
git clone https://codeberg.org/centeu/morio.git
Run kickstart
Enter the root of the repository and run:
npm run kickstart
This will install all (node) dependencies, and setup some repository specific things.
Rights to the docker socket
To run the development environment, we’ll be starting containers. This requires access to the docker socket.
Typically, you can grant yourself access by adding your user to the docker group:
sudo usermod -aG docker $USER
You will need to log out and back in for this change to take effect.
Alternatively, newgrp docker will work too.
Build the containers
The development environment will start (the development version of) a couple of containers. Before we can do that, we need to build them:
npm run build:dev
Permissions
The morio-ui container will need write access to the ui/.next folder.
For a quick fix you can run mkdir ui/.next && chmod 777 ui/.next in the
repository root.
We are planning to migrate away from NextJS, but for now, please make this manual change.
Start the development environment
In the repository root run:
npm run dev
You probably want to keep an eye on the docker logs of core to see what’s going on:
docker logs -f core
Or, to format the logs nicely, install pino-pretty:
npm i -G pino-pretty
Then pipe the logs into it, stripping some of the fields we don’t care about:
docker logs -f core | pino-pretty --ignore pid,time,hostname
That’s a lot of typing, so we have a for that:
npm run logs:code
And the equivalent for the morio-api container:
npm run logs:api
Structure
The repository has the following top-level folders:
ansible: Holds Ansible playbook for deployments, building artifacts, and testingapi: Holds the source code for the api serviceclient: Holds the source code for the Morio clientconfig: Holds configuration for various servicescore: Holds the source code for the core servicedocs: Holds the Morio documentationinfra: Holds infrastructure data, such as the scripts to install Moriomedia: Holds images and branding materialpkgs: Holds configuration and source code for the various packages we providescripts: Holds scripts to automate various tasksshared: Holds code shared between the api service and the core servicetap: Holds source code for the tap servicetests: Holds various testsui: Holds source code for the ui service