Skip to content

codeHannan/benchrig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

⚙️ BenchRig

Hardware & Network Diagnostic Platform — entirely in your browser

Bench your mouse, keyboard, audio, display, CPU and connection with zero installs. No drivers. No downloads. Open a tab, run the rig, save the report.


Blazor WebAssembly .NET 10 C# Firebase Cloudflare Workers PWA Status License


Diagnostics · Features · Architecture · Quick Start · Deploy


📑 Table of Contents


✨ Overview

BenchRig is a full-featured diagnostic platform built entirely on Blazor WebAssembly (.NET 10) that runs 100% client-side in any modern browser. It turns a browser tab into a hardware lab: probe your peripherals, stress-test your CPU, benchmark your connection, then save a consolidated diagnostic report to the cloud — without installing a single driver or executable.

But BenchRig is more than a test bench. It ships with a community forum, a curated solutions knowledge base, a support-ticket helpdesk, an AI troubleshooting assistant, donations, and a full admin console — making it a complete, production-shaped web product rather than a classroom demo.

🎓 Engineered as a Fourth-Semester Visual Programming project at Air University (BSCS) — built like real SaaS.


💡 Why BenchRig?

Traditional diagnostic tools BenchRig
Install Downloads, drivers, admin rights ❌ None — runs in the browser
Platform Usually Windows-only .exe ✅ Any OS with a modern browser
Trust Opaque native binaries ✅ Open, sandboxed web APIs
Reports Local files you lose ✅ Saved to your account, anywhere
Help You're on your own ✅ AI assistant + forum + helpdesk
Updates Re-download every release ✅ Always the latest, instantly

🧪 Diagnostic Suite

Six independent test modules, each backed by a clean Engine → Orchestrator → State → UI pipeline so the diagnostic logic is pure C#, fully decoupled from the browser, and unit-testable.

🖱️ Mouse

  • Click & double-click accuracy
  • Button mapping (L / R / middle / side)
  • Scroll-wheel behavior
  • Polling rate, jitter & latency

⌨️ Keyboard

  • Full-layout key coverage
  • N-key roll-over & ghosting detection
  • Stuck-key & repeat checks
  • Per-key press latency

🔊 Audio

  • Left / right speaker channel test
  • Microphone capture & level meter
  • Frequency sweep + waveform analysis

🖥️ Monitor

  • Dead / stuck pixel hunt
  • Color banding & gradient uniformity
  • Response-time & ghosting patterns

🧠 Compute

  • CPU stress workloads
  • Throughput benchmarking
  • Sustained-performance scoring

🌍 Network

  • Download / upload throughput
  • Ping & jitter
  • Geo-located server selection (Leaflet map)
  • Self-hostable Cloudflare Worker backend

🧾 Every module feeds the Report Builder, which compiles a single, shareable diagnostic report saved to Firestore.


🚀 Platform Features

📋Diagnostic ReportsConsolidated, account-bound reports compiled from every test you run.
🤖AI AssistantIn-app chatbot (powered by Gemini) that interprets results and walks you through fixes.
💬Community ForumThreaded posts, nested comments (up to 3 deep) and 1–5 star ratings.
📚Solutions Knowledge BaseCurated, admin-authored articles for common hardware problems.
🎫Support HelpdeskUsers open tickets; staff reply in a secured, role-gated thread.
🛡️Admin ConsoleDashboard, ticket management and solution-article authoring.
🔐AuthenticationFirebase email/password auth with role-based access (user / admin).
🗺️Geo-aware TestsLeaflet map + location picker to benchmark the nearest server.
💳DonationsStripe-powered "buy me a coffee" support flow.
📱Installable PWAOffline-first service worker; installs to desktop or phone.

🏗️ Architecture

BenchRig follows a layered, dependency-injected architecture. All browser-specific work hides behind interfaces (IJs*Bridge), so the core diagnostic logic stays platform-agnostic, mockable, and testable. State is held in scoped containers (one instance per browser tab), and every test is driven by a dedicated orchestrator.

