12 Commits

Author SHA1 Message Date
0c0125af23 chore(deps): update dependency @playwright/test to v1.54.1 2025-07-12 00:34:32 +00:00
73f74183bd chore(deps): update rust crate serde to v1.0.218
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-20 05:52:15 +00:00
2dc1386f62 chore(deps): update dependency @playwright/test to v1.50.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-01 01:48:09 +00:00
00a263aae6 chore(deps): update dependency @playwright/test to v1.50.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-24 01:54:47 +00:00
c9c8906bee feat: add create post requests
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-19 22:28:57 +01:00
aa64a850e6 feat: add create post requests 2025-01-19 22:28:54 +01:00
c0e8d0f4ee fix: update error message
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-19 21:42:29 +01:00
3e3713ae89 chore(deps): update all dependencies 2025-01-19 21:42:14 +01:00
a9ba63aab2 chore(deps): update rust-wasm-bindgen monorepo
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-01-13 01:44:55 +00:00
955946d623 feat: add smooth scroll
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 16:15:13 +01:00
13e6fa474d chore: fmt message
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-12 15:06:13 +01:00
c5ca5f3612 chore: add leptos fmt
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-12 15:05:34 +01:00
8 changed files with 387 additions and 330 deletions

31
.helix/languages.toml Normal file
View File

@@ -0,0 +1,31 @@
[language-server.tailwindcss-ls]
command = "tailwindcss-language-server"
args = ["--stdio"]
config = { userLanguages = { rust = "html", "*.rs" = "html" } }
[[language]]
name = "html"
language-servers = ["vscode-html-language-server", "tailwindcss-ls"]
[[language]]
name = "css"
language-servers = ["vscode-css-language-server", "tailwindcss-ls"]
[[language]]
name = "jsx"
language-servers = ["typescript-language-server", "tailwindcss-ls"]
[[language]]
name = "tsx"
language-servers = ["typescript-language-server", "tailwindcss-ls"]
[[language]]
name = "svelte"
language-servers = ["svelteserver", "tailwindcss-ls"]
[[language]]
name = "rust"
language-servers = ["rust-analyzer", "tailwindcss-ls"]
[language-server.rust-analyzer.config.rustfmt]
overrideCommand = ["leptosfmt", "--stdin", "--rustfmt"]

279
Cargo.lock generated
View File

