Update README

This commit is contained in:
Greg Burri 2025-04-05 13:41:06 +02:00
parent 0c2e4b7624
commit eae4cec872

View file

@ -1,53 +1,59 @@
**Recipes** is a multi-user website to manage and publish cooking recipes.
# Technical # Technical
## Backend ## Backend
### Launch Axum ### Launch Axum
In directory '/backend' type: In directory /backend type:
$> cargo run
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. 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 ### Autoreload
First install cargo watch: First install cargo watch:
$> cargo install cargo-watch
In directory '/backend' type: ```$> cargo install cargo-watch```
$> cargo watch -x run
In directory /backend type:
```$> cargo watch -x run```
## Frontend ## Frontend
### Tools needed ### Tools needed
nushell: https://www.nushell.sh/
trunk: https://trunkrs.dev trunk: https://trunkrs.dev
### Compilation ### Compilation
In directory '/frontend' type: In directory /frontend type:
$> nu deploy.nu
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. You can now refresh your browser to reload the wasm file.
# How-to # How-to
## How to install service on a Linux server ## How to install service on a Linux server (with *systemd*)
As root: As root:
1. Copy '/doc/recipes.service' to '/lib/systemd/system/' 1. Copy '/doc/recipes.service' to '/lib/systemd/system/'
2. Enabled it: #> systemctl enable recipes 2. Change the values of `User`, `WorkingDirectory` and `ExecStart`.
3. Launch it: #> systemctl start recipes 2. Enabled it: `#> systemctl enable recipes`
3. Launch it: `#> systemctl start recipes`
## Cross compile for Raspberry PI on Windows ## Cross compile for Raspberry PI on Windows
* $> https://gnutoolchains.com/raspberry/ * https://gnutoolchains.com/raspberry/
* https://gnutoolchains.com/raspberry64/ * https://gnutoolchains.com/raspberry64/
# Useful URLs # Useful URLs
@ -60,6 +66,7 @@ As root:
# Useful tools # Useful tools
HTTP benchmarking and stress tool: https://crates.io/crates/oha * nushell (.nu scripts): https://www.nushell.sh/
HTTP API tool: https://www.usebruno.com/ * HTTP benchmarking and stress tool: https://crates.io/crates/oha
GUI Database client: https://dbeaver.io/ * HTTP API tool: https://www.usebruno.com/
* GUI Database client: https://dbeaver.io/