A little cooking recipes website
Find a file
2025-03-31 23:37:58 +02:00
.cargo Replace Rusqlite by Sqlx and Actix by Axum (A lot of changes) 2024-11-03 10:13:31 +01:00
backend Use the default OS theme (dark or light) 2025-03-31 23:37:58 +02:00
common Add a toggle between dark and light theme 2025-03-31 15:31:06 +02:00
doc WIP... 2023-04-10 09:35:10 +02:00
frontend Use the default OS theme (dark or light) 2025-03-31 23:37:58 +02:00
stress_tests Replace Rinja by askama 2025-03-26 13:19:16 +01:00
.gitattributes Replace PUT method by the more appropriate PATCH method. 2025-03-18 20:02:30 +01:00
.gitignore Add a toggle between dark and light theme 2025-03-31 15:31:06 +02:00
Cargo.lock Update dependencies 2025-03-31 21:24:35 +02:00
Cargo.toml Update dependencies 2025-03-31 21:24:35 +02:00
check_cargo_dependencies_upgrade.nu Replace Rusqlite by Sqlx and Actix by Axum (A lot of changes) 2024-11-03 10:13:31 +01:00
deploy.nu * Support for lang in URL as /fr/recipe/view/42 2025-03-26 01:49:02 +01:00
README.md Doc 2025-03-18 19:55:52 +01:00
TODO.md Replace Rinja by askama 2025-03-26 13:19:16 +01:00

Technical

Backend

Launch Axum

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')

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

Frontend

Tools needed

nushell: https://www.nushell.sh/ trunk: https://trunkrs.dev

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

Cross compile for Raspberry PI on Windows

Useful URLs

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/