2024-10-16 17:22:24 +00:00
|
|
|
# nixin-farm
|
|
|
|
|
2024-10-16 17:58:24 +00:00
|
|
|
NixiN Farm Loco POC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 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
|
|
|
|
Otherwize, go to https://www.rust-lang.org/tools/install for instructions to install Rust
|
|
|
|
You will also need open ssl development library (`apt install libssl-dev` on debian/ubuntu)
|
|
|
|
# Install Loco
|
2024-10-21 21:21:26 +00:00
|
|
|
```sh
|
2024-10-16 17:58:24 +00:00
|
|
|
$ cargo install loco-cli
|
|
|
|
$ cargo install sea-orm-cli
|
|
|
|
```
|
2024-10-21 21:21:26 +00:00
|
|
|
|
|
|
|
# Update loco
|
|
|
|
Use `cargo interactive-update` to update all dependencies. Do not forget to also do it inside the migration sub folder
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ cargo install cargo-interactive-update
|
|
|
|
$ cargo interactive-update
|
|
|
|
$ cd migration
|
|
|
|
$ cargo interactive-update
|
|
|
|
```
|
|
|
|
|
2024-10-22 12:03:51 +00:00
|
|
|
# Test / Debug
|
|
|
|
To register a user from the command line :
|
|
|
|
```sh
|
|
|
|
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 :
|
|
|
|
```sh
|
|
|
|
curl --location 'localhost:5150/api/auth/login' \
|
|
|
|
--header 'Content-Type: application/json' \
|
|
|
|
--data-raw '{
|
|
|
|
"email": "test@nixin.local",
|
|
|
|
"password": "Test"
|
|
|
|
}'
|
|
|
|
```
|
|
|
|
|