From 4207bbd5384ce320aa836ad5c39282102ef3a7c9 Mon Sep 17 00:00:00 2001 From: Fabrice Bellamy <12b@distrilab.fr> Date: Wed, 23 Oct 2024 19:13:54 +0200 Subject: [PATCH] update readme --- README.md | 36 ++++++++++++++---------- nixin_farm_ssr/README.md | 60 ++-------------------------------------- 2 files changed, 24 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 2a76efa..828f78c 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/nixin_farm_ssr/README.md b/nixin_farm_ssr/README.md index 43b9bdd..87918ca 100644 --- a/nixin_farm_ssr/README.md +++ b/nixin_farm_ssr/README.md @@ -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