╔══════════════════════════════════════════════════════════════╗
║  Pages / Components        Razor UI (routable + reusable)    ║
╠══════════════════════════════════════════════════════════════╣
║  State Containers          scoped per browser tab            ║
╠══════════════════════════════════════════════════════════════╣
║  Orchestrators             coordinate a full test run        ║
╠══════════════════════════════════════════════════════════════╣
║  Engines                   pure C# diagnostic logic          ║
╠══════════════════════════════════════════════════════════════╣
║  JS Interop Bridges        IJs*Bridge → native browser APIs  ║
╚══════════════════════════════════════════════════════════════╝
              │                                  │
              ▼                                  ▼
     Firebase Auth / Firestore        Cloudflare Worker
     (identity, reports, forum,       (CORS-enabled, self-hosted
      tickets, solutions)              speed-test backend)

Design principles

  • 🧩 Separation of concerns — UI never touches IJSRuntime directly; it goes through a bridge.
  • 🔌 Inversion of control — everything is registered in Program.cs and injected.
  • 🧪 Testable core — engines are plain C# with no Blazor dependency.
  • 🗂️ Feature-first folders — models, components and engines are grouped by domain.

🔄 How a Test Runs

User clicks "Start"
        │
        ▼
  ┌───────────────┐   reads/writes    ┌────────────────────┐
  │  Razor Page   │ ◄───────────────► │  State Container   │  (scoped, reactive)
  └──────┬────────┘                   └────────────────────┘
         │ invokes
         ▼
  ┌───────────────┐   calls            ┌────────────────────┐
  │ Orchestrator  │ ─────────────────► │   IJs*Bridge        │ ──► Browser API (Web Audio,
  └──────┬────────┘                    └────────────────────┘     Pointer, Canvas, etc.)
         │ feeds raw samples
         ▼
  ┌───────────────┐   produces         ┌────────────────────┐
  │    Engine      │ ─────────────────► │   Result / Score    │ ──► Report Builder ──► Firestore
  └───────────────┘                    └────────────────────┘

🛠️ Tech Stack

Layer Technology
Frontend Blazor WebAssembly · .NET 10 · C# · Razor Components · scoped CSS
Browser APIs JS Interop bridges — Web Audio, Pointer, Keyboard, Canvas, Geolocation
Auth & Data Firebase Authentication · Cloud Firestore
Speed-test backend Cloudflare Worker (LibreSpeed-compatible + CORS proxy)
AI Gemini-powered chatbot assistant
Maps & Payments Leaflet · Stripe
Delivery Progressive Web App · offline-first service worker · Firebase Hosting

🧭 Application Routes

Route Page Access
/ Home / dashboard Public
/mouse /keyboard /audio Peripheral diagnostics Public
/monitor /compute /network Display / CPU / network diagnostics Public
/report Consolidated diagnostic report Auth
/forum · /forum/{PostId} Community forum & threads Public read
/solutions · /solutions/{Id} Knowledge-base articles Public read
/support Support ticket helpdesk Auth
/donate Stripe donation flow Public
/login · /register · /account Authentication & profile Public / Auth
/admin · /admin/tickets · /admin/solutions Admin console Admin only

📂 Project Structure

BenchRig/
├── BenchRig.App/                 # Blazor WebAssembly client
│   ├── Core/
│   │   ├── Engines/              # Pure diagnostic logic (Mouse, Keyboard, Network, Report…)
│   │   ├── Models/              # Domain models, grouped by feature
│   │   ├── Interfaces/          # IJs*Bridge contracts
│   │   ├── Constants/ · Util/   # Shared constants & helpers
│   ├── Services/
│   │   ├── Orchestrators/       # Drive each test end-to-end
│   │   ├── State/              # Scoped, reactive state containers
│   │   ├── JsInterop/          # Bridge implementations (browser APIs)
│   │   └── Auth/               # AuthService, AdminGuardService
│   ├── Pages/                   # Routable pages (diagnostics, forum, admin, auth…)
│   ├── Components/              # Reusable UI, grouped by feature
│   ├── Program.cs               # DI registration & app bootstrap
│   └── wwwroot/                 # JS interop, CSS, icons, manifest, service worker
├── cloudflare-worker/           # Free, CORS-enabled speed-test backend
├── firestore.rules              # Hardened, role-based Firestore security rules
└── firebase.json                # Hosting config (SPA rewrites + cache headers)

