#!/usr/bin/env bash
set -e

APP_DIR=/opt/urology-followup-server

echo "[1/4] installing nodejs and npm..."
sudo apt update
sudo apt install -y nodejs npm

echo "[2/4] checking node..."
node -v
npm -v

echo "[3/4] preparing app dir..."
sudo mkdir -p "$APP_DIR"
sudo chown -R "$USER":"$USER" "$APP_DIR"

echo "[4/4] done. upload project files into:"
echo "$APP_DIR"

echo "then run:"
echo "cd $APP_DIR && npm start"
