Skip to content

Local Installation

Nicholas VanFossen edited this page Jan 2, 2024 · 4 revisions

The following guide will follow the steps of setting up an offline version of FTIR-SIS. These steps were tested and verified on an Ubuntu 22.04 virtual machine on 1st January 2024. Operating systems, toolkits, libraries, dependencies, and conventions change constantly. While the processes below will likely be similar in the future, things will inevitably change. At the Raston Lab, we strive to keep our documentation current, but things slip through the cracks. The best way to keep an open and public conversation about these issues would be to report directly to the associated repository on GitHub.

Prerequisites

The following should happen before attempting to run the FTIR-SIS. Depending on the approach selected, you may not need to perform all the prerequisite steps.

  1. Update operating system

    sudo apt update
    sudo apt upgrade
  2. Install git

    sudo apt install git
    git --version
  3. Install Docker Engine (for Docker setups)

    Install Docker Engine by following the official documentation: https://docs.docker.com/engine/install/ubuntu/.

  4. Install Node Version Manager (nvm) and Node.js (for Node.js setups)

    Install nvm by following the official documentation: https://github.com/nvm-sh/nvm#install--update-script.

    Install Node.js using the following commands

    nvm install --lts
    node --version

Front-end (Docker)

  1. Clone this repository

    git clone https://github.com/RastonLab/Virtual-FTIR-Spectrometer.git
  2. Move into cloned directory

    cd Virtual-FTIR-Spectrometer
  3. Edit src/dictionaries/constants.js to use proper API URLs (if setting up API locally, use localhost)

    export const FIND_PEAKS = "http://localhost:5000/find_peaks";
    
    export const BACKGROUND = "http://localhost:5000/background";
    
    export const SAMPLE = "http://localhost:5000/sample";
  4. Create image

    docker build -t ftir-gui .
  5. Build container

    docker run -p 3000:3000 --name front-end ftir-gui
  6. Once running, visit localhost (user interface should be present)

    http://localhost:3000/

Additional Docker commands

  • List containers

    docker ps -a
  • Stop container

    docker stop [NAME]
  • Delete container

    docker rm [NAME]
  • List images

    docker images
  • Delete image

    docker image rm [IMAGE-ID]

Front-end (Node.js)

  1. Clone this repository

    git clone https://github.com/RastonLab/Virtual-FTIR-Spectrometer.git
  2. Move into cloned directory

    cd Virtual-FTIR-Spectrometer
  3. Edit src/dictionaries/constants.js to use proper API URLs (if setting up API locally, use localhost)

    export const FIND_PEAKS = "http://localhost:5000/find_peaks";
    
    export const BACKGROUND = "http://localhost:5000/background";
    
    export const SAMPLE = "http://localhost:5000/sample";
  4. Install dependencies

    npm install
  5. Start applications

    npm start
  6. Once running, visit localhost (user interface should be present)

    http://localhost:3000/

Clone this wiki locally