update readme

This commit is contained in:
Douze Bé 2024-10-23 19:13:54 +02:00
parent f9941ed06a
commit 4207bbd538
2 changed files with 24 additions and 72 deletions

View file

@ -1,31 +1,26 @@
# nixin-farm
NixiN Farm Loco POC
#NixiN Farm Loco POC
This project is an experiment to evaluate the [loco-rs framework](https://loco.rs/docs))
## 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
```sh
$ cargo install loco-cli
$ cargo install sea-orm-cli
```
# Update loco
Use `cargo interactive-update` to update all dependencies. Do not forget to also do it inside the migration sub folder
# Run a sub project for test/debug
change directory to the subproject and run it using `cargo loco start`. For exemple :
```sh
$ cargo install cargo-interactive-update
$ cargo interactive-update
$ cd migration
$ cargo interactive-update
$ 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 :
```sh
curl --location 'localhost:5150/api/auth/register'
@ -47,3 +42,16 @@ curl --location 'localhost:5150/api/auth/login' \
}'
```
# 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
```sh
$ # 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
```

View file

@ -1,58 +1,2 @@
# Welcome to Loco :train:
[Loco](https://loco.rs) is a web and API framework running on Rust.
This is the **SaaS starter** which includes a `User` model and authentication based on JWT.
It also include configuration sections that help you pick either a frontend or a server-side template set up for your fullstack server.
## Quick Start
```sh
cargo loco start
```
```sh
$ cargo loco start
Finished dev [unoptimized + debuginfo] target(s) in 21.63s
Running `target/debug/myapp start`
:
:
:
controller/app_routes.rs:203: [Middleware] Adding log trace id
▄ ▀
▀ ▄
▄ ▀ ▄ ▄ ▄▀
▄ ▀▄▄
▄ ▀ ▀ ▀▄▀█▄
▀█▄
▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▀▀█
██████ █████ ███ █████ ███ █████ ███ ▀█
██████ █████ ███ █████ ▀▀▀ █████ ███ ▄█▄
██████ █████ ███ █████ █████ ███ ████▄
██████ █████ ███ █████ ▄▄▄ █████ ███ █████
██████ █████ ███ ████ ███ █████ ███ ████▀
▀▀▀██▄ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ██▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://loco.rs
environment: development
database: automigrate
logger: debug
compilation: debug
modes: server
listening on http://localhost:5150
```
## Full Stack Serving
You can check your [configuration](config/development.yaml) to pick either frontend setup or server-side rendered template, and activate the relevant configuration sections.
## Getting help
Check out [a quick tour](https://loco.rs/docs/getting-started/tour/) or [the complete guide](https://loco.rs/docs/getting-started/guide/).
# NixiN loco POC with htmx
Test application using htms server side rendering