@@ -75,6 +75,8 @@ dependencies = [
"serde_json",
"server_fn",
"thiserror 2.0.11",
"uuid",
"web-sys",
]
[[package]]
@@ -248,9 +250,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
version = "2.7.0"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be"
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
[[package]]
name = "brotli"
@@ -299,9 +301,9 @@ checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3"
[[package]]
name = "cc"
version = "1.2.8"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0cf6e91fde44c773c6ee7ec6bba798504641a8bc2eb7e37a04ffbf4dfaa55a"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"jobserver",
"libc",
@@ -536,16 +538,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "erased-serde"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d"
dependencies = [
"serde",
"typeid",
]
[[package]]
name = "errno"
version = "0.3.10"
@@ -1187,9 +1179,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.76"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
@@ -1219,9 +1211,9 @@ dependencies = [
[[package]]
name = "leptos"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8a90c679094979aa12927e8e925fe8eead1420d69420b2d8c6540863937ca75"
checksum = "21c31c9d022c77702c53e02830d08b28320aca9c0899a19c443096c114623fa5"
dependencies = [
"any_spawner",
"base64",
@@ -1257,9 +1249,9 @@ dependencies = [
[[package]]
name = "leptos_axum"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae4386e955d6ba7c3c8d09583e99044050f6fb9a48b8d4096af948fdb3345434"
checksum = "43b613d5784037baee42a11d21bc263adfc1a55e416556a3d5bfe39c7b87fadf"
dependencies = [
"any_spawner",
"axum",
@@ -1281,9 +1273,9 @@ dependencies = [
[[package]]
name = "leptos_config"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c712e1ed3283d1acb842cef4cbcce7b2987a347cc1bf7141195e01f92bb8590d"
checksum = "5d874993c7664d757677d056c8f46b5cb5365fe622005e1bf26050f4996e7e52"
dependencies = [
"config",
"regex",
@@ -1294,9 +1286,9 @@ dependencies = [
[[package]]
name = "leptos_dom"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99803be421344a2184fd5796e1a7645c2090738b2ab5d1a856084816853ec322"
checksum = "a462aaeec85bc4ecfb26bf324437b92690bf3add1e30eb29b3acc08b20e8b4cb"
dependencies = [
"js-sys",
"or_poisoned",
@@ -1309,9 +1301,9 @@ dependencies = [
[[package]]
name = "leptos_hot_reload"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92413c6d93a22d8c4e75b2e7da3867af173e8d9ca49ce170b631e7c2766eef48"
checksum = "07eb295ad2f3b2af190da62af339b84fd01ce3c71702f09eb69a57310fcf0c6d"
dependencies = [
"anyhow",
"camino",
@@ -1327,9 +1319,9 @@ dependencies = [
[[package]]
name = "leptos_integration_utils"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fbf6dc5358d766932c6e58b30df53cfde916a9f4d20d4bb0cfc1bbf7f85a1"
checksum = "a8652fcd7a1744f85403b95c5520143f3b962d640c8450b8514f9530fb5c4b76"
dependencies = [
"futures",
"hydration_context",
@@ -1342,9 +1334,9 @@ dependencies = [
[[package]]
name = "leptos_macro"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20bcb2afa03e0614c64eec4a95ec2986fd3c59358daa0f50006e081bc1bd1067"
checksum = "90291b25ee576bc9c299d3371cc8f09bf60ea939a8de61fa8b744650aff76e24"
dependencies = [
"attribute-derive",
"cfg-if",
@@ -1364,9 +1356,9 @@ dependencies = [
[[package]]
name = "leptos_meta"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a54d4b942a474e38b606ff0bfe8712f093300bd053adb9dd7a028a14ca3fbfac"
checksum = "7250991b2077ef5869e999c74cf4990926a3c3919b50c9937e101c1c874102db"
dependencies = [
"futures",
"indexmap",
@@ -1380,9 +1372,9 @@ dependencies = [
[[package]]
name = "leptos_router"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69ff7d8c058b4bd7512fa58224b684d5da10d5f056171b8e27d516e0d36e1a5d"
checksum = "9a193dbd62b9617a5d7d199ea70c570da01a1bbe798e617373b6351845be6778"
dependencies = [
"any_spawner",
"either_of",
@@ -1405,9 +1397,9 @@ dependencies = [
[[package]]
name = "leptos_router_macro"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15a48035e8d796233a5b43322aeab9387f946f914dacdf17a1981c3910879b19"
checksum = "34bc3f80ad810b22058f12d278bb0bf929779cc0bc1289a06980d896f62743f0"
dependencies = [
"proc-macro-error2",
"proc-macro2",
@@ -1416,9 +1408,9 @@ dependencies = [
[[package]]
name = "leptos_server"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fb23bd110ac04c7276aae3d8ba523f94cf06989d00b4e76eaee89451b06b494"
checksum = "18caffe32c245ddb35697edd898ccb3393efce67672a707a14eebd0db2e8249a"
dependencies = [
"any_spawner",
"base64",
@@ -1470,12 +1462,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.24"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d"
dependencies = [
"value-bag",
]
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "manyhow"
@@ -1536,9 +1525,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924"
dependencies = [
"adler2",
]
@@ -1815,9 +1804,9 @@ dependencies = [
[[package]]
name = "prettyplease"
version = "0.2.27"
version = "0.2.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705"
checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac"
dependencies = [
"proc-macro2",
"syn",
@@ -1964,9 +1953,9 @@ dependencies = [
[[package]]
name = "reactive_graph"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bee22d7574c73fbfd47d828ee14dc67ca65606ade81de2f8d1691741072a93b"
checksum = "9fbf210c04505e128fb7f64acecc23c71f82f56c7d481b190e1010b7bada2cb9"
dependencies = [
"any_spawner",
"async-lock",
@@ -2257,38 +2246,29 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.217"
version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.217"
version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_fmt"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4"
dependencies = [
"serde",
]
[[package]]
name = "serde_json"
version = "1.0.135"
version = "1.0.136"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9"
checksum = "336a0c23cf42a38d9eaa7cd22c7040d04e1228a19a933890805ffd00a16437d2"
dependencies = [
"itoa",
"memchr",
@@ -2340,9 +2320,9 @@ dependencies = [
[[package]]
name = "server_fn"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b9f0d2eecb2bf4f909661acc731009e3657574dec93a0ec9f114e250f74bc4"
checksum = "f5dd7fcccd3ef2081da086c1f8595b506627abbbbc9f64be0141d2251219570e"
dependencies = [
"axum",
"bytes",
@@ -2376,9 +2356,9 @@ dependencies = [
[[package]]
name = "server_fn_macro"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee7723bef57b4353cd9939e280d3b5b2ebe45b4a4630c9e9e97a6fa4b84e8b1c"
checksum = "e0bbac4f01a714b0490247ac625bdb7055548210556c39e8f56a2dbbe3abc70b"
dependencies = [
"const_format",
"convert_case",
@@ -2390,9 +2370,9 @@ dependencies = [
[[package]]
name = "server_fn_macro_default"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87663ec10f17fbe8f6c53adc2d038df3304bfd17aaaab22f777810a9e6e05fff"
checksum = "f07dfd1744a5f5612f00f69fe035b0bfafdf12bb46d76e785673078a9e56b170"
dependencies = [
"server_fn_macro",
"syn",
@@ -2477,84 +2457,6 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "sval"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8"
[[package]]
name = "sval_buffer"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f"
dependencies = [
"sval",
"sval_ref",
]
[[package]]
name = "sval_dynamic"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4"
dependencies = [
"sval",
]
[[package]]
name = "sval_fmt"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94"
dependencies = [
"itoa",
"ryu",
"sval",
]
[[package]]
name = "sval_json"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155"
dependencies = [
"itoa",
"ryu",
"sval",
]
[[package]]
name = "sval_nested"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f"
dependencies = [
"sval",
"sval_buffer",
"sval_ref",
]
[[package]]
name = "sval_ref"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa"
dependencies = [
"sval",
]
[[package]]
name = "sval_serde"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a"
dependencies = [
"serde",
"sval",
"sval_nested",
]
[[package]]
name = "syn"
version = "2.0.96"
@@ -2621,9 +2523,9 @@ dependencies = [
[[package]]
name = "tachys"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "761f12c13d74f1b723e3c53ff70fe291d15fe51cc4b6586aafea974f0b647043"
checksum = "d777e4426a597296b020edcb5c3d8f25a3ccd8adfd22eb5154ac81da946aef9f"
dependencies = [
"any_spawner",
"const_str_slice_concat",
@@ -2962,12 +2864,6 @@ dependencies = [
"syn",
]
[[package]]
name = "typeid"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e"
[[package]]
name = "unicase"
version = "2.8.1"
@@ -3029,47 +2925,12 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "uuid"
version = "1.11.1"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4"
checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4"
dependencies = [
"getrandom",
]
[[package]]
name = "value-bag"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2"
dependencies = [
"value-bag-serde1",
"value-bag-sval2",
]
[[package]]
name = "value-bag-serde1"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b"
dependencies = [
"erased-serde",
"serde",
"serde_fmt",
]
[[package]]
name = "value-bag-sval2"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a"
dependencies = [
"sval",
"sval_buffer",
"sval_dynamic",
"sval_fmt",
"sval_json",
"sval_ref",
"sval_serde",
]
[[package]]
@@ -3111,20 +2972,21 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.99"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.99"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
@@ -3136,9 +2998,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.49"
version = "0.4.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2"
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
dependencies = [
"cfg-if",
"js-sys",
@@ -3149,9 +3011,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.99"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -3159,9 +3021,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.99"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
@@ -3172,9 +3034,12 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.99"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wasm-streams"
@@ -3191,9 +3056,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.76"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc"
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
dependencies = [
"js-sys",
"wasm-bindgen",

View File

@@ -9,14 +9,14 @@ lto = true
opt-level = 'z'
[workspace.dependencies]
leptos = { version = "0.7.2", features = ["nightly"] }
leptos_meta = { version = "0.7.2" }
leptos_router = { version = "0.7.2", features = ["nightly"] }
leptos_axum = { version = "0.7.2" }
server_fn = { version = "0.7.2", features = [] }
leptos = { version = "0.7.4", features = ["nightly"] }
leptos_meta = { version = "0.7.4" }
leptos_router = { version = "0.7.4", features = ["nightly"] }
leptos_axum = { version = "0.7.4" }
server_fn = { version = "0.7.4", features = [] }
serde = { version = "1", features = ["derive"] }
axum = "0.8"
axum = "0.7.9"
cfg-if = "1"
console_error_panic_hook = "0.1.7"
console_log = "1"
@@ -27,7 +27,8 @@ thiserror = "2"
tokio = { version = "1.37.0", features = ["full"] }
tower = { version = "0.5.0", features = ["full"] }
tower-http = { version = "0.6", features = ["full"] }
wasm-bindgen = "=0.2.99"
wasm-bindgen = "=0.2.100"
uuid = { version = "1.1.2", features = ["serde", "v4"] }
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.

View File

@@ -18,8 +18,13 @@ serde.workspace = true
http.workspace = true
cfg-if.workspace = true
thiserror.workspace = true
uuid.workspace = true
reqwest = { version = "0.12.11", optional = true, features = ["json"] }
serde_json = { version = "1.0.134", optional = true }
web-sys = { version = "0.3.76", features = [
"ScrollBehavior",
"ScrollToOptions",
] }
[features]
default = []
@@ -31,6 +36,7 @@ ssr = [
"dep:leptos_axum",
"dep:serde_json",
"dep:axum",
"reqwest",
]
reqwest = ["dep:reqwest"]
axum = ["dep:axum"]

View File

@@ -25,7 +25,7 @@ impl AppError {
#[component]
pub fn ErrorTemplate(
#[prop(optional)] outside_errors: Option<Errors>,
#[prop(optional)] errors: Option<RwSignal<Errors>>,
#[prop(optional, into)] errors: Option<RwSignal<Errors>>,
) -> impl IntoView {
let errors = match outside_errors {
Some(e) => RwSignal::new(e),
@@ -49,7 +49,9 @@ pub fn ErrorTemplate(
cfg_if! { if #[cfg(feature="ssr")] {
let response = use_context::<ResponseOptions>();
if let Some(response) = response {
response.set_status(errors[0].status_code());
if let Some(resp) = errors.first() {
response.set_status(resp.status_code());
}
}
}}

View File

@@ -1,8 +1,12 @@
use std::any::Any;
use crate::error_template::{AppError, ErrorTemplate};
use leptos::prelude::*;
use leptos::{either::Either, ev::SubmitEvent, html, prelude::*};
use leptos_meta::*;
use leptos_router::{components::*, StaticSegment};
use message::Message;
use serde::{Deserialize, Serialize};
pub mod error_template;
@@ -55,63 +59,155 @@ pub fn App() -> impl IntoView {
}
}
fn smooth_scroll_to_bottom() {
if let Some(window) = web_sys::window() {
if let Some(document) = window.document() {
if let Some(body) = document.get_element_by_id("messages") {
body.set_scroll_top(body.scroll_height());
leptos::logging::log!("moving to top");
}
}
}
}
#[component]
pub fn HomePage() -> impl IntoView {
let messages = message::get_messages();
let conversation_id = uuid::Uuid::new_v4();
let send_message = ServerAction::<SendMessage>::new();
let messages = Resource::new(
move || (send_message.version().get()),
move |_| {
get_messages(GetMessagesRequest {
conversation_id: conversation_id.clone(),
})
},
);
let existing_messages = move || {
Suspend::new(async move {
messages.await.map(|messages| {
if messages.messages.is_empty() {
Either::Left(view! { <p>"No messages sent yet"</p> })
} else {
Either::Right(
messages
.messages
.iter()
.map(move |message| {
view! {
<div class=format!(
"flex {}",
if message.role == "assistant" {
"justify-start"
} else {
"justify-end"
},
)>
<div class=format!(
"max-w-[80%] rounded-sm px-4 py-3 {}",
if message.role == "assistant" {
"bg-white border border-gray-200"
} else {
"bg-blue-500 text-white"
},
)>{message.content.clone()}</div>
</div>
}
})
.collect::<Vec<_>>(),
)
}
})
})
};
// let (_, set_messages) = signal(
// message::get_messages()
// .into_iter()
// .enumerate()
// .map(|(index, value)| (index, ArcRwSignal::new(value)))
// .collect::<Vec<_>>(),
// );
let (input, set_input) = signal("".to_string());
let on_submit = move |ev: SubmitEvent| {
// stop the page from reloading!
ev.prevent_default();
leptos::logging::log!("sending request");
send_message.dispatch(SendMessage {
request: SendMessageRequest {
conversation_id: Some(conversation_id.clone()),
role: "user".into(),
content: input.get(),
},
});
set_input.set("".into());
// let messages_len = messages.get().len();
// let mut messages = set_messages.write();
// messages.push((
// messages_len,
// ArcRwSignal::new(Message {
// role: "user".into(),
// content: input.get().into(),
// }),
// ));
// request_animation_frame(move || {
// smooth_scroll_to_bottom();
// });
};
view! {
<div class="flex flex-col h-screen bg-gray-50">
<header class="bg-white border-b border-gray-200 px-4 py-4 flex items-center">
<div class="max-w-5xl mx-auto w-full flex items-center justify-between">
<header class="flex items-center py-4 px-4 bg-white border-b border-gray-200">
<div class="flex justify-between items-center mx-auto w-full max-w-5xl">
<h1 class="text-xl font-semibold text-gray-800">Medical Assistant</h1>
<button class="flex items-center gap-2 px-4 py-2 text-sm text-gray-600 bg-white border border-gray-200 rounded-sm hover:bg-gray-50">
<button class="flex gap-2 items-center py-2 px-4 text-sm text-gray-600 bg-white rounded-sm border border-gray-200 hover:bg-gray-50">
New Chat
</button>
</div>
</header>
<div class="flex-1 overflow-y-auto px-4">
<div class="max-w-5xl mx-auto py-6 space-y-6">
{
messages.iter().map(|message| view!{
<div
class={format!("flex {}", if message.role == "assistant" { "justify-start"} else {"justify-end"})}
>
<div
class=format!("max-w-[80%] rounded-sm px-4 py-3 {}", if message.role == "assistant" {
"bg-white border border-gray-200"
} else {
"bg-blue-500 text-white"
})
>
{message.content.clone()}
</div>
</div>
}).collect_view()
}
<div class="overflow-y-auto flex-1 px-4" id="messages">
<div class="py-6 mx-auto space-y-6 max-w-5xl">
<Transition fallback=move || {
view! {
<div class="flex justify-start">
<div class="max-w-[80%] rounded-sm px-4 py-3 bg-white border border-gray-200">
<div class="py-3 px-4 bg-white rounded-sm border border-gray-200 max-w-[80%]">
"Loading..."
</div>
</div>
}
}>
<ErrorBoundary fallback=|errors| {
view! { <ErrorTemplate errors /> }
}>{existing_messages}</ErrorBoundary>
</Transition>
<div />
</div>
</div>
<div class="border-t border-gray-200 bg-white px-4 py-4">
<form class="max-w-5xl mx-auto">
<div class="py-4 px-4 bg-white border-t border-gray-200">
<form class="mx-auto max-w-5xl" on:submit=on_submit>
<div class="flex gap-4">
<input
type="text"
placeholder="Type your medical question here..."
class="flex-1 rounded-sm border border-gray-200 px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
class="flex-1 py-2 px-4 rounded-sm border border-gray-200 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none"
bind:value=(input, set_input)
/>
<button
type="submit"
class="px-4 py-2 bg-blue-500 text-white rounded-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
class="flex gap-2 items-center py-2 px-4 text-white bg-blue-500 rounded-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed"
>
Send
</button>
@@ -121,3 +217,48 @@ pub fn HomePage() -> impl IntoView {
</div>
}
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct GetMessagesRequest {
conversation_id: uuid::Uuid,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Messages {
pub messages: Vec<Message>,
}
#[server]
pub async fn get_messages(req: GetMessagesRequest) -> Result<Messages, ServerFnError> {
let messages: Vec<Message> = reqwest::get(format!(
"https://lebusiness-service.prod.kjuulh.app/api/messages?conversation_id={}",
req.conversation_id,
))
.await
.map_err(|e| ServerFnError::new(e.to_string()))?
.json()
.await
.map_err(|e| ServerFnError::new(e.to_string()))?;
Ok(Messages { messages })
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct SendMessageRequest {
conversation_id: Option<uuid::Uuid>,
role: String,
content: String,
}
#[server]
pub async fn send_message(request: SendMessageRequest) -> Result<(), ServerFnError> {
let client = reqwest::Client::new();
client
.post("https://lebusiness-service.prod.kjuulh.app/api/messages")
.json(&request)
.send()
.await
.map_err(|e| ServerFnError::new(e.to_string()))?;
Ok(())
}

View File

@@ -1,3 +1,6 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Message {
pub role: String,
pub content: String,
@@ -7,35 +10,43 @@ pub fn get_messages() -> Vec<Message> {
vec![
Message {
role: "assistant".into(),
content: "Hello doctor, I've been experiencing severe headaches several times a month. They usually come with nausea and sensitivity to light. Sometimes I see flickering lights before they start. I've tried over-the-counter painkillers but they don't help much.".into()
#[rustfmt::skip]
content: "Hello doctor, I've been experiencing severe headaches several times a month. They usually come with nausea and sensitivity to light. Sometimes I see flickering lights before they start. I've tried over-the-counter painkillers but they don't help much.".into(),
},
Message {
role: "user".into(),
content: "I understand how difficult migraines can be. From what you're describing - the visual aura, nausea, and light sensitivity - this sounds like classic migraine. Can you tell me how long these episodes typically last?".into()
#[rustfmt::skip]
content: "I understand how difficult migraines can be. From what you're describing - the visual aura, nausea, and light sensitivity - this sounds like classic migraine. Can you tell me how long these episodes typically last?".into(),
},
Message {
role: "assistant".into(),
content: "They usually last anywhere from 4 to 24 hours. The worst part is that I have to stay in a dark room and can't work during these episodes. They seem to happen more often when I'm stressed at work.".into()
#[rustfmt::skip]
content: "They usually last anywhere from 4 to 24 hours. The worst part is that I have to stay in a dark room and can't work during these episodes. They seem to happen more often when I'm stressed at work.".into(),
},
Message {
role: "user".into(),
content: "Thank you for those details. Stress is indeed a common trigger for migraines. I'd like to suggest a two-pronged approach: first, a preventive medication like propranolol to reduce frequency, and second, a triptan medication to take when you feel a migraine coming on. We should also start a headache diary to track your triggers. Would you be comfortable trying this treatment plan?".into()
#[rustfmt::skip]
content: "Thank you for those details. Stress is indeed a common trigger for migraines. I'd like to suggest a two-pronged approach: first, a preventive medication like propranolol to reduce frequency, and second, a triptan medication to take when you feel a migraine coming on. We should also start a headache diary to track your triggers. Would you be comfortable trying this treatment plan?".into(),
},
Message {
role: "assistant".into(),
content: "Yes, I'd be willing to try that. I've heard about headache diaries - what exactly should I record in it?".into()
#[rustfmt::skip]
content: "Yes, I'd be willing to try that. I've heard about headache diaries - what exactly should I record in it?".into(),
},
Message {
role: "user".into(),
content: "In your headache diary, please record: the date and time of each migraine, what you ate that day, stress levels, sleep patterns, and any other symptoms. This will help us identify patterns and triggers. Use your phone to note these details. I'll prescribe sumatriptan 50mg - take one tablet at the first sign of a migraine. For prevention, start with propranolol 40mg daily. Let's schedule a follow-up in 4 weeks to assess how you're responding to the treatment.".into()
#[rustfmt::skip]
content: "In your headache diary, please record: the date and time of each migraine, what you ate that day, stress levels, sleep patterns, and any other symptoms. This will help us identify patterns and triggers. Use your phone to note these details. I'll prescribe sumatriptan 50mg - take one tablet at the first sign of a migraine. For prevention, start with propranolol 40mg daily. Let's schedule a follow-up in 4 weeks to assess how you're responding to the treatment.".into(),
},
Message {
role: "assistant".into(),
content: "That sounds good. Should I be aware of any side effects from these medications? And should I continue with my regular exercise routine?".into()
#[rustfmt::skip]
content: "That sounds good. Should I be aware of any side effects from these medications? And should I continue with my regular exercise routine?".into(),
},
Message {
role: "user".into(),
content: "Common side effects of sumatriptan can include mild nausea, dizziness, or chest tightness. With propranolol, you might notice slight fatigue initially. Both are generally well-tolerated. Regular exercise is actually beneficial for migraine prevention - continue your routine but stay hydrated and avoid very intense workouts during a migraine attack. If you experience any concerning side effects, contact me immediately. Also, remember to avoid common migraine triggers like irregular meals and poor sleep patterns.".into()
#[rustfmt::skip]
content: "Common side effects of sumatriptan can include mild nausea, dizziness, or chest tightness. With propranolol, you might notice slight fatigue initially. Both are generally well-tolerated. Regular exercise is actually beneficial for migraine prevention - continue your routine but stay hydrated and avoid very intense workouts during a migraine attack. If you experience any concerning side effects, contact me immediately. Also, remember to avoid common migraine triggers like irregular meals and poor sleep patterns.".into(),
},
]
}
}

View File

@@ -13,12 +13,12 @@
}
},
"node_modules/@playwright/test": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz",
"integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.54.1.tgz",
"integrity": "sha512-FS8hQ12acieG2dYSksmLOF7BNxnVf2afRJdCuM1eMSxj6QTSE6G4InGF7oApGgDb65MX7AwMVlIkpru0yZA4Xw==",
"dev": true,
"dependencies": {
"playwright": "1.49.1"
"playwright": "1.54.1"
},
"bin": {
"playwright": "cli.js"
@@ -42,12 +42,12 @@
}
},
"node_modules/playwright": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz",
"integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.1.tgz",
"integrity": "sha512-peWpSwIBmSLi6aW2auvrUtf2DqY16YYcCMO8rTVx486jKmDTJg7UAhyrraP98GB8BoPURZP8+nxO7TSd4cPr5g==",
"dev": true,
"dependencies": {
"playwright-core": "1.49.1"
"playwright-core": "1.54.1"
},
"bin": {
"playwright": "cli.js"
@@ -60,9 +60,9 @@
}
},
"node_modules/playwright-core": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz",
"integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.1.tgz",
"integrity": "sha512-Nbjs2zjj0htNhzgiy5wu+3w09YetDx5pkrpI/kZotDlDUaYk0HVA5xrBVPdow4SAUIlhgKcJeJg4GRKW6xHusA==",
"dev": true,
"bin": {
"playwright-core": "cli.js"
@@ -74,12 +74,12 @@
},
"dependencies": {
"@playwright/test": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz",
"integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.54.1.tgz",
"integrity": "sha512-FS8hQ12acieG2dYSksmLOF7BNxnVf2afRJdCuM1eMSxj6QTSE6G4InGF7oApGgDb65MX7AwMVlIkpru0yZA4Xw==",
"dev": true,
"requires": {
"playwright": "1.49.1"
"playwright": "1.54.1"
}
},
"fsevents": {
@@ -90,19 +90,19 @@
"optional": true
},
"playwright": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz",
"integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.1.tgz",
"integrity": "sha512-peWpSwIBmSLi6aW2auvrUtf2DqY16YYcCMO8rTVx486jKmDTJg7UAhyrraP98GB8BoPURZP8+nxO7TSd4cPr5g==",
"dev": true,
"requires": {
"fsevents": "2.3.2",
"playwright-core": "1.49.1"
"playwright-core": "1.54.1"
}
},
"playwright-core": {
"version": "1.49.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz",
"integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==",
"version": "1.54.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.1.tgz",
"integrity": "sha512-Nbjs2zjj0htNhzgiy5wu+3w09YetDx5pkrpI/kZotDlDUaYk0HVA5xrBVPdow4SAUIlhgKcJeJg4GRKW6xHusA==",
"dev": true
}
}