Unraveling Human Predictability
Install the required npm packages:
cd frontend
npm install
Install the required rust packages:
cd backend
cargo install cargo-watch
cargo update
Setup the environment variables:
cd backend
mv .env.example .env
# Set the environment variables in .env
To start auto compiling of js, scss and html files run:
npm run watch
Start a new terminal. Then start the server with auto reloading on changes with:
cargo watch -q -c -w src/ -x run
Download docker (only for ubuntu users):
sudo apt update && sudo apt upgrade -y
sudo apt install nala -y
sudo nala install ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo nala update
sudo nala install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
sudo service docker start
sudo rm /etc/apt/sources.list.d/docker.list
Build the docker image:
sudo docker builder build . --tag www:latest
Run the docker image:
sudo docker run --net=host --rm www
Run in detached mode:
sudo docker run --restart unless-stopped -d -it --name www --net=host www