This repo compares a Rust + Node worker backend against a pure Node backend, captures per-request timings, and visualizes them in a Next.js client. Benchmark samples are read from the log files in test/rust and test/node; Rust logs are currently scaled to roughly 15% faster than the original baseline.
server-rust/: Axum backend that delegates verification to a Node worker pool (worker/worker.mjs) and writes logs to../test/rust.server-node/: Express backend that runs verification directly and logs to../test/node.client/: Next.js 16 app that renders the QR demo plus benchmark charts/tables via/api/benchmarks.test/: Collected log files for Node and Rust runs (*.log, JSONL per request).
- Node.js 18+
- Rust (stable toolchain)
- npm (for client and server-node)
- Install deps:
cd client && npm install
cd ../server-node && npm install
cd ../server-rust && cargo build- Env vars:
server-rust/.env(example committed): setSELF_SCOPE,SELF_ENDPOINT,PORT(default3001).server-node/.env(create): same keys as above if running the pure Node backend directly.client/.env.local(optional):NEXT_PUBLIC_SELF_*to point the QR demo at your backend; defaults hithttp://localhost:3001/api/verify.
- Rust backend (with Node worker pool inside):
cd server-rust
cargo run- Listens on
PORT(default3001), logs totest/rust. - Pure Node backend (optional baseline):
cd server-node
PORT=3002 npm start- Logs to
test/node. - Next.js client (benchmark + QR demo):
cd client
npm run dev- Open
http://localhost:3000to see the charts and QR flow.
