Coral reef for developers. Coral polyps are microservices, symbiotic algae are dependencies, bleaching is outage, biodiversity is feature richness.
  • JavaScript 100%
Find a file
2026-06-30 11:14:49 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 test: add e2e tests 2026-06-28 11:10:45 +00:00
src feat(#1): coral reef engine — coral, algae, fish, bleaching, water quality, ASCII reef 2026-06-15 20:07:25 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:14:46 +00:00
package.json feat(#1): coral reef engine — coral, algae, fish, bleaching, water quality, ASCII reef 2026-06-15 20:07:25 +00:00
README.md feat(#1): coral reef engine — coral, algae, fish, bleaching, water quality, ASCII reef 2026-06-15 20:07:25 +00:00

code-coral-reef

Coral reef for developers. Coral polyps are microservices, symbiotic algae are dependencies, bleaching is outage, biodiversity is feature richness.

Usage

const { Reef, CORAL_TYPES, FISH_TYPES } = require('./src/reef');

const reef = new Reef('Great Barrier Production');
reef.setKeeper('Jacques');

// Plant coral colonies
reef.plantColony('Auth Service', CORAL_TYPES.BRANCHING);
reef.plantColony('Legacy Monolith', CORAL_TYPES.BRAIN);

// Add fish (traffic)
reef.addFish(FISH_TYPES.PUFFERFISH, 3); // Spike traffic

// Monitor water quality
reef.water.temperature = 30; // CPU warming up
reef.clean();
reef.cool();

// Time passes
for (let i = 0; i < 10; i++) reef.tick();
reef.advanceDay();

console.log(reef.reefView());
console.log(reef.report());

Coral Types

  • Branching (Microservice) — Fast-growing, many endpoints, fragile
  • Brain (Monolith) — Slow, massive, ancient, very hard to break
  • Fan (API Gateway) — Flat, wide, catches/routes everything
  • Soft (Prototype) — No skeleton, experimental, might not survive
  • Table (Database) — Flat surface, structured data

Fish (Traffic)

  • Clownfish (Normal User) — Peaceful, predictable
  • Pufferfish (Spike Traffic) — Sudden resource hits
  • Moray Eel (WebSocket) — Long-lived connections
  • Surgeonfish (Health Check) — Constant checking
  • Reef Shark (Aggressive Crawler) — Takes what it wants
  • Parrotfish (Cache Warmer) — Cleans up, beneficial

Components

  • Polyp — Individual endpoint with health/algae/color
  • CoralColony — Service with polyps, growth, bleaching
  • Water — Temperature/pH/salinity/pollution/flow quality system
  • Reef — Multi-colony management, bleaching events, ASCII cross-section