Snow globe for developers. Shake it = deploy, snow settles = stable, blizzard = incident, the tiny village inside is your infrastructure.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-snowglobe
Snow globe for developers. Shake it = deploy, snow settles = stable, blizzard = incident, the tiny village inside is your infrastructure.
Usage
const { SnowGlobe, BUILDING_TYPES, SEASONS } = require('./src/snowglobe');
const globe = new SnowGlobe('Production Village');
// Add buildings (services)
globe.addBuilding('Cache Barn', BUILDING_TYPES.BARN, 20, 20);
globe.addBuilding('Worker House', BUILDING_TYPES.HOUSE, 40, 15);
// Shake it! (deploy)
globe.shake();
// Change season
globe.setSeason(SEASONS.WINTER); // Production freeze
// Blizzard! (incident)
globe.triggerBlizzard(7);
// Recover
globe.maintainAll();
globe.warmCitizens();
globe.repairGlass(15);
// Time passes
for (let i = 0; i < 10; i++) globe.tick();
globe.advanceDay();
console.log(globe.globeView());
console.log(globe.report());
Building Types
- House (Small Service) — HP 80, tiny microservice cottage
- Shop (API Endpoint) — HP 100, serves citizens
- Tower (Core Service) — HP 150, tallest, everyone sees it
- Church (Database) — HP 200, ancient, eternal, sacred data
- Barn (Cache Layer) — HP 60, temporary storage
- Bridge (Network Route) — HP 70, connects parts
Seasons
- Winter (Prod Freeze) — Snow accumulates, freeze risk
- Spring (New Sprint) — Thaw, new growth
- Summer (Stable) — Warm, calm, best deploy time
- Autumn (Prep) — Hardening for winter
Components
- Building — Snow cover, frozen state, condition degradation
- Citizen — Warmth, movement, freeze death at 0 warmth
- SnowGlobe — Shake (deploy), blizzard (incident), glass integrity, ASCII globe