⚙️ Configuration

🔥 Firebase (auth, forum, reports, tickets)
  1. Create a project at the Firebase Console.
  2. Enable Email/Password authentication and Cloud Firestore.
  3. Drop your web-app keys into BenchRig.App/wwwroot/firebase-config.js.
  4. Deploy the bundled, hardened security rules:
firebase deploy --only firestore:rules
☁️ Cloudflare Worker (self-hosted speed test)

Browsers can only run speed tests against servers that send Access-Control-Allow-Origin: *. The included Worker provides exactly that — a free, CORS-enabled backend you control (and it can proxy other LibreSpeed servers for location-specific tests).

npm i -g wrangler
wrangler login
cd cloudflare-worker
wrangler deploy

Add the printed URL to BenchRig.App/wwwroot/network-servers.json (or via Network → + Add at runtime). Full guide: cloudflare-worker/README.md.


🔐 Security Model

Firestore access is governed by firestore.rules — defense in depth, enforced server-side:

  • 🧑‍⚖️ Role-based access controluser vs admin; roles can't be self-escalated.
  • 🔑 Ownership checks — users may only mutate their own posts, comments, tickets and reports.
  • ✅ Field validation — required fields and length limits on every write (titles, bodies, ratings, comment depth).
  • 🎫 Gated helpdesk — ticket threads readable only by their owner or an admin; staff replies must match real role.
  • 🛑 Default-deny — anything not explicitly permitted is rejected.

🗺️ Roadmap

  • 🎮 GPU diagnostics (WebGL / WebGPU stress patterns)
  • 🧾 Exportable PDF diagnostic reports
  • 📈 Historical report trends & device comparisons
  • 🌐 Multi-language UI
  • 🏷️ Shareable public report links

❓ FAQ

Do I need to install anything to use BenchRig?
No. It runs entirely in the browser on Blazor WebAssembly — no drivers, no executables. You can optionally install it as a PWA for offline use.
Does it work without a Firebase / Cloudflare account?
Yes. The diagnostic tools run standalone. Firebase enables accounts, cloud reports, the forum and the helpdesk; the Cloudflare Worker is only needed if you want your own speed-test server.
Is my hardware data sent anywhere?
Tests run locally in your browser. Results are only persisted to Firestore — under your own account — when you choose to save a report.
Which browsers are supported?
Any modern browser with WebAssembly and the relevant web APIs (Chrome, Edge, Firefox). Some tests rely on Web Audio / Pointer / Geolocation permissions.

👤 Author

Abdul Hannan Qureshi BSCS — Air University · Visual Programming

GitHub


📄 License & Usage

⚠️ This project is NOT free to use.

© 2026 Abdul Hannan Qureshi. All Rights Reserved.

This software and its source code are proprietary. No part of this repository may be copied, reproduced, modified, distributed, published, sublicensed, or used — in whole or in part, for personal, academic, or commercial purposes — without the prior, explicit, written permission of the author.

Viewing the source for reference is permitted; using or redistributing it is not. For licensing or usage requests, contact the author.


⭐ If BenchRig impressed you, drop a star — it means a lot.

Built with 💜, C#, and Blazor WebAssembly.

About

Browser-based hardware & network diagnostic platform built with Blazor WebAssembly (.NET 10). Test your mouse, keyboard, audio, display, CPU & connection — no installs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors