/not-grocy-server

Experimental backend for https://github.com/mistressofjellyfish/not-grocy written in Rust

Primary LanguageRustGNU Affero General Public License v3.0AGPL-3.0

not-grocy-server

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

Development

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

What the experience currently feels like

https://rust-lang.github.io/wg-async-foundations/vision/submitted_stories/status_quo/alan_picks_web_server.html

Docker

docker build . docker run -it -e DATABASE_URL=test.dev -p 8080:8080 814595076785