No description
  • Rust 94.7%
  • Nix 4.2%
  • CSS 0.7%
  • Dockerfile 0.3%
  • JavaScript 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
JMARyA 52867d5dfe
refactor: use mir-api for every API type and call
The client carried a hand-written copy of the Mir API in src/api.rs —
~70 types and 63 request functions — that drifted from the server
silently. They now come from the shared mir-api crate in the mir
repository, where every call is checked against the real router.

api.rs keeps only what a browser UI needs: a client built from the
stored credentials (api::mir()), the cached itemdb and locations, and
on-screen labels and badge colours. Pages call mir-api methods directly.
Instance, flow-run and demand routes take Uuid ids. Flow runs and demand
lists are fetched across all pages rather than the server's first page.

reqwest with native-tls is gone from the direct dependencies; mir-api
brings reqwest with rustls (fetch in the browser).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 00:16:27 +02:00
.cargo fix 2025-07-09 16:26:13 +02:00
.woodpecker chore: rename CDB to Mir 2026-10-18 23:16:31 +02:00
assets work 2025-05-28 15:43:50 +02:00
src refactor: use mir-api for every API type and call 2026-10-21 00:16:27 +02:00
.gitignore work 2025-05-28 15:43:50 +02:00
build.rs chore: modernize tooling, real dioxus devshell, drop myverse 2026-06-15 18:54:01 +02:00
Cargo.lock refactor: use mir-api for every API type and call 2026-10-21 00:16:27 +02:00
Cargo.toml refactor: use mir-api for every API type and call 2026-10-21 00:16:27 +02:00
Containerfile chore: rename CDB to Mir 2026-10-18 23:16:31 +02:00
Dioxus.toml feat: demand, stats, corrections and the /api prefix 2026-10-20 18:19:45 +02:00
flake.lock chore: modernize tooling, real dioxus devshell, drop myverse 2026-06-15 18:54:01 +02:00
flake.nix chore: rename CDB to Mir 2026-10-18 23:16:31 +02:00
nginx.conf fix 2025-06-07 22:15:44 +02:00
README.md refactor: use mir-api for every API type and call 2026-10-21 00:16:27 +02:00
rust-toolchain.toml chore: modernize tooling, real dioxus devshell, drop myverse 2026-06-15 18:54:01 +02:00
tailwind.config.js init 2025-05-25 20:03:42 +02:00
tailwind.css feat: user auth 2025-12-14 06:06:45 +01:00

Mir Client

A Dioxus web client for Mir.

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

dx serve proxies /api/* to a local mir on localhost:8080 (see
Dioxus.toml), so the dev setup is same-origin like production. Start mir
with cargo run -- example/config.toml and log in with the prefilled
instance URL (<origin>/api). For a remote server, enter its API base,
e.g. https://mir.example.org/api.

To produce a production bundle (output under target/dx/mir_client/release/web/public):

dx bundle --platform web --release --debug-symbols false

--debug-symbols false strips DWARF debug info, which otherwise crashes
binaryen's wasm-opt during release optimization.

Tailwind CSS is compiled automatically by build.rs (it shells out to the
tailwindcss binary 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-unknown target
  • dioxus-cli 0.7.9
  • wasm-bindgen-cli 0.2.125
  • tailwindcss 3.x

Build & Deploy

The flake builds a reproducible production artifact and a self-contained nginx
container image (no external/private flake dependencies):

nix build .#mir_client       # static site -> result/public
nix build .#containerImage   # OCI image serving the site via nginx

The API

Request and response types and the HTTP calls come from the mir-api crate
in the mir repository, where every call is
checked against the server. Missing an endpoint? Add it there, with a contract
test. To build against a local mir checkout instead of its main branch:

cargo check --config 'patch."https://git.hydrar.de/red/mir".mir-api.path="../mir/crates/mir-api"'

Project layout

.
├─ assets/          # static assets (favicon, CSS); tailwind.css is generated
├─ src/
│  ├─ main.rs       # app entry point + routing
│  ├─ api.rs        # session client, item cache, UI labels
│  ├─ 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