Use the following as a guide to install required modules when the automated setup script fails or is not available.
Install the Docker engine for various platforms by referring to the documentation here: [https://docs.docker.com/engine/install/]
Mac:
brew install npm
Ubuntu:
sudo apt-get install -y nodejs npm
sudo npm install npm@latest -g
Mac:
brew install postgresql
Ubuntu:
sudo apt install postgresql-client libpq-dev postgresql-server-dev pgadmin
Mac:
brew install nvm
mkdir ~/.nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo '[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh"' >> ~/.bash_profile
echo '[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && \. "/usr/local/opt/nvm/etc/bash_completion"' >> ~/.bash_profile
source ~/.bash_profile
Ubuntu:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.bashrc
For both Mac and Ubuntu:
- Navigate to the desired folder to clone the srt-api project.
- Then execute the following in the command line:
git clone https://github.com/GSA/srt-api.git
cd srt-api
git checkout dev
npm install
- Next navigate to the desired folder to clone the srt-ui project.
- Then execute the following in the command line:
git clone https://github.com/GSA/srt-ui.git
cd srt-ui
git checkout dev
npm install
- Set the following environment variables:
echo export NODE_ENV=development >> ~/.bashrc
echo export PGHOST=localhost >> ~/.bashrc
echo export PGDATABASE=srt >> ~/.bashrc
echo export PGUSER=circleci >> ~/.bashrc
echo export PGPASSWORD=srtpass >> ~/.bashrc
source ~/.bashrc
Mac:
pg_ctl start
Ubuntu:
sudo systemctl start postgresql.service
For both Mac and Ubuntu:
sudo -u postgres createuser circleci
sudo -u postgres psql -c "ALTER USER circleci WITH password 'srtpass';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO circleci;"
sudo -u postgres psql -c "ALTER USER circleci WITH Superuser;"
sudo -u postgres psql -c "ALTER USER circleci WITH CREATEROLE;"
sudo -u postgres psql -c "ALTER USER circleci WITH CREATEDB;"
sudo -u postgres createuser $USER
sudo -u postgres psql -c "ALTER USER $USER WITH Superuser;"
sudo -u postgres psql -c "ALTER USER $USER WITH CREATEDB;"
echo "Creating the srt database..."
sudo -u postgres createdb srt -O circleci
echo "Creating the srt tables..."
psql -d srt -f ../db/init/tables.sql
echo "Installing node 16..."
nvm install 16
echo "Set the environment to use version 16..."
nvm use 16
- During this installation you will be redirected to the SNYK website.
- Complete your authentication at SNYK before proceeding to the next step.
echo "Installing snyk..."
npm install snyk -g
echo "Authenticating snyk..."
snyk auth
- Navigate back to the top level of your srt-api folder
echo "Installing node modules..."
npm install
echo "Starting the server..."
npm run start