Skip to content

Viniciusap/mybuild-stats

Repository files navigation

MyBuild Stats

Also available: Enterprise Debloat — standalone PowerShell debloat CLI for Windows, now in its own repo.

Two tools for the serious Windows user — pick your path:

🎮 Gamer Dashboard 🏢 Enterprise Debloat
What Self-hosted web dashboard for your PC build PowerShell debloat CLI for Windows
Who PC enthusiasts, gamers, builders IT admins, power users
How npm run dev → open localhost:3000 One PowerShell one-liner
Requires Node.js 18+, Windows 10/11 Windows 10/11, PowerShell 5.1
Features Hardware gauges, system optimizations, upgrade tracking, price alerts, maintenance automations, dev tools manager Interactive menu or silent CLI, 13 modules, audit log, GPO-safe

Contents



🎮 Gamer Dashboard

Live Demo — static preview with mock data.

Local, self-hosted hardware command center for Windows. Monitors your PC in real time, tracks component depreciation, watches upgrade prices, runs maintenance tasks, and manages dev tools — all from a clean dark-mode web UI.

Features

Hardware Dashboard

Real-time gauges for every major component, auto-refreshed every 15 seconds.

Component Metrics
CPU Load %, temperature, base/boost clock, cores/threads, socket
GPU Utilization %, temperature, VRAM usage, driver version & date
RAM Used/free GB, usage %, stick count, speed, type, part number, brand
Storage Capacity used %, S.M.A.R.T health status, interface, temperature

Each card shows:

  • Speedometer gauge — color shifts green → amber → red as values approach warning/critical thresholds.
  • Hover tooltip on the gauge — shows exact value, max, warn/critical thresholds, and current zone (OK / WARNING / CRITICAL).
  • Component image — auto-fetched from DuckDuckGo on first load; click to open the image search modal and pick a different one.
  • Age badge — how long you have owned the component, derived from data/upgrade-path.json.
  • Footer stats — quick-read key values without reading the gauge.

System Info Card

Sidebar card showing OS, Windows build, uptime, motherboard, BIOS version, BIOS age, and GPU driver date.

  • Copy Build button — copies a full markdown-formatted hardware spec sheet to the clipboard, suitable for pasting in forums or support tickets.
  • BIOS age warning — amber highlight and banner if BIOS was released more than 365 days ago.

Case / PC Photo

Upload or search for a photo of your case or full build.

  • SEARCH MODEL tab — queries DuckDuckGo Images by case model name; pick from a 3×3 grid.
  • UPLOAD PHOTO tab — drag-and-drop or file picker; accepts JPG, PNG, WEBP up to 10 MB.

Live Clock

Real-time clock in the header, ticking every second. Format: MM/DD/YYYY HH:MM:SS.


System Optimizations

Collapsible panel that audits 12 Windows performance settings against your detected hardware profile. Results are cached for 5 minutes server-side; click REFRESH to force a recheck.

Check Category What it detects
HAGS GPU Hardware-Accelerated GPU Scheduling enabled/disabled
ReBAR GPU Resizable BAR (Smart Access Memory) status
VBS / HVCI System Virtualization-Based Security — flags if it's hurting GPU performance
Power Plan CPU Detects Balanced/Power Saver vs High Performance / Ultimate Performance
CPU Boost CPU AMD Precision Boost / Intel Turbo state
RAM Speed Memory Actual XMP/EXPO clock vs rated speed — flags if running at stock JEDEC
RAM Channels Memory Dual-channel vs single-channel configuration
Mouse Precision Input Enhanced Pointer Precision (acceleration) on/off
TRIM Storage TRIM enabled for SSDs
Fast Startup System Hybrid shutdown — can interfere with dual-boot and driver updates
GPU MSI Mode GPU Message Signaled Interrupts for the primary GPU
Game Mode System Windows Game Mode enabled/disabled

Each check shows:

  • Status badge: OPTIMAL · SUBOPTIMAL · INFO · N/A (hardware not applicable)
  • Impact level: HIGH · MEDIUM · LOW
  • Fix hint — one-line recommendation when suboptimal
  • Detail modal — full explanation, current value, and manual fix steps

