Pirate ship for developers. Plunder APIs, raid databases, cannon broadsides are DDoS, treasure maps are architecture docs.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-pirate-ship
Pirate ship for developers. Plunder APIs, raid databases, cannon broadsides are DDoS, treasure maps are architecture docs.
Usage
const { PirateShip, SHIP_TYPES, CANNON_TYPES, CREW_ROLES } = require('./src/pirate-ship');
const { Raid, RAID_TARGETS } = require('./src/raid');
const ship = new PirateShip('The Refactor', SHIP_TYPES.FRIGATE);
ship.recruit('Alice', CREW_ROLES.CAPTAIN);
ship.recruit('Bob', CREW_ROLES.GUNNER);
ship.recruit('Carol', CREW_ROLES.NAVIGATOR);
ship.setCannons(CANNON_TYPES.SECURITY_BOMBARD);
// Raid an API
const raid = new Raid(RAID_TARGETS.API_ENDPOINT, ship);
raid.bombard();
raid.board();
const loot = raid.plunder();
raid.retreat();
console.log(ship.shipView());
console.log(ship.report());
Ship Types
- Frigate (speed 7, armor 60, 10 cannons) — Balanced warship
- Galleon (speed 4, armor 90, 16 cannons) — Heavy treasure ship
- Sloop (speed 10, armor 30, 4 cannons) — Fast and nimble
- Man-o-War (speed 5, armor 100, 20 cannons) — Floating fortress
Crew Roles
- Captain (Tech Lead) — Steers the ship, makes the calls
- Quartermaster (PM) — Manages loot, tracks resources
- Master Gunner (QA) — Aims cannons, finds weak spots
- Navigator (SRE) — Charts the course, avoids rocks
- Ship Surgeon (DevOps) — Patches holes, keeps things afloat
- Boatswain (Senior Dev) — Runs the deck, does everything
Raid Targets
API Endpoint, Database, S3 Bucket, Auth Server, CDN Cache, Secrets Vault
Components
- PirateShip — HP/armor, cannons, crew, cargo, treasure, heat/bounty system
- CrewMember — 6 roles, combat/navigation/leadership, morale/energy, ranks
- Raid — Multi-phase: bombard -> board -> plunder -> retreat