Skip to content

Commit

Permalink
frontend: add setup components (#644)
Browse files Browse the repository at this point in the history
* add flowbite

* add setup

* add a reusable form

* add on click form

* add setup validator

* add setup action

* add trunk configuration

* add client

* add setup components
  • Loading branch information
vnghia authored Jan 10, 2025
1 parent ad764ff commit cbce034
Show file tree
Hide file tree
Showing 24 changed files with 1,722 additions and 70 deletions.
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions leptosfmt.toml

This file was deleted.

1 change: 1 addition & 0 deletions nghe-api/src/user/setup.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use nghe_proc_macro::api_derive;

#[api_derive(fake = true)]
#[derive(Clone)]
#[endpoint(path = "setupUser", internal = true)]
pub struct Request {
pub username: String,
Expand Down
8 changes: 8 additions & 0 deletions nghe-frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ edition = { workspace = true }
workspace = true

[dependencies]
anyhow = { version = "1.0.95" }
console_error_panic_hook = { version = "0.1.7" }
gloo-net = { version = "0.6.0", default-features = false, features = [
"http",
"json",
] }
leptos = { version = "0.7.2", features = ["csr", "nightly"] }
leptos_router = { version = "0.7.2", features = ["nightly"] }
wasm-bindgen = { version = "0.2.99" }

nghe_api = { path = "../nghe-api" }
web-sys = "0.3.76"
6 changes: 6 additions & 0 deletions nghe-frontend/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[serve]
port = 8080
open = true

[[proxy]]
backend = "http://localhost:3000/rest"
3 changes: 2 additions & 1 deletion nghe-frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<head>
<!-- Add a plain CSS file: see https://trunkrs.dev/assets/#css -->
<!-- If using Tailwind with Leptos CSR, see https://trunkrs.dev/assets/#tailwind instead-->
<link data-trunk rel="scss" href="public/styles.scss" />
<link data-trunk rel="css" href="public/tailwind.css" />
<!-- Include favicon in dist output: see https://trunkrs.dev/assets/#icon -->
<link data-trunk rel="icon" href="public/favicon.ico" />
<!-- include support for `wasm-bindgen --weak-refs` - see: https://rustwasm.github.io/docs/wasm-bindgen/reference/weak-references.html -->
<link data-trunk rel="rust" data-wasm-opt="z" data-weak-refs />
<script data-trunk src="node_modules/flowbite/dist/flowbite.min.js"></script>
</head>
<body></body>
</html>
2 changes: 2 additions & 0 deletions nghe-frontend/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "tailwindcss";
@config "./tailwind.config.js";
Loading

0 comments on commit cbce034

Please sign in to comment.