Summary bar in the panel header: N critical · N warnings · All optimized ✓

Checks auto-adapt to your hardware profile — a laptop won't be flagged for missing desktop-only features (e.g. GPU MSI Mode on integrated graphics).


Upgrade Radar

Price-tracking panel for your configured upgrade targets. Displays the cheapest found price per target, a progress bar relative to the reference price, and a discount badge when the price drops ≥10% below reference.

  • A TRIGGER badge fires when the price falls below your configured trigger price.
  • Supported stores: KaBuM, Pichau, Terabyte (requires a Serper.dev API key).
  • Prices are checked automatically every 12 hours via node-cron. You can also force a check manually from the header.

Upgrade & Depreciation Analysis

Side-by-side comparison of your current CPU and GPU against their configured upgrade targets.

Comparison table columns:

  • Current component detected from live hardware
  • Age (months owned)
  • Upgrade target name
  • Target price · Estimated resale value · Net cost (target − resale)
  • Performance gain %
  • Upgrade timing badge

Temporal analysis table columns:

  • Original purchase price · Depreciation % · Monthly depreciation (R$) · R$ per 1% performance gain · Recommendation

Insight cards:

  • Best value — which component gives the most performance per R$ spent on upgrade
  • Optimal window — which component is currently in the ideal resale-value band
  • Total depreciation per month — ongoing cost of keeping current hardware

Timing badges: EARLY · OPTIMAL · VALID · URGENT — based on remaining resale value vs. original price.

Build Timeline

Chronological log of build events grouped by year. Event types:

Type Description
ADDED New component installed
REMOVED Component removed from the build
UPGRADE Component replaced with a newer model
REPAIR Component repaired or RMA'd
DRIVER Driver update logged

Each event shows date, component name, optional price paid, and notes. Seeded from data/build-timeline.json.


Automations Tab

One-click Windows maintenance tasks with live log streaming. Output appears line-by-line as the process runs.

Task Command Admin Required
Flush DNS Cache ipconfig /flushdns No
Clean TEMP Folder PowerShell — clears %TEMP% and C:\Windows\Temp No
Check Drivers PowerShell + Get-WindowsDriver — lists all drivers, flags those older than 365 days No
Upgrade All Packages winget upgrade --all Yes
DISM — Restore Health dism /Online /Cleanup-Image /RestoreHealth Yes
SFC — Scan System Files sfc /scannow Yes
Remove Windows AI Wrapper script — pre-checks system state, then runs RemoveWindowsAi.ps1 -nonInteractive -AllOptions if needed Yes

Admin tasks: Start the dev server (or PM2) from an Administrator terminal. The process running npm run dev needs elevation — there is no UAC prompt from within the app.

Each task card shows:

  • Estimated duration and ADMIN badge where applicable
  • Status badge after completion: DONE · ERROR · COMPLIANT · EXECUTED
  • Last run — time elapsed since the previous run (e.g. COMPLIANT · 2h ago), loaded from persistent history on every page visit
  • Log panel auto-closes 3 seconds after the task finishes

Run history is persisted to scripts/automation-runs.json (per machine, not versioned). A ring buffer keeps the last 50 runs per task.

Remove Windows AI — idempotent pre-check

Before running the upstream script, a wrapper (scripts/run-remove-ai.ps1) queries the system:

  1. AppX packages (*Copilot*, *Recall*, *BingSearch*, *WindowsAI*)
  2. Registry policies (HKLM\…\WindowsAI, HKCU\…\WindowsCopilot)
  3. Scheduled task RemoveAI-UpdateCleanupChecker

If all checks pass → status COMPLIANT (no action taken, ~5s). If any artifact is detected → runs the full removal script → status EXECUTED. Source: zoicware/RemoveWindowsAI.


Tools Tab

Detect, install, and update developer tools on the machine. Powered by Windows where command and winget.

26 tools across 3 categories:

