diff --git a/README.md b/README.md index ca83fc0..c1a75ee 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,31 @@ Transfer files and text between devices by displaying high-throughput animated Q Everything runs locally in the browser or terminal: no upload server, no Bluetooth, no cable. +RaptorQR is a project inspired by [hermitm0nk/qr-stream](https://github.com/hermitm0nk/qr-stream). The project has since become a substantial rewrite of the core transfer pipeline and user experience: FEC, QR rendering, worker scheduling, scanner integration, sender/receiver UI, CLI packaging, and the repo layout have all been rebuilt around a higher-throughput, production-ready architecture. + Live demo: https://qr.linkto.host/ +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Finfrost%2Fraptorqr) + +## Performance + +RaptorQR uses the Rust [`cberner/raptorq`](https://github.com/cberner/raptorq) implementation of RaptorQ (RFC 6330), compiled to WASM, as its primary fountain-code codec. This project also compiles [`erwanvivien/fast_qr`](https://github.com/erwanvivien/fast_qr) to WASM for high-speed QR rendering, with a more feature-complete wrapper than the upstream WASM package, and uses ZXing WASM for scanning. + +The result is a massive performance improvement over the original JavaScript-only transfer path. In measured tests, the new pipeline reaches at least **50x+ higher throughput** in practical transfer scenarios. + +Measured examples: + +| Scenario | Result | +| ----------------------------------------- | -----------------------------: | +| V20 QR, 4-code parallel playback, 30 FPS | up to 300 decoded QR symbols/s | +| V30 QR, 4-code parallel playback, 30 FPS | 100+ decoded QR symbols/s | +| 95.2 KB file transfer (V30-L x 4QR@30fps) | 375 ms, about 254.0 KB/s | +| 3.0 MB file transfer (V30-L x 4QR@30fps) | about 100 KB/s | + +The 95.2 KB and 3.0 MB file tests were measured on **iPhone 16 / Safari as QR scanner**. Actual speed depends on device camera quality, browser performance, lighting, QR size, QR version, playback rate, and scan settings. + +The current RaptorQ WASM path is intended to be production-ready for local offline transfer workflows. + ## Packages ```text @@ -18,10 +41,11 @@ apps/web Preact/Vite web app ## Features * Browser sender/receiver for text and file transfer +* Improved sender/receiver UI for live playback, scanning, tuning, and transfer status * Terminal sender via the `raptorqr` CLI * Primary RaptorQ WASM fountain codec -* Deprecated JS RLNC compatible codec kept for explicit comparison and old flows -* fast_qr WASM QR rendering, plus ZXing WASM writer option +* JS RLNC compatible codec (Deprecated) +* fast_qr WASM QR rendering, (ZXing WASM QR writer as optional) * ZXing WASM QR scanning with configurable decoder settings * Parallel QR playback, live Canvas rendering, and optional GIF export * Adjustable QR version, ECC level, playback FPS, scan FPS, and repair overhead @@ -34,18 +58,42 @@ Install dependencies: pnpm install ``` -Run the web app: +Run the web app in development: ```bash pnpm dev:web ``` +Then open the Vite URL printed in the terminal, usually: + +```text +http://localhost:5173 +``` + +If you need camera access from another device on the same LAN, serve it over an allowed HTTPS/dev host as required by your browser's camera security policy. + Build everything: ```bash pnpm build ``` +### Deploy Web App On Vercel + +This repo includes a root `vercel.json`, so Vercel can deploy the web app from the monorepo without changing the project root in the dashboard. + +Vercel will run: + +```bash +pnpm --filter @raptorqr/web build +``` + +and serve: + +```text +apps/web/dist +``` + Run tests: ```bash @@ -89,13 +137,15 @@ packages/raptorqr-wasm/src/fast_qr/wasm packages/raptorqr-wasm/src/raptorq/wasm ``` -The Colab build scripts are: +The build scripts are: ```text packages/raptorqr-wasm/src/fast_qr/build_fast_qr_wasm_colab.py packages/raptorqr-wasm/src/raptorq/build_raptorq_wasm_colab.py ``` +You can paste the scripts into a Colab notebook to build the WASM artifacts. The scripts will download and build the upstream Rust dependencies, then compile them to WASM. + ## Implementation Notes The protocol keeps the existing fixed 8-byte transport header. RaptorQ packets use the reserved symbol index sentinel, while JS RLNC packets use the legacy symbol index range. diff --git a/package.json b/package.json index baf98d2..319729a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "description": "High-throughput QR transfer toolkit and web app", "type": "module", + "packageManager": "pnpm@10.15.1", "engines": { "node": ">=18" }, diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..e928c83 --- /dev/null +++ b/vercel.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "framework": "vite", + "installCommand": "pnpm install --frozen-lockfile", + "buildCommand": "pnpm --filter @raptorqr/web build", + "outputDirectory": "apps/web/dist" +}