NixiN Farm Loco POC
Find a file
2024-10-23 23:39:01 +02:00
nixin_farm_ssr secure the jwt token cookie 2024-10-23 23:39:01 +02:00
.gitignore add custom authentification middleware 2024-10-22 13:53:58 +02:00
LICENSE Initial commit 2024-10-16 17:22:24 +00:00
README.md typo 2024-10-23 19:19:47 +02:00
rust-toolchain.toml Add nix-shell dev environment and update readme 2024-10-16 19:46:19 +02:00
shell.nix implement user registration and other user related routes, with htmx error messages. (work in progress) 2024-10-23 18:54:44 +02:00

NixiN Farm Loco POC

This project is an experiment to evaluate the loco-rs framework

Dev environment

Install Rust

If you are on NixOS, there is a shell.nix at the root of the project. You just have to run nix-shell to get a rust environment
Otherwise, go to https://www.rust-lang.org/tools/install for instructions to install Rust
You will also need the open ssl development library (apt install libssl-dev on debian/ubuntu)

Install Loco

$ cargo install loco-cli
$ cargo install sea-orm-cli

Run a sub project for test/debug

change directory to one sub-project and run it using cargo loco start. For exemple :

$ cd nixin_farm_ssr
$ cargo loco start

Test / Debug

To test the app with a web browser point it to http://localhost:5150

To register a user from the command line :

curl --location 'localhost:5150/api/auth/register'
     --header 'Content-Type: application/json'
     --data-raw '{
         "name": "test",
         "email": "test@nixin.local",
         "password": "Test"
     }'

To test user login from the command line :

curl --location 'localhost:5150/api/auth/login' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "email": "test@nixin.local",
         "password": "Test"
     }'

Update loco

To update loco-rs Use cargo interactive-update to update all dependencies. Do not forget to also do it inside the migration sub folder

$ # install cargo-interactive-update if it is not already installed
$ cargo install cargo-interactive-update
$ # then launch it (from a sub-project directory)
$ cargo interactive-update
$ # select all the available updates in the TUI and apply them
$ # then go to the migration sub folder and do the same
$ cd migration
$ cargo interactive-update