Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 Hardware Viability Calculator

Check PC build viability: chipset compatibility, minimum PSU recommendation and full TDP analysis — available as a web app and a terminal CLI.

🌐 Open the Web App  |  ⌨️ Run in terminal


✨ Features

  • Card-based component selection — pick CPU and GPU from preset cards or enter custom specs
  • Live TDP bar — sticky header shows total power draw as you select components
  • Chipset compatibility — compatible chipsets highlight automatically after CPU selection
  • PSU recommendation — picks the smallest standard commercial PSU that fits (with 30% safety margin)
  • Shareable builds — results are encoded in the URL so you can share any build with a single link
  • Copy results — export the analysis as plain text
  • Mobile-friendly — responsive layout, works on phones and tablets
  • Terminal CLI — full interactive interface for developers using Node.js + TypeScript

🌐 Web App (GitHub Pages)

The index.html at the root is a self-contained single file — no build step, no server required.

Use online

Visit https://caiquecrepaldi.github.io/HardwareViabilidade/

Run locally (open directly in browser)

# Just open the file — no server needed
start index.html        # Windows
open index.html         # macOS
xdg-open index.html     # Linux

Enable GitHub Pages

  1. Go to your repository → SettingsPages
  2. Under Source, choose Deploy from a branch
  3. Select branch main and folder / (root)
  4. Save — GitHub Pages will publish the site in ~1 minute

⌨️ Terminal CLI

Full interactive terminal interface built with TypeScript + readline.

Prerequisites

  • Node.js 18 or higher
  • npm

Install dependencies

npm install

Run in development (ts-node, no compile step)

npm run dev

Build and run

npm run build:start

Example terminal output

══════════════════════════════════════════════════════════════
      💻  HARDWARE VIABILITY CALCULATOR
══════════════════════════════════════════════════════════════

  SELECT PROCESSOR (CPU)
  ──────────────────────────────────────────────────────────────
  [1] Intel Core i9-14900K             125W   Socket: LGA1700
  [2] Intel Core i7-14700K             125W   Socket: LGA1700
  ...

  RELATÓRIO DE VIABILIDADE DE HARDWARE
  ══════════════════════════════════════════════════════════════
  Processor:              Intel Core i9-14900K
  Graphics card:          NVIDIA GeForce RTX 4090

  POWER CONSUMPTION
  Total TDP:              625 W
  Minimum with 30% margin: 813 W
  RECOMMENDED PSU:        850 W

  PSU usage: [█████████████████████░░░░░░░░░░░] 74%

  Status:   ✓  COMPATIBLE

📁 Project Structure

HardwareViabilidade/
├── index.html                       ← Web app (self-contained, GitHub Pages ready)
├── src/
│   ├── Componente.ts                ← Abstract base class (inheritance)
│   ├── Processador.ts               ← CPU subclass (extends Componente)
│   ├── PlacaVideo.ts                ← GPU subclass (extends Componente)
│   ├── CalculadoraViabilidade.ts    ← Business logic and constants
│   ├── banco-de-dados.ts            ← Pre-registered CPUs and GPUs
│   └── main.ts                      ← Terminal interface (readline)
├── tsconfig.json
├── package.json
└── README.md

📊 Business Rules

Constant Value Description
MARGEM_SEGURANCA 30% Safety margin added on top of total TDP
OVERHEAD_SISTEMA_W 50 W Estimated power for RAM, SSDs, cooling, motherboard
FONTES_PADRAO 400–1500 W Standard commercial PSU wattages

Minimum PSU formula:

min_psu = (TDP_CPU + TDP_GPU + 50W) × 1.30

The recommended PSU is the smallest standard wattage (400, 450, 500 … 1500) that exceeds the minimum.


🧱 TypeScript Concepts Used

Concept Where applied
Abstract class Componente — cannot be instantiated directly
Inheritance Processador and PlacaVideo extend Componente
readonly / constants TDPs, chipsets, and business constants are immutable
abstract method descricao() enforced in subclasses
interface ResultadoViabilidade types the analysis return object
Generics / types Record<string, Processador> in the database
strict: true Strict type-checking in tsconfig.json
async/await Async I/O with readline
Error handling try/catch with typed messages

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'add my feature'
  4. Push: git push origin feature/my-feature
  5. Open a Pull Request

📝 License

MIT — see LICENSE for details.

About

PC build viability checker — chipset compatibility, PSU recommendation and TDP analysis. Web app + TypeScript CLI.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages