Please read the sections on environment variables in backend/README.md
and frontend/README.md
.
This guide supports MacOS, Debian Linux, and Arch Linux. However, it has only been fully tested on Arch Linux.
If you are using Windows, please install Linux with the Windows Subsystem for Linux.
Install Rust by follwing these instructions.
Install Node by following these instructions.
Install PostgreSQL by following these instructions.
Start the PostgreSQL service on every boot:
sudo systemctl enable postgresql
Start the PostgreSQL service:
sudo systemctl start postgresql
Later, you can disable starting the PostgreSQL service on every boot:
sudo systemctl disable postgresql
Create a password for the postgres
user:
sudo -u postgres psql
postgres=# \password postgres
[Enter a strong password]
postgres#= \q
Create a database:
sudo -u postgres psql
postgres=# CREATE DATABASE subcomp;
postgres#= \q
Thanks to rocket
, we use nightly Rust. Thus, you must run:
rustup default nightly
Ensure you have added a backend/.env
file as described in backend/README.md
.
Navigate to backend
in your terminal and run:
cargo build
cargo install diesel_cli --no-default-features --features postgres
diesel setup
cargo run
You can subsequently run the backend using:
cargo run
If you want to restart the backend after every code change, install cargo watch
:
cargo install cargo-watch
You can subsequently run the backend using:
cargo watch -x run
Navigate to backend
in your terminal and run:
cargo install diesel_cli --no-default-features --features postgres
diesel setup
cargo build --release
./target/release/backend
Ensure you have added a frontend/.env
file as described in frontend/README.md
.
Navigate to frontend
in your terminal and run:
yarn install
yarn start
You can subsequently run the backend using:
yarn start
Navigate to frontend
in your terminal and run:
yarn install --production
yarn build --production
yarn serve -s build
As an alternative to all the above steps, you can use docker.
Install docker
by following these instructions.
Install docker compose
by following these instructions.
Please read the sections on environment variables in README.md
, backend/README.md
, and frontend/README.md
.
Please change localhost
to database
in backend/.env
.
sudo docker compose up # This will take a long time.
sudo docker compose build
If it fails because 0.0.0.0:5432 is already in use, stop the PostgreSQL service:
sudo systemctl stop postgresql