Category Tools
Package Managers winget, Chocolatey, Scoop, npm, pnpm, yarn, Bun, pip, cargo
Runtimes Node.js, Deno, Python, Go, .NET, Java, Rust
Dev Tools Git, GitHub CLI, Docker, kubectl, curl, npx, Azure CLI, AWS CLI, Terraform, make

Each tool card shows:

  • Installed / not installed status with version number
  • External link — opens the tool's official docs or homepage in a new tab
  • UPDATE badge — when winget detects a newer version is available
  • INSTALL button (uninstalled tools with a winget ID) — streams winget install output live
  • UPDATE button (installed tools with an update available) — streams winget upgrade output live
  • Manual install note for tools not available via winget (e.g. Scoop: irm get.scoop.sh | iex)

Header actions:

  • SCAN — re-detects all tools in parallel via where <tool> + <tool> --version
  • CHECK UPDATES — runs winget upgrade --include-unknown and flags outdated tools

Installing tools may require the server to be running as Administrator, depending on the tool.



🏢 Enterprise Debloat

Moved to a dedicated repository: Viniciusap/enterprise-debloat

Standalone PowerShell debloat CLI — 13 modules, GPO-safe, PS5.1 compatible. No install, no cloning required.



Tech Stack

Layer Technology
Framework Next.js 16.2 (App Router, Turbopack)
Language TypeScript 5
Styling Tailwind CSS 3 (custom dark slate theme)
Hardware reads systeminformation 5
Data fetching (client) SWR 2
Input validation Zod 4
Scheduling node-cron 4
Icons lucide-react
Image search DuckDuckGo Images (no API key required)
Price search Serper.dev Google Shopping (optional)
Storage JSON files in data/ (no native build tools required)
Process manager PM2 (optional, for production)

Project Structure

