Astronomical observatory for developers. Telescopes on APIs, star charts of constellations (microservices), supernovae as outages.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-observatory
Astronomical observatory for developers. Telescopes on APIs, star charts of constellations (microservices), supernovae as outages.
Usage
const { Observatory, STELLAR_TYPES, CONSTELLATIONS } = require('./src/observatory');
const obs = new Observatory('Mount Production Observatory');
obs.setAstronomer('Carl');
// Install telescopes
obs.installTelescope('north-star');
obs.installTelescope('deep-field');
// Discover stars (services)
obs.discoverStar('auth-api', STELLAR_TYPES.BLUE_SUPERGIANT);
obs.discoverStar('user-api', STELLAR_TYPES.MAIN_SEQUENCE);
obs.discoverStar('legacy-cron', STELLAR_TYPES.WHITE_DWARF);
// Form constellations (microservice maps)
obs.formConstellation('Core Stack', ['auth-api', 'user-api', 'legacy-cron']);
// Observe
obs.getTelescope('north-star').aim(obs.getStar('auth-api'));
obs.observe('north-star');
// Catastrophe
obs.detectSupernova('auth-api');
obs.reviveStar('auth-api');
console.log(obs.skyChart());
console.log(obs.report());
Stellar Types
- Main Sequence (brightness 70) — Healthy stable service
- Red Giant (brightness 85) — Bloated legacy, resource-hungry
- White Dwarf (brightness 30) — Deprecated but still running
- Blue Supergiant (brightness 100) — Critical high-traffic, volatile
- Neutron Star (brightness 50) — Dense microservice, handles massive load
- Brown Dwarf (brightness 5) — Service that never quite launched
Components
- Star — 6 stellar types, supernova/restart, brightness/uptime/health tracking
- Telescope — Aim, filters (visible/infrared/ultraviolet), magnification, observation tracking
- Constellation — Star groups with connections, brightness totals, ASCII map
- Observatory — Astronomer, telescopes, events, supernova alerts, ASCII sky chart