Skip to content

Latest commit

 

History

History
executable file
·
71 lines (61 loc) · 1.8 KB

5.SetupSynchWeb.md

File metadata and controls

executable file
·
71 lines (61 loc) · 1.8 KB

SynchWeb Development Environment for Workstations

5. Setup SynchWeb

  1. Clone SynchWeb from GitHub

    cd /scratch/SynchWebDevEnvWS/server/www
    git clone https://github.com/DiamondLightSource/SynchWeb --depth 1

    Overview of SynchWeb directory structure:

    cd /scratch/SynchWebDevEnvWS/server/www
    tree -L 1 SynchWeb
    SynchWeb
    ├── api
    ├── client
    ├── docs
    ├── LICENSE.md
    └── README.md
    

    SynchWeb comprises two components:

    /api
    The back end API written in PHP.

    /client
    The front end web app written in JavaScript.

  2. Copy configuration documents

    cd /scratch/SynchWebDevEnvWS
    cp ./resources/config.json ./server/www/SynchWeb/client/js
    cp ./resources/config.php ./server/www/SynchWeb/api
    cp ./resources/class.auth-dummy.php ./server/www/SynchWeb/api/includes
  3. Install Composer
    Composer is an application-level package manager for PHP.

    cd /scratch/SynchWebDevEnvWS/server/www/SynchWeb/api
    wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet
  4. Install PHP dependencies with Composer

    cd /scratch/SynchWebDevEnvWS/server/www/SynchWeb/api
    php composer.phar install
  5. Install npm
    TODO

    cd /scratch/SynchWebDevEnvWS/server/www/SynchWeb/client
    module load node
    npm install
  6. Build
    TODO

    cd /scratch/SynchWebDevEnvWS/server/www/SynchWeb/client
    nano ./src/js/config.json
    Add "production": true,
    "build": <git hash>,
    
    npm run build
    
    Keep git hash in config.json current to avoid SynchWeb reload loop!
  7. Next : Control Servers