- Rust 94.5%
- Nix 4.4%
- CSS 0.7%
- Dockerfile 0.3%
- JavaScript 0.1%
Replace the old consume/supply/transaction pages with a page set mirroring the current cdb server: instances, inventory, flows, flow-runs, shopping list, warnings, account, and admin (users/tokens). Largely rewrite api.rs to match the server's routes and JSON shapes, and enable chrono's serde feature for the shared types. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .cargo | ||
| .woodpecker | ||
| assets | ||
| src | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Containerfile | ||
| Dioxus.toml | ||
| flake.lock | ||
| flake.nix | ||
| nginx.conf | ||
| README.md | ||
| rust-toolchain.toml | ||
| tailwind.config.js | ||
| tailwind.css | ||
CDB Client
A Dioxus web client for CDB.
Development
The project ships a Nix flake with a complete development shell — a pinned Rust
toolchain (with the wasm32-unknown-unknown target), the matching dx
(dioxus-cli), wasm-bindgen, tailwindcss, and the native libraries needed for
the optional desktop build.
nix develop
Then run the web app with hot reload:
dx serve --platform web
To produce a production bundle (output under target/dx/cdb_client/release/web/public):
dx bundle --platform web --release --debug-symbols false
--debug-symbols falsestrips DWARF debug info, which otherwise crashes
binaryen'swasm-optduring release optimization.
Tailwind CSS is compiled automatically by
build.rs(it shells out to the
tailwindcssbinary provided by the dev shell), so there's no separate watch
step to run.
Without Nix
If you prefer not to use Nix, you'll need to match the versions yourself:
- Rust (stable) with the
wasm32-unknown-unknowntarget dioxus-cli0.7.9wasm-bindgen-cli0.2.125tailwindcss3.x
Build & Deploy
The flake builds a reproducible production artifact and a self-contained nginx
container image (no external/private flake dependencies):
nix build .#cdb_client # static site -> result/public
nix build .#containerImage # OCI image serving the site via nginx
Project layout
.
├─ assets/ # static assets (favicon, CSS); tailwind.css is generated
├─ src/
│ ├─ main.rs # app entry point + routing
│ ├─ api.rs # backend API client
│ ├─ page/ # routed pages
│ ├─ qrscan.rs # QR code scanning
│ ├─ setup.rs # initial credential setup
│ └─ store.rs # local storage helpers
├─ flake.nix # dev shell + build + container
├─ rust-toolchain.toml
└─ Dioxus.toml