feat: restructure project, implement askama templating #26
50
Cargo.lock
generated
@ -62,6 +62,17 @@ version = "1.0.86"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
|
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "app"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"askama",
|
||||||
|
"askama_axum",
|
||||||
|
"axum",
|
||||||
|
"tokio",
|
||||||
|
"tower-http",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "askama"
|
name = "askama"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
@ -460,17 +471,6 @@ dependencies = [
|
|||||||
"windows-targets 0.52.6",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "clego"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"askama",
|
|
||||||
"askama_axum",
|
|
||||||
"axum",
|
|
||||||
"tokio",
|
|
||||||
"tower-http",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cocoa"
|
name = "cocoa"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
@ -695,6 +695,18 @@ dependencies = [
|
|||||||
"syn 2.0.72",
|
"syn 2.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "desktop"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"app",
|
||||||
|
"axum",
|
||||||
|
"tauri",
|
||||||
|
"tauri-build",
|
||||||
|
"tokio",
|
||||||
|
"tower",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.10.7"
|
version = "0.10.7"
|
||||||
@ -2161,18 +2173,6 @@ version = "2.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pharmacie-desktop"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"axum",
|
|
||||||
"clego",
|
|
||||||
"tauri",
|
|
||||||
"tauri-build",
|
|
||||||
"tokio",
|
|
||||||
"tower",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf"
|
name = "phf"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@ -2919,6 +2919,10 @@ dependencies = [
|
|||||||
"stable_deref_trait",
|
"stable_deref_trait",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sesame-vitale"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha2"
|
name = "sha2"
|
||||||
version = "0.10.8"
|
version = "0.10.8"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
florian_briand marked this conversation as resolved
|
|||||||
"crates/clego",
|
"crates/app",
|
||||||
"crates/tauri"
|
"crates/sesame-vitale",
|
||||||
florian_briand marked this conversation as resolved
Outdated
florian_briand
commented
J'avais fait le choix de mettre les modules à la racine, plutôt que dans sous dossier crates, car ça vient, à mon goût, surcharger l'arborescence sans qu'on en ai réellement besoin n J'avais fait le choix de mettre les modules à la racine, plutôt que dans sous dossier crates, car ça vient, à mon goût, surcharger l'arborescence sans qu'on en ai réellement besoin n
theo
commented
les deux me vont, on peut partir sur ca les deux me vont, on peut partir sur ca
|
|||||||
|
"crates/desktop"
|
||||||
]
|
]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "clego"
|
name = "app"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
use ::clego::get_router;
|
use ::app::get_router;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pharmacie-desktop"
|
name = "desktop"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Un logiciel de pharmacie libre et open-source."
|
description = "Un logiciel de pharmacie libre et open-source."
|
||||||
authors = ["p4pillon"]
|
authors = ["p4pillon"]
|
||||||
@ -18,5 +18,5 @@ tauri = { version = "2.0.0-beta", features = [] }
|
|||||||
tower = "0.4.13"
|
tower = "0.4.13"
|
||||||
tokio = "1.39.1"
|
tokio = "1.39.1"
|
||||||
|
|
||||||
clego = { path = "../clego" }
|
app = { path = "../app" }
|
||||||
|
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 974 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 903 B |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 14 KiB |
@ -45,7 +45,7 @@ pub fn run() {
|
|||||||
.expect("Path should be resolvable");
|
.expect("Path should be resolvable");
|
||||||
|
|
||||||
let router = Arc::new(Mutex::new(
|
let router = Arc::new(Mutex::new(
|
||||||
clego::get_router(resource_path_buf.as_path()).clone(),
|
app::get_router(resource_path_buf.as_path()).clone(),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Adds the router to the application state
|
// Adds the router to the application state
|
@ -26,7 +26,7 @@
|
|||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"resources": {
|
"resources": {
|
||||||
"../clego/assets/": "./assets/"
|
"../app/assets/": "./assets/"
|
||||||
},
|
},
|
||||||
"targets": "all",
|
"targets": "all",
|
||||||
"icon": [
|
"icon": [
|
6
crates/sesame-vitale/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "sesame-vitale"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
14
crates/sesame-vitale/src/lib.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
pub fn add(left: usize, right: usize) -> usize {
|
||||||
|
left + right
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn it_works() {
|
||||||
|
let result = add(2, 2);
|
||||||
|
assert_eq!(result, 4);
|
||||||
|
}
|
||||||
|
}
|
Packages :
tauri/src
devientcrates/app
-> Interfaces et code métier via Axum + Askama + HTMxtauri/src-tauri
devientcrates/desktop
clego
devientcrates/sesam-vitale