The Witeka web application.
Setup dev dependencies and tools:
sudo apt install mariadb-server libmysqlclient20 libmysqlclient-dev libssl-dev
cargo install diesel_cli --no-default-features --features mysql
cargo install wasm-bindgen-cli
Create database and apply migrations:
sudo mysql -u root < db/create_db.sql
diesel migration run
Create test database and apply migrations:
sudo mysql -u root < db/create_test_db.sql
./diesel_test.sh migration run
Check the project:
cargo check --all-features --all-targets
Build and run:
./build_wasm_client.sh
cargo run -p witeka-server
Run all unit and integration tests:
cargo test --all-features --all-targets
Add user via REST API:
curl --header "Content-Type: application/json" --request POST --data '"Vasya"' http://localhost:8080/user
Check and perform formatting:
cargo +nightly fmt -- --check
cargo +nightly fmt
Enable autoformatting for IntelliJ IDEA with the Rust plugin:
Settings -> Languages and Frameworks -> Rust -> Rustfmt -> Run rustfmt on Save
Run clippy:
cargo clippy --all-targets --workspace --all-features -- -D warnings
Setup git hook:
cp .git-pre-push.sh .git/hooks/pre-push