Prepare the environment

NEST Desktop is written in Vue.js (a web framework written in TypeScript), and also in TypeScript. The Vue code is transpiled to HTML5 and JavaScript Code. There are multiple ways to develop Vue applications, but my preferred way (and probably the most common one) to develop NEST Desktop is to use Node.js (and optionally Yarn). Therefore, if you do not use any of the container systems mentioned below, you will need to install Node.js (for Windows, an easy installation guide can be found here ), which gives you also the possibility to install Yarn.

Requirements
  • Node.js LTS (v22 or higher), Yarn

  • NEST Simulator 3.8 or higher

You can install these requirements in the host system.

First install nvm to install Node.js (https://nodejs.org/en/download/package-manager). For Linux developer:

# installs nvm (Node Version Manager)
sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 22

Then prepare the development environment with the required packages:

sudo apt install make g++
npm install --global yarn

Commands

Install node modules for NEST Desktop:

yarn install

Start a development server:

yarn dev

Note

The command yarn serve uses the configuration file vue.config.js. This file controls the threads used for the linting (the statical-syntactical code checks). With the default configuration, all available threads are used to minimize the build time. This might slow down other programs. There are cases where you cannot afford that and prefer a slightly longer execution time. In that cases, you can either adjust the number of threads in that file.This reduces the CPU load, but some CPU resources might stay unused. Alternatively you can execute the console in which you want to spawn the yarn command with a lower priority. On Linux (even on MacOS or Windows using WSL2 and an available shell command) this can be done using

nice -n 20 bash

This will spawn a new console inside your current console, but with the lowest processing priority possible, i.e. this console and its tasks do not block other tasks (like video conferences, etc.) significantly. Do not be confused that there will be no new window and no major visual cues that you are now in another process. In that console you can now execute the commands mentioned above.


Useful commands

Check if any node modules are outdated:

yarn outdated

Upgrade outdated node modules:

yarn upgrade

Optional: Build an environment with Apptainer

Get an Apptainer recipe:

wget https://raw.githubusercontent.com/nest-desktop/nest-desktop-apptainer/master/recipes/development/dev-node-22-alpine.def

The definition file dev-node-22-alpine.def contains an adequate environment to develop and build NEST Desktop.

Build an Apptainer image:

apptainer build dev-node-22-alpine.sif dev-node-22-alpine.def

Go to the shell inside the Apptainer container:

apptainer shell dev-node-22-alpine.sif