Skip to content

Exergy web app calculators for hashrate heating and solar monetization.

License

Notifications You must be signed in to change notification settings

exergyheat/webapp-calculators

Repository files navigation

Exergy Heat Web Calculators

License: MIT React TypeScript Vite Tailwind CSS

Interactive web calculators for Bitcoin mining energy economics.

A collection of calculators that help users evaluate the economics of Bitcoin mining for space heating and solar energy monetization. Compare mining heating costs against traditional fuels and analyze solar mining vs net metering.

Live Website

calc.exergyheat.com

For usage documentation, equations, and guides, see docs.exergyheat.com.

Calculators

Hashrate Heating Calculator

Evaluate the economics of using Bitcoin mining hardware for space heating.

  • Compare against natural gas, propane, heating oil, wood pellets, electric resistance, and heat pumps
  • Calculate COPe (economic coefficient of performance)
  • Multi-country support (US states and Canadian provinces)
  • Interactive heat maps for regional visualization

Solar Monetization Calculator

Compare monetizing excess solar energy via Bitcoin mining vs traditional net metering.

  • Solar production estimates via NREL PVWatts API
  • Three input modes: Estimate from ZIP, Known Production, or Excess Only
  • Net metering comparison with configurable rates
  • Monthly revenue breakdown charts
  • PDF report generation

Features

  • Real-time Bitcoin Data — Live BTC price from CoinGecko, network hashrate and transaction fees from Mempool.space
  • Three-Knob Override System — Model any scenario by adjusting BTC price, hashvalue/hashrate, and transaction fee %
  • Transaction Fee Modeling — Fee % slider (0-99%) to explore different fee environments
  • Solar Production Estimates — NREL PVWatts integration for location-specific solar data
  • Miner Presets — Quick-select popular mining heaters (Heatbit, Avalon, Bitaxe, etc.)
  • Custom Miner Input — Enter your own power consumption and hashrate
  • Bill Calculators — Derive rates from utility bills
  • Dark Mode — Light and dark themes
  • Mobile Responsive — Works on any device

Prerequisites

  • Node.js 18+
  • npm (comes with Node.js)

Installation

# Clone the repository
git clone https://github.com/exergyheat/webapp-calculators.git
cd webapp-calculators

# Install dependencies
npm install

Environment Variables

Variable Required Description
VITE_NREL_API_KEY For solar calculator NREL API key for PVWatts solar estimates. Get one free at developer.nrel.gov

Create a .env file in the project root:

VITE_NREL_API_KEY=your_api_key_here

The solar calculator will use fallback estimates if no API key is configured.

Development

# Start development server
npm run dev

The app will be available at http://localhost:5173

Available Scripts

Command Description
npm run dev Start development server with HMR
npm run build TypeScript check + production build
npm run lint Run ESLint
npm run preview Preview production build locally
npm test Run unit tests with Vitest

Build

# Build for production
npm run build

# Preview production build locally
npm run preview

The build output will be in the dist/ folder.

Project Structure

src/
├── api/                    # External API clients
│   ├── bitcoin.ts          # CoinGecko (price), Mempool.space (hashrate, fees)
│   └── solar.ts            # NREL PVWatts, Zippopotam geocoding
├── calculations/           # Core calculation logic
│   ├── hashrate.ts         # COPe, hashvalue, arbitrage calculations
│   ├── solar.ts            # Solar mining revenue, net metering comparison
│   └── index.ts            # Barrel exports
├── components/             # Reusable UI components
│   ├── Layout.tsx          # Page layout with header/footer
│   ├── InputField.tsx      # Input component with validation
│   ├── SelectField.tsx     # Dropdown selector
│   ├── ResultCard.tsx      # Result display cards
│   ├── SmartTooltip.tsx    # Viewport-aware tooltips
│   ├── StateHeatMap.tsx    # Interactive regional heat map
│   ├── DualAxisChart.tsx   # Monthly revenue & generation chart
│   └── ThemeToggle.tsx     # Dark mode toggle
├── contexts/               # React Context providers
│   └── ThemeContext.tsx    # Theme provider
├── data/                   # Static data
│   └── fuelPrices.ts       # Regional fuel prices & energy data
├── pages/                  # Route pages
│   ├── Home.tsx            # Landing page
│   ├── HashrateHeating.tsx # Hashrate heating calculator
│   └── SolarMonetization.tsx # Solar monetization calculator
├── pdf/                    # PDF report generation
├── test/                   # Unit tests (Vitest)
├── App.tsx                 # Route configuration
├── main.tsx                # React entry point
└── index.css               # Tailwind base styles

Tech Stack

Technology Purpose
React 18 UI framework
TypeScript Type safety
Vite Build tool & dev server
Tailwind CSS Styling
React Router Routing
Axios HTTP client
Lucide React Icons
Recharts Charts
React Simple Maps Interactive regional maps
Vitest Unit testing

APIs and Data Sources

Live APIs

All APIs are free (NREL requires a free API key):

API Data Rate Limits
CoinGecko Bitcoin price (USD) ~50 req/min
Mempool.space Network hashrate, difficulty, transaction fees (144-block average) Generous
NREL PVWatts Solar production estimates Requires API key
Zippopotam ZIP code geocoding Free, no key

Bitcoin network metrics (hashvalue, hashprice) are calculated from CoinGecko price and Mempool.space network data, including transaction fees.

Static Data

Regional fuel pricing and efficiency data in src/data/fuelPrices.ts:

Data Source
US Electricity Rates EIA State Electricity Profiles
US Natural Gas Prices EIA Natural Gas Data
US Propane/Heating Oil EIA Heating Oil & Propane
Canada Electricity GlobalPetrolPrices
Canada Natural Gas Canadian Gas Association
Canada Propane Natural Resources Canada
Canada Heating Oil Statistics Canada
Fuel BTU Content EIA Energy Units
Equipment Efficiencies Industry standard AFUE/COP ratings

Testing

The project includes unit tests using Vitest:

# Run all tests
npm test

# Run tests in watch mode
npm test -- --watch

Tests cover:

  • Hashrate heating calculations (COPe, fuel comparisons, BTU conversions)
  • Solar mining calculations (kWh-to-BTC conversion, net metering comparison)
  • Bitcoin network calculations (fee %, hashvalue, block subsidy, three-knob override logic)
  • PDF report generation

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

About

Exergy web app calculators for hashrate heating and solar monetization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5