Skip to main content
Version: 5.x

Project Setup

The front-end (Graphical User Interface or GUI) of SODA is built with Electron, an open-source framework developed and maintained by GitHub that conveniently combines Node.js, HTML, CSS, and Javascript, while the back-end is developed in Python (v3.6). The application is inspired by a GitHub repository and a Medium blog. All source codes and files are shared with an open-source license (MIT) to permit user modification without restrictions. The folder structure for the source code is based on the Electron standards and similar to the Electron Demo Application.

Download source code from the GitHub repository​

Either download the zip folder from the GitHub repository or run the following command from your bash shell

git clone https://github.com/fairdataihub/SODA-for-SPARC.git

Prerequisites​

Installing C++ development libraries​

Windows​

  • Download Visual Studio 2017, run the executable file
  • In the installer, select β€œDesktop development with C++” and check β€œVC++ 2015.3 v14.00”

macOS​

  • Install Xcode
  • Refer here for installing 'brew' if your Mac doesn't already have it.
$ brew install gcc
$ brew cask install emacs

Linux​

$ sudo apt update
$ sudo apt install build-essential
$ sudo apt-get install emacs

Setting up your environment​

We use Anaconda to keep track of the high level dependencies required to create this application. The environment files required to generate the dev environment have been provided with the repository in the dev folder.

tip

Download Anaconda here: Anaconda Individual Edition

Each operating system requires its own environment to develop in. To facilitate this task we have provided platform specific environment files. Use the one that is relevant for your system.

For Windows
cd ./tools/anaconda-env
conda env create -f environment-Windows.yml
cd ../src/
conda activate env-electron-python
npm install
For macOS
cd ./tools/anaconda-env
conda env create -f environment-MAC.yml
cd ../src/
conda activate env-electron-python
npm install
For linux
cd ./tools/anaconda-env
conda env create -f environment-Linux.yml
cd ../src/
conda activate env-electron-python
npm install
caution

For Windows, you also need the win-node-env package. This should automatically have been installed as an optional dependency from the package.json but if it doesn't you can use the following command to add it to your project:

npm install -g win-node-env

Running the application​

You can now launch the application with the following command for all Operating Systems.

npm start
For Windows

For most instance just running npm start should be fine. However, you might sometimes need to run these additional instructions below to set up your environment.

# Delete 'node_modules' folder and package-lock.json (if present)
npm install -g node-gyp
npm config set python \path\to\python2.exe
npm config set msvs_version 2017
npm install
"./node_modules/.bin/"electron-rebuild .
npm start

If electron-rebuild . gives you an error, try deleting the .electron-gyp folder from your user profile and try again.

Installing packages​

Python​

For python packages we prefer that you use conda-forge if possible. This makes exporting your new environment file much easier. If a package that you require is not available here, you can also use pip to install your package.

conda install -c conda-forge <package-name>
pip install <package-name>

NodeJS​

You can use the vast library provided via npm to add any funcionality via JavaScript.

yarn add <package-name>

Language and framework versions​

The minimum required programming language and compiler versions are provided below. Please be aware that this is subject to change.

  • Python: 3.6
  • Nodejs: ^10.13.0

Was this page helpful?