If you are using Nix:
nix develop
otherwise install dependencies manually.
I personally recommend to use rustup and VSCodium with the rust-analyzer extension
cargo install diesel_cli
Specify a database in the .env
file:
DATABASE_URL=mysql://user@127.0.0.1:15306/commerce
#DATABASE_URL=mysql://not-grocy:not-grocy@not-grocy/not-grocy
#DATABASE_URL=postgres://not-grocy:not-grocy@not-grocy/not-grocy
#DATABASE_URL=test.db
You can copy your old grocy database file if you have one.
Run migrations:
cargo run --bin cli migrate
diesel print-schema > src/schema.rs
Run:
cargo run --bin server
Add pre-commit hook:
ln -s ../../pre-commit.sh .git/hooks/pre-commit
cargo install cargo-watch
RUST_BACKTRACE=1 RUST_LOG=actix_web=debug cargo watch -x 'run --bin server'
cargo +nightly -Z unstable-options clippy --fix
docker build . docker run -it -e DATABASE_URL=test.dev -p 8080:8080 814595076785