-
Notifications
You must be signed in to change notification settings - Fork 9
Using the source code
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.
Pre-requisites: Anaconda (Python 3 version), Python 2
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
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”
Mac
$ brew install gcc
$ brew cask install emacs
Linux
- Install GCC and Emacs on Ubuntu
$ sudo apt update
$ sudo apt install build-essential
$ sudo apt-get install emacs
- Navigate to the tools/anaconda-env folder and create a conda environment from YML file – Managing conda environment
$ conda env create -f environment-<platform>.yml
(If “pip returned an error”, then activate the half-completed conda environment and manually install libraries using --user argument in pip (eg.- “pip install zerorpc –user”)
- Activate the conda environment (If you're on Windows, use 'Anaconda Prompt') and navigate to the 'src' folder.
$ conda activate <created env name>
- Delete 'node_modules' folder and package-lock.json (if present)
- Run the following commands:
// for windows only
$ 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
Note: 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
Note: if electron-rebuild . gives an error, try deleting the .electron-gyp folder from your user profile and try again.
- This should launch the application. You can now edit the code files in the 'src' folder and run
npm start
to see/test your changes