Skip to content

Local installation for development

Michal Töpfer edited this page May 15, 2024 · 7 revisions

Installation on fresh CentOS 8, CentOS 7 or Ubuntu 18.04 LTS (local installation)

Most of the steps are the same as in the README.md file.

This will setup a locally accessible IVIS instance (primarily for development and testing). This setup should work on Linux machines as well as in WSL.

All endpoints (trusted, sandbox, public) will provide only HTTP as follows:

  1. Login as root. (We had some problems running npm as root on CentOS 7 on AWS. This seems to be fixed by the seemingly extraneous su within sudo.)

    sudo su -
  2. Install GIT

    For CentOS 8 type:

    dnf install -y git

    For CentOS 7 type:

    yum install -y git

    For Ubuntu 18.04 LTS type

    apt-get install -y git
  3. Download IVIS using git to the /opt/ivis-core directory

    cd /opt
    git clone https://github.com/smartarch/ivis-core.git
    cd ivis-core
  4. Run the installation script.

    For CentOS 8 type:

    bash setup/install-centos8-local.sh

    For CentOS 7 type:

    bash setup/install-centos7-local.sh

    For Ubuntu 18.04 LTS type:

    bash setup/install-ubuntu1804-local.sh
  5. Create file server/config/development.yaml and copy www and mysql configuration from server/config/production.yaml to server/config/development.yaml.

  6. Start the server for development (or run start.sh).

    cd server
    NODE_ENV=development node index.js
  7. Compile the client.

    cd client
    npm run build

    Or use incremental compilation (recompiles when files update).

    cd client
    npm run watch
  8. Open the trusted endpoint (like http://localhost:8080)

  9. Authenticate as admin:test

WebStorm debugging configuration

We recommend using WebStorm for development and debugging. This section will help you set up the debugging configuration for WebStorm.

Client

Compilation

The client needs to be (incrementally) compiled using the npm run watch command. The easiest way to set it up as a run configuration in WebStorm is to open the client/package.json file and click on the Run button (green arrow) next to the "watch" script (line 13).

In browser debugging

Create a new run configuration of the JavaScript Debug type and set the following properties:

  • URL: http://localhost:8080/
  • Remote URLs of local files:
    • add one entry with
      • File/Directory: client/src (the full absolute path might be necessary)
      • Remote URL: http://localhost:8080/

If this doesn't work (the execution doesn't pause at breakpoints), try changing the Remote URLs of local files to:

  • one entry with
    • File/Directory: client/src (the full absolute path might be necessary)
    • Remote URL: webpack:///./src
  • when working with a wrapper project around ivis-core, also add
    • File/Directory: ivis-core/client/src (the full absolute path might be necessary)
    • Remote URL: webpack:///../ivis-core/client/src

Server

Create a new run configuration of the Node.js type and set the following properties:

  • Node interpreter: select the correct Node interpreter. When working with WSL, you might want to use the Node interpreter from WSL: Add... -> Add WSL...
  • Working directory: server (the full absolute path might be necessary)
  • JavaScript file: index.js
  • Environment variables: NODE_ENV=development
Clone this wiki locally