Rewrite README + use lettre crate to validate email address instead of regex

This commit is contained in:
Greg Burri 2025-01-16 23:09:06 +01:00
parent 67e13d9074
commit 65489e7692
8 changed files with 62 additions and 85 deletions

View file

@ -1,59 +1,59 @@
# Use cases
## Create a recipe
To create a recipe the user must have an account.
* The user
(A group is automatically created)
## Create a groupe
## Move a group
## Delete a group
## Create a step
## Move a step
## Delete a step
# Technical
## Cross-compilation on Windows 11
The toolchain for Raspberry Pi 64 bits is available here: https://gnutoolchains.com/raspberry64/
## How to install service on RPI Zero
1. Copy doc/recipes.service to /lib/systemd/system
2. Enabled it: #> systemctl enable recipes
## Backend
Autoreload: https://actix.rs/docs/autoreload/
### Launch Axum
### Frontend
In directory '/backend' type:
$> cargo run
## WebAssembly
Then browse http://127.0.0.1:8082 (You need to compile the wasm file first, see section 'Frontend')
'frontend' project needs some tools to generate the WebAssembly stuff. Everything is explained here: https://rustwasm.github.io/wasm-bindgen/examples/hello-world.html
TODO MVC Example:
https://github.com/rustwasm/wasm-bindgen/tree/main/examples/todomvc -> https://rustwasm.github.io/wasm-bindgen/exbuild/todomvc/#/
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.
Javascript bundler: https://rspack.dev/
### Autoreload
To compile run 'wasm-pack build' in 'frontend' directory
To launch node run 'npm run start' in 'frontend/www' directory
First install cargo watch:
$> cargo install cargo-watch
## Useful URLs
* Rust patterns : https://github.com/rust-unofficial/patterns/tree/master/patterns
* Node install: https://nodejs.org/en/download/
In directory '/backend' type:
$> cargo watch -x run
# Tools
## Frontend
### Tools needed
nushell: https://www.nushell.sh/
wasm-pack: https://github.com/rustwasm/wasm-pack
wasm-opt: $> cargo install wasm-opt
### Compilation
In directory '/frontend' type:
$> nu deploy.nu
It will create the '/frontend/pkg' directory and copy the wasm file into '/backend/static'.
You can now refresh your browser to reload the wasm file.
# How-to
## How to install service on a Linux server
As root:
1. Copy '/doc/recipes.service' to '/lib/systemd/system/'
2. Enabled it: #> systemctl enable recipes
3. Launch it: #> systemctl start recipes
# Useful URLs
* Rust patterns : https://github.com/rust-unofficial/patterns
* Rust cheat Sheet: https://cheats.rs/
# Useful tools
Benchmarking: https://crates.io/crates/oha
HTTP API tool: https://www.usebruno.com/
HTTP API tool: https://www.usebruno.com/
GUI Database client: https://dbeaver.io/