Getting started

Enroll for the developer program

To start development you need to enroll for the developer program first. This will enable your account to use Developer Mode. If you have not yet registered your account, you can do so with the following button:

Sign up

When account registration has been completed, you will receive a confirmation email. From that moment on you will have access to the SDK development environment (sandbox)

Developer Mode

Once you are enrolled in the developer program and you have access to the SDK development environment (sandbox), you can start with SDK add-on development.

Go to Sandbox

Go to the SDK development environment (sandbox), and start by navigating to the Developer tab in My Account to access the developer settings. Under these settings, turn on Developer Mode.

With Developer Mode on, your eLab environment has now been prepared to get started. But to start development, a local development enviroment also has to be set up.

Set-up SDK Development Environment

You need to set-up your development environment to be able to host add-ons from you computer on a https web server to make them available in the SDK Development environment. To set-up in Windows, proceed as follows:

Node.js requirements

Node.js version >= 16 or above (which can be checked by running: node -v).

You can use nvm for managing multiple Node versions on a single machine installed. When installing Node.js, you are recommended to check all checkboxes related to dependencies.

Installation of NodeJS

To host add-ons from you computer on a https web server, we make use of the NodeJS web server. To get started with NodeJS:

  1. Download the latest stable version of node.js from https://nodejs.org/en/download/
  2. Double click the downloaded node-vx.xx-x64.msi or node-vx.xx-x86.msi file to install NodeJS.
  3. After NodeJS has been installed, confirm the installation of NodeJS as follows:
    1. Open the start menu and press win + r
    2. Enter cmd and hit enter or click ok
    3. In the command prompt enter node –v and hit enter

If the installation of NodeJS is successful, the installed NodeJS version will be returned in the console.

$ node -v
V16.18.1

Setting up the https web server on your local computer

  1. Install the https-server package by entering npm install http-server –g in the command prompt window and hitting enter.
  2. Once the installation is completed you can start the server by entering the following command in the command prompt: http-server.
  3. After hitting enter the server will start and the command prompt will return several urls. These are the urls that are being hosted by the NodeJS web server.
$ http-server
Starting up http-server, serving ./
Available on:
  http://your.external.ip.adress:8080
  http://192.168.1.33:8080
  http://127.0.0.1:8080
Hit CTRL-C to stop the server
  1. Confirm that http server is running by copy and pasting one of the three addresses in your browser. Make sure to include the :8080 . The web browser will open the default root folder of the http server root folder (a folder on your local computer)

If you decide to stop the NodeJS you can either close command prompt or you can press CTRL+C while the focus is in command prompt. Note that once the server or the command prompt is closed the web-browser will no longer be able to contact the web addresses.

SSL passing of the http server

Since all communication in eLabJournal runs via a secured connection (https), the http sever should be using https. To make your web server use SSL proceed as follows:

  1. Download open SSL (download the correct version here)
  2. Navigate to the bin folder in the downloaded file and double click openssl.exe
  3. A command prompt window will open.
  4. Copy and paste the following command:
    $ req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 –nodes
    
  5. Two files key.pem and cert.pem are generated which are needed in the next step

Completing the SDK add-on hosting

  1. Create a folder on your local computer from where you would like to work (for example create folder eLAB-SDK on C:).
  2. Create a file called SDK-server.bat and include the following code to the file:
    http-server -S -C "cert.pem" -o -p 8443 and save the file.
  3. Move the generated files key.pem and cert.pem in the previous step to this folder
  4. Finally, move the downloaded SDK template script into the folder
  5. Once these 4 files are in the created folder, you can double click the created SDK-server.bat file. The command prompt will open confirming that the http server is running. Note that the server is serving over https and that the web addresses now start with https.
    $ http-server -S -C "cert.pem" -o -p 8443
    Starting up http-server, serving ./
    Available on:
      https://your.external.ip.adress:8443
      https://192.168.1.33:8443
      https://127.0.0.1:8443
    Hit CTRL-C to stop the server
    

Secondly, your default browser will open a window displaying the content of the folder you created including the SDK template script file.

Now you are all set to develop your own add-ons and extend the functionality of eLAB. Find the available classes and modules in the SDK documentation. The eLabJournal API is available here. The next step will show you how to load an add-on into eLab using an example add-on.