This server requires a few things set up in order to properly run it.
Install Postgres:
MacOs: brew install postgresql@16
Linux: sudo apt-get -y install postgresql-16
Windows: Download the installer
Optional: Install PgAdmin
Install Rust compiler:
Linux / Mac: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Windows: Download the installer
-
Create database locally using PgAdmin or Postgres on the CLI
-
run
cargo install sqlx-cli
-
cd
into the project's root -
create .env file
-
The following fields should be added:
DATABASE_URL
SMTP_USERNAME
SMTP_PASSWORD
ETHEREUM_ENDPOINT
JWT_KEY
-
Create connection string from DB details and add to .env as the value of DATABASE_URL. Example: postgres://username:password@localhost:5432/databasename
-
run
sqlx database create
-
run
sqlx migrate run
-
generate JWT key by running the test called
get_key
in crate::routes::login and use as value of JWT_KEY in .env -
add an email address for SMTP_USERNAME (it is probably best to make a new one or a temp)
-
add a password to that email for SMTP_PASSWORD
-
add a URL to any Ethereum JSON-RPC endpoint (local or otherwise) for ETHEREUM_ENDPOINT