mybuild-stats/
├── app/
│   ├── layout.tsx              # Root layout — TabNav + global styles
│   ├── page.tsx                # Main dashboard page
│   ├── automations/
│   │   └── page.tsx            # Automations tab
│   ├── tools/
│   │   └── page.tsx            # Tools tab — detect / install / update dev tools
│   └── api/
│       ├── hardware/           # GET — live hardware snapshot
│       ├── snapshot/           # POST — save snapshot to JSON
│       ├── prices/             # GET — cached price records + alerts
│       ├── prices/trigger/     # POST — force price check / GET running status
│       ├── optimizations/      # GET — run optimization checks / POST force refresh
│       ├── timeline/           # GET/POST — build events
│       ├── component-image/    # GET status / POST fetch & cache / DELETE clear
│       ├── case-search/        # GET config / POST save / DELETE clear
│       ├── image-search/       # GET — DuckDuckGo image search proxy
│       ├── pc-photo/           # POST upload / DELETE clear
│       ├── automations/        # GET task list / POST run & stream
│       ├── automations/history/ # GET run history (?taskId=)
│       ├── tools/              # GET — detect installed tools + versions
│       ├── tools/install/      # POST — stream winget install/upgrade
│       └── tools/debug/        # GET — spawn diagnostics (dev only)
├── components/
│   ├── ComponentDash.tsx       # CPU / GPU / RAM / Storage cards + gauges
│   ├── OptimizationsPanel.tsx  # System optimizations collapsible panel
│   ├── OptimizationCard.tsx    # Individual check card
│   ├── OptimizationModal.tsx   # Check detail modal with fix steps
│   ├── UpgradeDetailModal.tsx  # Upgrade target detail modal
│   ├── Modal.tsx               # Base modal primitive
│   ├── Gauge.tsx               # SVG 270° speedometer
│   ├── TabNav.tsx              # Dashboard / Automations / Tools navigation
│   ├── LiveClock.tsx           # Real-time ticking clock
│   ├── ComparisonTable.tsx     # Upgrade & depreciation analysis
│   ├── UpgradeRadar.tsx        # Price tracking panel
│   ├── BuildTimeline.tsx       # Chronological build log
│   ├── CaseSearchCard.tsx      # Case image search / upload
│   ├── PcPhotoCard.tsx         # PC photo upload
│   ├── ImageSearchModal.tsx    # Component image picker modal
│   ├── PriceAlertBanner.tsx    # Price alert notifications
│   ├── GlowCard.tsx            # Base card with accent border
│   ├── NeonProgress.tsx        # Horizontal progress bar
│   ├── StatBadge.tsx           # Online / warning / error badge
│   └── index.ts                # Barrel exports
├── lib/
│   ├── styles.ts               # Shared Tailwind class constants (btn, badge, card, text, …)
│   ├── hardware.ts             # systeminformation wrapper → HardwareSnapshot
│   ├── device-profile.ts       # Hardware profile builder for optimization checks
│   ├── optimizations/
│   │   ├── index.ts            # runOptimizationChecks() — orchestrator + cache
│   │   ├── helpers.ts          # Shared registry / WMI read helpers
│   │   ├── dxdiag-cache.ts     # DxDiag XML cache (GPU MSI mode detection)
│   │   └── checks/             # 12 individual check modules
│   ├── automations.ts          # Task registry (id, command, args, requiresAdmin)
│   ├── automation-history.ts   # appendRun / readHistory — ring-buffer JSON persistence
│   ├── buildSpecs.ts           # formatBuildSpecs() — clipboard markdown
│   ├── prices.ts               # Serper.dev integration + price alert logic
│   ├── scheduler.ts            # node-cron 12h price check schedule
│   ├── db.ts                   # JSON file read/write helpers
│   ├── imageCache.ts           # DuckDuckGo search + image download/cache
│   ├── spawn-env.ts            # safeSpawnEnv() — strips secrets from child process env
│   └── utils.ts                # formatAge, formatBRL, getUpgradeTiming, inferRamBrand, …
├── types/
│   ├── index.ts                # Core TypeScript interfaces (HardwareSnapshot, etc.)
│   └── optimization.ts         # Optimization check types (DeviceProfile, CheckResult, …)
├── data/
│   ├── upgrade-path.json       # ✏️  Edit per PC — purchase dates, prices, upgrade targets
│   ├── build-timeline.json     # ✏️  Edit per PC — build history events
│   ├── build-config.json       # Case name + hasImage flag (auto-managed)
│   ├── snapshots.json          # Hardware snapshots (auto-managed)
│   └── events.json             # Timeline events (auto-managed)
├── scripts/
│   ├── RemoveWindowsAi.ps1     # Bundled upstream script (zoicware/RemoveWindowsAI)
│   ├── run-remove-ai.ps1       # Idempotent wrapper — pre-check → COMPLIANT or EXECUTED
│   └── automation-runs.json    # Run history, per machine (gitignored)
├── instrumentation.ts          # Next.js startup hook — seed data, start scheduler, warm cache
└── ecosystem.config.js         # PM2 production config

Setup

Requirements

  • Node.js 18+
  • Windows 10/11 (systeminformation reads WMI data)
  • winget available in PATH (built into Windows 10 1809+)

Install & Run

git clone https://github.com/Viniciusap/mybuild-stats.git
cd mybuild-stats

npm install

# Copy env template and configure (optional but recommended)
cp .env.local.example .env.local
# Edit .env.local with your values

npm run dev

Open http://localhost:3000.

Environment Variables

# .env.local

# Serper.dev API key — enables Google Shopping price search
# Free: https://serper.dev (2,500 queries/month)
# If omitted, falls back to DuckDuckGo (lower quality results)
SERPER_API_KEY=your_key_here

# Price check interval in hours (default: 12)
PRICE_CHECK_INTERVAL_HOURS=12

# Ntfy.sh topic for push notifications on price alerts
# Create a free topic at https://ntfy.sh
# NTFY_TOPIC=mybuild-alerts-yourname

# Optional API secret — protects mutation routes (POST/DELETE)
# When set, all state-modifying requests must include: x-api-key: <value>
# Leave unset for local-only use
# API_SECRET=change-me-to-a-strong-random-string

Production (PM2)

