diff --git a/.gitignore b/.gitignore index f7d0728..c15e1c9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ !.env.example .DS_Store + +crates/web/dist diff --git a/Cargo.lock b/Cargo.lock index e488604..62d4979 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -335,6 +335,17 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "async-std" version = "1.12.0" @@ -432,6 +443,36 @@ dependencies = [ "webpki-roots 0.22.6", ] +[[package]] +name = "attribute-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b48808b337d6b74c15ff9becfc0e139fe2b4e2b224d670a0ecdb46b0b2d3d9b" +dependencies = [ + "attribute-derive-macro", + "derive-where", + "manyhow", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "attribute-derive-macro" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b19cbd63850ecff821c413e12846a67ec9f4ce7309c70959b94ecf9b2575ee2" +dependencies = [ + "collection_literals", + "interpolator", + "manyhow", + "proc-macro-utils", + "proc-macro2", + "quote", + "quote-use", + "syn 2.0.66", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -701,6 +742,12 @@ dependencies = [ "serde", ] +[[package]] +name = "camino" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" + [[package]] name = "cc" version = "1.0.98" @@ -734,6 +781,33 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "clap" version = "4.3.19" @@ -792,6 +866,12 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "collection_literals" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186dce98367766de751c42c4f03970fc60fc012296e706ccbb9d5df9b6c1e271" + [[package]] name = "colorchoice" version = "1.0.0" @@ -807,12 +887,46 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "config" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" +dependencies = [ + "convert_case", + "lazy_static", + "nom", + "pathdiff", + "serde", + "toml", +] + [[package]] name = "const-oid" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.2.6" @@ -825,6 +939,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core" version = "0.1.0" @@ -905,6 +1028,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -950,6 +1079,19 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.0", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -978,6 +1120,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-where" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "deunicode" version = "1.6.0" @@ -1034,6 +1187,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "drain_filter_polyfill" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" + [[package]] name = "either" version = "1.9.0" @@ -1321,6 +1480,27 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "gloo-net" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http 0.2.9", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "gloo-timers" version = "0.2.6" @@ -1333,6 +1513,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "h2" version = "0.3.20" @@ -1352,6 +1545,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "handlebars" version = "5.1.2" @@ -1448,6 +1651,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + [[package]] name = "http" version = "0.2.9" @@ -1668,6 +1880,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "interpolator" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" + +[[package]] +name = "inventory" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" + [[package]] name = "io-lifetimes" version = "1.0.11" @@ -1705,6 +1929,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1753,6 +1986,193 @@ dependencies = [ "spin 0.5.2", ] +[[package]] +name = "leptos" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5fae88b21265cbb847c891d7cf660e284a1282da15459691992be9358e906fb" +dependencies = [ + "cfg-if", + "leptos_config", + "leptos_dom", + "leptos_macro", + "leptos_reactive", + "leptos_server", + "server_fn", + "tracing", + "typed-builder", + "typed-builder-macro", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "leptos_config" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec33b6f994829469ba7c62bfd5fb572a639071d0de715a41c2aa0df86301a4fa" +dependencies = [ + "config", + "regex", + "serde", + "thiserror", + "typed-builder", +] + +[[package]] +name = "leptos_dom" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867d2afc153cc0f1d6f775872d5dfc409385f4d8544831ee45f720d88f363e6b" +dependencies = [ + "async-recursion", + "cfg-if", + "drain_filter_polyfill", + "futures", + "getrandom", + "html-escape", + "indexmap 2.0.0", + "itertools 0.12.1", + "js-sys", + "leptos_reactive", + "once_cell", + "pad-adapter", + "paste", + "rustc-hash", + "serde", + "serde_json", + "server_fn", + "smallvec", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "leptos_hot_reload" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec5ce56051f2eff2c4736b7a2056177e67be19597b767ff72fbab20917a7422d" +dependencies = [ + "anyhow", + "camino", + "indexmap 2.0.0", + "parking_lot", + "proc-macro2", + "quote", + "rstml", + "serde", + "syn 2.0.66", + "walkdir", +] + +[[package]] +name = "leptos_macro" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "019016cc0193831660a7794aa046e4c01617d97ccb2f403a5c10b21744391a71" +dependencies = [ + "attribute-derive", + "cfg-if", + "convert_case", + "html-escape", + "itertools 0.12.1", + "leptos_hot_reload", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "rstml", + "server_fn_macro", + "syn 2.0.66", + "tracing", + "uuid", +] + +[[package]] +name = "leptos_meta" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "873ec368535d9971df4848ca21e91aa96fa00a6884258ab8f926db69ea97f547" +dependencies = [ + "cfg-if", + "indexmap 2.0.0", + "leptos", + "tracing", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "leptos_reactive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076064e3c84e3aa12d4bad283e82ba5968675f5f9714d04a5c38f169cd4f26b5" +dependencies = [ + "base64 0.22.1", + "cfg-if", + "futures", + "indexmap 2.0.0", + "js-sys", + "oco_ref", + "paste", + "pin-project", + "rustc-hash", + "self_cell", + "serde", + "serde-wasm-bindgen", + "serde_json", + "slotmap", + "thiserror", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "leptos_router" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66db10225f0caf60b0183935b288791ac3494ca6e1306d415ea97287b6c2db5" +dependencies = [ + "cfg-if", + "gloo-net", + "itertools 0.12.1", + "js-sys", + "lazy_static", + "leptos", + "linear-map", + "once_cell", + "percent-encoding", + "send_wrapper", + "serde", + "serde_json", + "serde_qs 0.13.0", + "thiserror", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "leptos_server" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "603064a2d7ac46dba4b3ed5397a475076f9738918dd605670869dfe877d5966c" +dependencies = [ + "inventory", + "lazy_static", + "leptos_macro", + "leptos_reactive", + "serde", + "server_fn", + "thiserror", + "tracing", +] + [[package]] name = "libc" version = "0.2.155" @@ -1776,6 +2196,16 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linear-map" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" +dependencies = [ + "serde", + "serde_test", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1807,6 +2237,29 @@ dependencies = [ "value-bag", ] +[[package]] +name = "manyhow" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91ea592d76c0b6471965708ccff7e6a5d277f676b90ab31f4d3f3fc77fade64" +dependencies = [ + "manyhow-macros", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "manyhow-macros" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64621e2c08f2576e4194ea8be11daf24ac01249a4f53cd8befcbb7077120ead" +dependencies = [ + "proc-macro-utils", + "proc-macro2", + "quote", +] + [[package]] name = "matchers" version = "0.1.0" @@ -2010,6 +2463,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "oco_ref" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51ebcefb2f0b9a5e0bea115532c8ae4215d1b01eff176d0f4ba4192895c2708" +dependencies = [ + "serde", + "thiserror", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2065,6 +2528,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "pad-adapter" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d80efc4b6721e8be2a10a5df21a30fa0b470f1539e53d8b4e6e75faf938b63" + [[package]] name = "parking" version = "2.1.0" @@ -2100,6 +2569,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "pem" version = "3.0.4" @@ -2251,13 +2726,23 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + [[package]] name = "proc-macro-crate" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit", + "toml_edit 0.21.1", ] [[package]] @@ -2284,6 +2769,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f59e109e2f795a5070e69578c4dc101068139f74616778025ae1011d4cd41a8" +dependencies = [ + "proc-macro2", + "quote", + "smallvec", +] + [[package]] name = "proc-macro2" version = "1.0.85" @@ -2293,6 +2789,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "version_check", + "yansi", +] + [[package]] name = "ptr_meta" version = "0.1.4" @@ -2347,6 +2856,29 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "quote-use" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b393938dcaab992375d7b3df7887fa98cc91c2f3590598251e7c609e2b788139" +dependencies = [ + "quote", + "quote-use-macros", +] + +[[package]] +name = "quote-use-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d8772387900c205780e2c240cfe4dd01355ab4f96a503d99bdf34ad73180ef" +dependencies = [ + "derive-where", + "proc-macro-utils", + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "radium" version = "0.7.0" @@ -2500,7 +3032,7 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", + "wasm-streams 0.2.3", "web-sys", "webpki-roots 0.22.6", "winreg", @@ -2586,6 +3118,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rstml" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.66", + "syn_derive", + "thiserror", +] + [[package]] name = "rust-argon2" version = "2.1.0" @@ -2661,6 +3207,12 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustix" version = "0.37.23" @@ -2951,6 +3503,21 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +dependencies = [ + "futures-core", +] + [[package]] name = "serde" version = "1.0.203" @@ -2960,6 +3527,17 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.203" @@ -2992,6 +3570,46 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_qs" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + +[[package]] +name = "serde_qs" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_test" +version = "1.0.176" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a2f49ace1498612d14f7e0b8245519584db8299541dfe31a06374a828d620ab" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3031,6 +3649,59 @@ dependencies = [ "url", ] +[[package]] +name = "server_fn" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06e6e5467a2cd93ce1accfdfd8b859404f0b3b2041131ffd774fabf666b8219" +dependencies = [ + "bytes", + "ciborium", + "const_format", + "dashmap", + "futures", + "gloo-net", + "http 1.1.0", + "js-sys", + "once_cell", + "send_wrapper", + "serde", + "serde_json", + "serde_qs 0.12.0", + "server_fn_macro_default", + "thiserror", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams 0.4.0", + "web-sys", + "xxhash-rust", +] + +[[package]] +name = "server_fn_macro" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c216bb1c1ac890151397643c663c875a1836adf0b269be4e389cb1b48c173c" +dependencies = [ + "const_format", + "convert_case", + "proc-macro2", + "quote", + "syn 2.0.66", + "xxhash-rust", +] + +[[package]] +name = "server_fn_macro_default" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00783df297ec85ea605779f2fef9cbec98981dffe2e01e1a9845c102ee1f1ae6" +dependencies = [ + "server_fn_macro", + "syn 2.0.66", +] + [[package]] name = "sha1" version = "0.10.5" @@ -3099,6 +3770,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "serde", + "version_check", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -3156,7 +3837,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" dependencies = [ - "itertools", + "itertools 0.10.5", "nom", "unicode_categories", ] @@ -3689,11 +4370,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.14", +] + [[package]] name = "toml_datetime" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -3703,7 +4399,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.0.0", "toml_datetime", - "winnow", + "winnow 0.5.0", +] + +[[package]] +name = "toml_edit" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.13", ] [[package]] @@ -3849,6 +4558,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "typed-builder" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77739c880e00693faef3d65ea3aad725f196da38b22fdc7ea6ded6e1ce4d3add" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "typenum" version = "1.16.0" @@ -3888,6 +4617,12 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "unicode_categories" version = "0.1.1" @@ -3924,6 +4659,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + [[package]] name = "utf8parse" version = "0.2.1" @@ -3936,6 +4677,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ + "getrandom", "serde", ] @@ -4073,6 +4815,28 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web" +version = "0.0.0" +dependencies = [ + "leptos", + "leptos_meta", + "leptos_router", +] + [[package]] name = "web-sys" version = "0.3.64" @@ -4305,6 +5069,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -4323,6 +5096,18 @@ dependencies = [ "tap", ] +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + [[package]] name = "zeroize" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index 8c16354..d358bb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,8 @@ members = [ "crates/entity", "crates/migration", "crates/server", - "crates/test" + "crates/test", + "crates/web" ] default-members = ["crates/cli"] resolver = "2" @@ -22,6 +23,9 @@ dotenv = "0.15.0" fake = "2.9.2" jsonwebtoken = "9.3" lazy_static = "1.4.0" +leptos = "0.6" +leptos_meta = "0.6" +leptos_router = "0.6" pxid = { version = "0.5", features = ["async-graphql"] } rand = "0.8.5" rust-argon2 = "2.1.0" diff --git a/Justfile b/Justfile index c2e8ddb..bf88b69 100644 --- a/Justfile +++ b/Justfile @@ -1,5 +1,8 @@ set positional-arguments +default: + just --list + dev: docker compose up @@ -23,3 +26,15 @@ serve: # Runs E2E Tests and optionally runs a specific test requires `e2e_test_dev` to be executed first. e2e_test *args='': cargo test --package test -- --test-threads=1 $1 + +# Runs formatting tool against Leptos source +web-fmt: + leptosfmt ./crates/web/src/*.rs + +# Runs Web UI for Development +web-dev: + cd ./crates/web && trunk serve --config ./Trunk.toml + +# Builds Web UI for Production +web-build: + cd ./crates/web && trunk build --release --locked --config ./Trunk.toml diff --git a/README.md b/README.md index 0fdade1..234c9f3 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,11 @@ Directory | Description `crates/` | Contains GraphQL Server Logic, CLI and Domain libraries. Rust is the predominant language. `crates/cli` | CLI used to manage the Server instance. run database migrations and other developer tasks `crates/core` | Domain Logic, includes Models, Value Objects, Repositories and Services +`crates/entity` | Entities generated from database +`crates/migration` | Database migrations `crates/server` | HTTP Server Logic, uses Axum and GraphQL -`crates/entities` | Entities generated from database -`crates/migrations` | Database migrations +`crates/test` | E2E Tests for the GraphQL Server +`crates/web` | Web UI, written in Leptos ## Testing diff --git a/crates/web/Cargo.toml b/crates/web/Cargo.toml new file mode 100644 index 0000000..7b56123 --- /dev/null +++ b/crates/web/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "web" +version = "0.0.0" +edition = "2021" +authors = ["Esteban Borai "] +publish = false +description = "Web Front-End for TownHall" +license = "MIT" + +[lib] +name = "web" +path = "src/lib.rs" + +[[bin]] +name = "townhall-web" +path = "src/bin/main.rs" + +[dependencies] +leptos = { workspace = true, features = ["csr"] } +leptos_meta = { workspace = true } +leptos_router = { workspace = true, features = ["csr"] } diff --git a/crates/web/README.md b/crates/web/README.md new file mode 100644 index 0000000..fd96fcd --- /dev/null +++ b/crates/web/README.md @@ -0,0 +1,29 @@ +
+

TownHall Web Front-End

+
+ +## Development + +### Requirements + +- [Rust](https://rustup.rs) + +### First Time Setup + +1. Install `Trunk` Rust bundler from [here](https://trunkrs.dev/) +2. Install `Just` (`Justfile`) Rust command runner [here](https://github.com/casey/just) +3. Make sure the `wasm32-unkown-unknown` target is installed if not you can use + +```bash +rustup target add wasm32-unknown-unknown +``` + +4. Run the project using `just web-dev` command + +```bash +just web-dev +``` + +## License + +Licensed under the MIT License diff --git a/crates/web/Trunk.toml b/crates/web/Trunk.toml new file mode 100644 index 0000000..d38fccd --- /dev/null +++ b/crates/web/Trunk.toml @@ -0,0 +1,52 @@ +[build] +# The index HTML file to drive the bundling process. +target = "./public/index.html" + +# Build in release mode. +release = false + +# The output dir for all final assets. +dist = "dist" + +# The public URL from which assets are to be served. +public_url = "/" + +# Whether to include hash values in the output file names. +filehash = true + +# Whether to inject scripts (and module preloads) into the finalized output. +inject_scripts = true + +# Run without network access +offline = false + +# Require Cargo.lock and cache are up to date +frozen = false + +# Require Cargo.lock is up to date +locked = false + +# Allow disabling minification +no_minification = false + +# Allow disabling sub-resource integrity (SRI) +no_sri = false + +[watch] +# Paths to watch. The `build.target`'s parent folder is watched by default. +watch = [] +# Paths to ignore. +ignore = [] + +[serve] +# The address to serve on. +address = "127.0.0.1" + +# The port to serve on. +port = 8080 + +# Open a browser tab once the initial build is complete. +open = false + +# Protocol used for autoreload WebSockets connection. +ws_protocol = "ws" diff --git a/crates/web/assets/img/townhall.png b/crates/web/assets/img/townhall.png new file mode 100644 index 0000000..001536c Binary files /dev/null and b/crates/web/assets/img/townhall.png differ diff --git a/crates/web/public/index.html b/crates/web/public/index.html new file mode 100644 index 0000000..804a9bc --- /dev/null +++ b/crates/web/public/index.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/crates/web/public/styles.css b/crates/web/public/styles.css new file mode 100644 index 0000000..605a9ce --- /dev/null +++ b/crates/web/public/styles.css @@ -0,0 +1,2 @@ +@tailwind base; +@tailwind components; diff --git a/crates/web/src/bin/main.rs b/crates/web/src/bin/main.rs new file mode 100644 index 0000000..3d12b02 --- /dev/null +++ b/crates/web/src/bin/main.rs @@ -0,0 +1,9 @@ +use leptos::{mount_to_body, view}; + +use web::App; + +fn main() { + mount_to_body(|| { + view! { } + }) +} diff --git a/crates/web/src/lib.rs b/crates/web/src/lib.rs new file mode 100644 index 0000000..8ef857f --- /dev/null +++ b/crates/web/src/lib.rs @@ -0,0 +1,21 @@ +pub mod views; + +use leptos::{component, view, IntoView}; +use leptos_meta::{provide_meta_context, Title}; +use leptos_router::{Route, Router, Routes}; + +use crate::views::home::Home; + +#[component] +pub fn App() -> impl IntoView { + provide_meta_context(); + + view! { + + <Router> + <Routes> + <Route path="/" view=Home/> + </Routes> + </Router> + } +} diff --git a/crates/web/src/views/home.rs b/crates/web/src/views/home.rs new file mode 100644 index 0000000..3afbfe6 --- /dev/null +++ b/crates/web/src/views/home.rs @@ -0,0 +1,11 @@ +use leptos::{component, view, IntoView}; + +#[component] +pub fn Home() -> impl IntoView { + view! { + <section class="flex flex-col justify-center items-center"> + <img src="/assets/img/townhall.png" alt="TownHall AI Generated" height="500" width="500" /> + <h1>{"AI Generated Picture of a TownHall"}</h1> + </section> + } +} diff --git a/crates/web/src/views/mod.rs b/crates/web/src/views/mod.rs new file mode 100644 index 0000000..9b86bcf --- /dev/null +++ b/crates/web/src/views/mod.rs @@ -0,0 +1 @@ +pub mod home;