From eae4cec872b487378e91df1489a34295678b1cff Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sat, 5 Apr 2025 13:41:06 +0200 Subject: [PATCH] Update README --- README.md | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 590a690..74d752f 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,59 @@ +**Recipes** is a multi-user website to manage and publish cooking recipes. + # Technical ## Backend ### Launch Axum -In directory '/backend' type: - $> cargo run +In directory /backend type: -Then browse http://127.0.0.1:8082 (You need to compile the wasm file first, see section 'Frontend') +```$> cargo run``` + +Then browse http://127.0.0.1:8082 (You need to compile the wasm file first, see section *Frontend*) At first launch the configuration file '/backend/conf.ron' is created. It contains the port the server will listen to and information about the SMTP server which will be used to send email when a user sign up or change its password. ### Autoreload First install cargo watch: - $> cargo install cargo-watch -In directory '/backend' type: - $> cargo watch -x run +```$> cargo install cargo-watch``` + +In directory /backend type: + +```$> cargo watch -x run``` ## Frontend ### Tools needed -nushell: https://www.nushell.sh/ trunk: https://trunkrs.dev ### Compilation -In directory '/frontend' type: - $> nu deploy.nu +In directory /frontend type: -It will create the '/frontend/pkg' directory and copy the wasm file into '/backend/static'. +```$> trunk build``` + +It will create the wasm file in '/backend/static'. You can now refresh your browser to reload the wasm file. # How-to -## How to install service on a Linux server +## How to install service on a Linux server (with *systemd*) As root: 1. Copy '/doc/recipes.service' to '/lib/systemd/system/' -2. Enabled it: #> systemctl enable recipes -3. Launch it: #> systemctl start recipes +2. Change the values of `User`, `WorkingDirectory` and `ExecStart`. +2. Enabled it: `#> systemctl enable recipes` +3. Launch it: `#> systemctl start recipes` ## Cross compile for Raspberry PI on Windows -* $> https://gnutoolchains.com/raspberry/ +* https://gnutoolchains.com/raspberry/ * https://gnutoolchains.com/raspberry64/ # Useful URLs @@ -60,6 +66,7 @@ As root: # Useful tools -HTTP benchmarking and stress tool: https://crates.io/crates/oha -HTTP API tool: https://www.usebruno.com/ -GUI Database client: https://dbeaver.io/ +* nushell (.nu scripts): https://www.nushell.sh/ +* HTTP benchmarking and stress tool: https://crates.io/crates/oha +* HTTP API tool: https://www.usebruno.com/ +* GUI Database client: https://dbeaver.io/