node.js, npm, python3 and pip need to be installed. Server needs Python modules joblib and sklearn.
Ensure that .env, server.cert and server.key are present in the folder backend. .env should contain
MONGO_URI: Connection string to MongoDB Atlas or CompassAPI_KEYS: A comma-separated array of valid API keys accessed by the serverSERVER_HOSTNAME: IP address of the serverCLIENT_API_KEY: An API key that is already present inAPI_KEYS
.env.local should be present in the folders frontend/server_frontend. It should contain
VITE_API_URL: IP address of the serverVITE_API_KEY: An API key that is already present inAPI_KEYS
Both server and client need to be on the same network, either by having both devices on the same LAN or via VPN. Route traffic through TCP instead of UDP for reliable communication.
sudo ufw deny in proto udp from any to any
sudo ufw deny out proto udp from any to any
sudo ufw enable
NVM needs to be installed for the latest Node.js version.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
source ~/.bashrc
nvm install nodeSome packages nay not be available in the default repos, so these repos need to be added manually.
Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/google-chrome.gpg
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.listMongoDB
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.listcd model
pip install joblib scikit-learn==1.6.1 --break-system-package
cd ..
cd backend
npm install
node server.jscd frontend/server_frontend/src
npm install
npm run devcd backend
sudo node client.jscd frontend/client_frontend/src
npm install
npm run devThis section describes how a local Git server was configured using SSH so repositories can be cloned via IP address instead of GitHub.
On the server,
sudo apt update
sudo apt install openssh-server -u
sudo systemctl start ssh
sudo systemctl enable sshFind server IP Address.
ip aInitialize Git.
sudo adduser --disabled-password --gecos "" git
sudo su - git
mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
mkdir repos
On the client,
ssh-keygen -t ed25519 -f ~/.ssh/git_key -N ""
cat ~/.ssh/git_key.pubRemember this key.
On the server, create /home/git/check-access.sh and /home/git/permissions.txt. Give execution permission with
sudo chmod +x /home/git/check-access.shIn the file /home/git/.ssh/authorized_keys, add
command="/home/git/check-access.sh client_name",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty [PUBLIC_KEY]
where [PUBLIC_KEY] is the key from above, and client_name is the name of the client to map the key to.
On the client, clone a repo with
GIT_SSH_COMMAND="ssh -i ~/.ssh/git_key" git clone git@[SERVER_IP]:repos/repo.gitPush with
GIT_SSH_COMMAND="ssh -i ~/.ssh/git_key" git push