Power plant for developers. Reactors are servers, turbines are CI, coolant is monitoring, meltdowns are outages.
  • JavaScript 100%
Find a file
2026-06-30 11:13:50 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:47 +00:00
src feat(#1): power plant engine — reactors, turbines, coolant, operators, ASCII plant 2026-06-15 09:39:49 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:47 +00:00
package.json feat(#1): power plant engine — reactors, turbines, coolant, operators, ASCII plant 2026-06-15 09:39:49 +00:00
README.md feat(#1): power plant engine — reactors, turbines, coolant, operators, ASCII plant 2026-06-15 09:39:49 +00:00

code-power-plant

Power plant for developers. Reactors are servers, turbines are CI, coolant is monitoring, meltdowns are outages.

Usage

const { PowerPlant, REACTOR_TYPES, DEMAND } = require('./src/plant');

const plant = new PowerPlant('Dev Valley Plant');
plant.hireOperator('Alice', 8);

// Add more capacity
plant.addReactor(REACTOR_TYPES.CACHE);
plant.addTurbine('CI Turbine C');

// Adjust control rods
plant.insertRods('backend', 20);
plant.withdrawRods('frontend', 10);

// Run cycles
plant.setDemand(DEMAND.PEAK);
for (let i = 0; i < 10; i++) plant.tick();

// Emergency
plant.scram('cache');

console.log(plant.plantView());
console.log(plant.report());

Reactor Types

  • Frontend (200 MW, heat 500) — UI rendering core
  • Backend (350 MW, heat 600) — Business logic core
  • Database (150 MW, heat 700) — Data persistence core
  • Cache (100 MW, heat 400) — Fast access, runs hot
  • Worker (80 MW, heat 450) — Async job processor

Demand Cycle

Night (50%) -> Morning Ramp (80%) -> Peak (120%) -> Evening Decline (90%) -> Late (60%)

Components

  • Reactor — Power output, heat/control rods, meltdown/scram/restart
  • Turbine — Converts reactor power, efficiency degradation, service cycles
  • CoolingSystem — Pump management, flow rate, cooling power
  • PowerPlant — Grid balance, operators, brownouts, cascade meltdowns, ASCII view