Skip to content

Latest commit

 

History

History
82 lines (60 loc) · 1.93 KB

File metadata and controls

82 lines (60 loc) · 1.93 KB

Following instructions are tested on a clean LXC container, created by:

sudo lxc-create -n aecad -t debian -B btrfs -- -r buster --packages nano sudo tmux git

Requriements

  • git
  • tmux
  • python-pip
  • bash-completion (recommended)

Preparation

  1. Install nodeenv:

    pip install nodeenv  # don't forget to add ~/.local/bin to your $PATH
    
  2. Clone this repository. Assuming you are at ~/some/path:

    git clone --recursive https://github.com/aktos-io/aecad
    cd aecad
    
  3. Create your virtual environment:¹:

    For Windows platform, follow these instructions first.

    $ cd ./scada.js
    $ make create-venv
    $ ./venv  
    (scadajs1) $ exit 
  4. Install required packages:

    $ cd ..   # now you are in ~/some/path/aecad
    $ make install-deps
  5. Open 2 different terminals and run those commands in each of them (or skip this step completely and proceed to #6):

    Terminal-1:

    $ ./scada.js/venv
    (scadajs1) $ (cd scada.js && APP=main make development)

    Terminal-2:

    $ ./scada.js/venv
    (scadajs1) $ (cd servers && ./run-ls webserver.ls --development)

6. (Optional) Use tmux:

  1. Add the following code to the ~/.bashrc:

    # For Tmux VirtualEnv support
    tmux_get_var(){
        local key=$1
        [[ -n "$TMUX" ]] && tmux showenv | awk -F= -v key="$key" '$1==key {print $2}'
    }
    
    # activate the virtual environment if it is declared
    venv=$(tmux_get_var "VIRTUAL_ENV")
    if [ -n "$venv" ]; then
        OLD="$PATH"
        source $venv/bin/activate;
        export PATH="$PATH:$OLD"
    fi
  2. Start the development anytime by:

    ./uidev.service`

7. Navigate to http://localhost:4001