PowerLab (powelab.org) is an open-source, deterministic computational modeling platform designed to unify clean energy planning across:
Unlike commercial aggregators that rely on opaque heuristic estimates or lead-generation funnels, PowerLab provides open mathematical models, transparent loss derivations, and standards-compliant engineering formulas with zero database tracking.
-
Pure Deterministic Engines: Every calculation engine in
src/lib/calculators/is written in pure TypeScript with zero external dependencies, deterministic test suites, and transparent formulas. -
Physical Loss Mechanisms Included: Models dynamic depth of discharge (DoD), Peukert capacity derating (
$I^k \cdot t = C$ ), inverter standby tare draw ($15\text{W}\text{--}30\text{W}$ continuous), locked rotor inrush amperage (LRA), and cold-temperature open-circuit voltage ($V_{oc}$ ) expansion. -
Privacy by Design: Zero database, zero authentication, zero user tracking, and no cookies. User energy profiles and multi-tool scenarios persist strictly within local browser
localStorage. - Governing Standards: Formulations adhere to IEEE Std 485, National Electrical Code (NEC / NFPA 70 Articles 625, 690, 702, and 706), NREL PVWatts V8 algorithms, and ASHRAE climatic design conditions.
- Direct Academic & Educational Alignment: Officially mapped as open courseware on OER Commons for university engineering programs, CTE electrical apprenticeships, and physics classrooms.
- Framework: Next.js 15 (App Router, React 19, Server-Rendered SEO/GEO content)
- Language: TypeScript 5.9 (Strict Type Checking, 0
any) - Styling: Modular CSS & Custom Design System (Fluid Typography, Dark/Light palettes, Semantic HTML5)
- Testing: Vitest 3.2 (Unit tests, edge-case bounds, invariant tests, handoff integration suites)
- Deployment: Vercel Automated Edge Integration
src/
├── app/ # Next.js App Router (Calculators, Guides, APIs)
│ ├── battery/ # Battery storage planning routes
│ ├── solar/ # Solar PV calculation routes
│ ├── home-energy/ # Residential load and appliance routes
│ ├── ev/ # Electric vehicle energy and charging routes
│ ├── guides/ # Technical educational reference guides
│ └── api/ # Proxy endpoints (PVWatts V8, IndexNow)
├── components/ # Accessible, mobile-first design system
│ ├── calculator/ # Calculator shells, formula cards, assumption trays
│ ├── inputs/ # Accessible numeric and slider controls
│ └── seo/ # LaTeX drawers, JSON-LD schema, citations
├── data/ # Deterministic static datasets (ASHRAE, NREL, appliances)
├── lib/
│ ├── calculators/ # PURE DETERMINISTIC ENGINES (Isolated from UI/DOM)
│ ├── energy-profile/ # LocalStorage cross-calculator state sync
│ ├── providers/ # External model adapters (NREL PVWatts)
│ └── seo/ # Structured data generators and canonical metadata
└── types/ # Shared domain schemas and calculation envelopes
- Node.js 18.17+ or 20+
- npm, pnpm, or yarn
-
Clone the repository:
git clone https://github.com/miadsaadidi/powerlab.git cd powerlab -
Install dependencies:
npm install
-
Run the local development server:
npm run dev # Or with Turbopack acceleration: npm run dev:allOpen http://localhost:3000 with your browser.
-
Run the test suite:
npm test -
Typecheck verification:
npm run typecheck
We welcome contributions from electrical engineers, researchers, solar installers, and educators. Whether auditing engine equations against published IEEE/IEC literature, providing real-world battery discharge curves, or introducing classroom lab modules:
- Please review CONTRIBUTING.md for our branch lifecycle and PR review rules.
- Participate in ongoing modeling discussions on GitHub Discussions.
- Open an Issue if you discover an unhandled physical loss factor or edge-case discrepancy.
This project is licensed under the MIT License. Calculators, formulas, and educational guides are maintained for open research and public benefit.