npm run build
pm2 start ecosystem.config.js
pm2 save

Running Tasks that Need Admin

Open a new terminal as Administrator before starting the server:

Right-click Windows Terminal → "Run as administrator"
cd C:\path\to\mybuild-stats
npm run dev

Configuration (per PC)

Only two files need editing when moving to a new machine:

data/upgrade-path.json

{
  "cpu": {
    "current": "AMD Ryzen 7 5700X",
    "purchaseDate": "2023-04-15",   // ISO date
    "purchasePrice": 1200,          // in BRL
    "socket": "AM4",
    "targets": [
      {
        "id": "ryzen-9-5900x",
        "name": "AMD Ryzen 9 5900X",
        "category": "cpu",
        "triggerPrice": 900,        // buy alert threshold
        "estimatedPrice": 1100,     // current market reference
        "performanceGain": 28,      // % vs current
        "stores": ["KaBuM", "Pichau"],
        "searchQuery": "AMD Ryzen 9 5900X",
        "notes": "12c/24t — AM4 ceiling"
      }
    ]
  },
  "gpu": { ... },
  "ram": { ... },
  "storage": { ... }
}

data/build-timeline.json

[
  {
    "date": "2023-04-15",
    "component": "Ryzen 7 5700X",
    "eventType": "added",           // added | removed | upgraded | repaired | driver_update
    "notes": "Primary build",
    "price": 1200
  }
]

All other data (hardware reads, images, snapshots, prices, optimization cache) is handled automatically.


Portability

Everything hardware-related is detected dynamically via systeminformation — CPU brand, GPU name, RAM part numbers, SSD model, motherboard, BIOS. Component image search queries are built from detected names, not hardcoded strings. The System Optimizations panel auto-adapts to your hardware profile (laptop vs desktop, GPU vendor, storage type). The dashboard works on any Windows PC without code changes; only data/upgrade-path.json needs updating with your purchase history and upgrade targets.


Roadmap

Planned features — roughly priority-ordered.

Hardware & Monitoring

Feature Description
Temperature History Charts Line chart of CPU/GPU/SSD temps over time, sourced from periodic snapshots. Visualize thermals across sessions.
Fan Speed Gauges Read RPM for all fans detected by systeminformation. Gauge + min/max history.
Network Monitor Real-time bandwidth (upload/download Mbps), active adapters, ping to a configured host.
Power Draw Estimator Estimate total system TDP from detected components + load %. Show monthly electricity cost in BRL.
Component Health Score Composite 0–100 score per component: combines S.M.A.R.T status, temp zone, age, and driver freshness. Color-coded badge on each card.

Upgrade & Price Tracking

Feature Description
Price History Charts Line chart of price-over-time per upgrade target. See if a component is trending up or down.
Amazon / Mercado Livre support Add stores beyond KaBuM / Pichau / Terabyte. Pluggable store adapters.
Resale Value Estimator Pull used market prices from OLX / Mercado Livre to auto-fill resale value in the depreciation table.
Upgrade Budget Planner Input monthly savings → auto-calculate how many months until you can afford each upgrade target at current prices.

Automations & System

Feature Description
Startup Programs Manager List all startup entries (registry + Task Scheduler). Toggle enable/disable per entry.
Disk Cleanup Advisor Scan for largest folders, old Windows Update caches, duplicate files. One-click delete with size preview.
Scheduled Automation Runs Set automations (DNS flush, TEMP clean, winget upgrade) to run on a cron schedule — not just manually.
Windows Event Log Viewer Surface recent critical/error events from Event Viewer directly in the dashboard.

UX & Export

Feature Description
Performance Snapshot Diff Compare two snapshots side-by-side — see how temps or load changed between sessions.
Export to PDF Generate a printable build report: specs, depreciation table, upgrade recommendations.
Notification Center In-app notification feed for price alerts, temp warnings, and automation completions. Browser push notification support.
Multi-PC Support Manage multiple machines from one dashboard. Switch between build profiles; each has its own data/ directory.

About

Personal build and development statistics tracker

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors