{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "InMotion → Local + AWS Migration",
    "output": "migration-map.html",
    "quality_profile": "showcase",
    "views": [
      { "id": "flow", "label": "Migration flow", "focus": ["inmotion", "cloudflare", "caddy", "n13", "s3", "purelymail", "ses", "gmail"], "note": "Follow the migration: from the InMotion VPS to local hosting, email, and offsite backup." },
      { "id": "email", "label": "Email path", "focus": ["cloudflare", "purelymail", "gmail", "ses", "n13"], "note": "Inbound via PurelyMail, outbound via SES." },
      { "id": "backup", "label": "Offsite backup", "focus": ["n13", "borg", "s3", "garage"], "note": "Nightly Borg → AWS S3, plus local Garage S3." }
    ]
  },
  "components": [
    { "id": "inmotion", "type": "external", "label": "InMotion VPS", "sublabel": "cPanel · PHP · MySQL · FFmpeg", "pos": [30, 120], "size": [150, 64], "tag": "retiring ~A$100/mo" },
    { "id": "sites", "type": "frontend", "label": "CMS Sites", "sublabel": "5-6 multimedia sites", "pos": [30, 260], "size": [150, 56] },
    { "id": "cloudflare", "type": "cloud", "label": "Cloudflare", "sublabel": "DNS · Email Routing", "pos": [270, 120], "size": [140, 56] },
    { "id": "caddy", "type": "frontend", "label": "Caddy", "sublabel": "reverse proxy · .35", "pos": [270, 260], "size": [140, 56], "tag": "TLS / basic-auth" },
    { "id": "n13", "type": "backend", "label": ".13 NixOS Host", "sublabel": "Docker · websites", "pos": [490, 260], "size": [150, 64] },
    { "id": "garage", "type": "database", "label": "Garage S3", "sublabel": "local object store", "pos": [700, 80], "size": [150, 56], "tag": "garage-ui.lab" },
    { "id": "borg", "type": "database", "label": "Borg repos", "sublabel": ".13 · .27", "pos": [880, 80], "size": [140, 56] },
    { "id": "s3", "type": "cloud", "label": "AWS S3", "sublabel": "sam-offsite-backup", "pos": [1040, 80], "size": [150, 64], "tag": "Glacier deep archive" },
    { "id": "purelymail", "type": "cloud", "label": "PurelyMail", "sublabel": "domain mailboxes", "pos": [270, 420], "size": [140, 56] },
    { "id": "gmail", "type": "external", "label": "Gmail", "sublabel": "samuelrolfe@", "pos": [490, 420], "size": [140, 56] },
    { "id": "ses", "type": "cloud", "label": "Amazon SES", "sublabel": "transactional sending", "pos": [700, 420], "size": [140, 56] }
  ],
  "boundaries": [
    { "kind": "region", "label": "Home network (192.168.20.0/24)", "wraps": ["caddy", "n13", "garage"] },
    { "kind": "region", "label": "Cloud providers (managed)", "wraps": ["cloudflare", "purelymail", "ses", "gmail"] }
  ],
  "connections": [
    { "id": "inmotion-to-sites", "from": "inmotion", "to": "sites", "label": "hosts today", "variant": "emphasis", "fromSide": "bottom", "toSide": "top" },
    { "id": "cf-to-caddy", "from": "cloudflare", "to": "caddy", "label": "A/wildcard", "fromSide": "bottom", "toSide": "top" },
    { "id": "caddy-to-n13", "from": "caddy", "to": "n13", "label": "proxy :80/:443", "variant": "emphasis" },
    { "id": "cf-to-purelymail", "from": "cloudflare", "to": "purelymail", "label": "MX", "fromSide": "left", "toSide": "top" },
    { "id": "purelymail-to-gmail", "from": "purelymail", "to": "gmail", "label": "forward", "fromSide": "right", "toSide": "left" },
    { "id": "n13-to-ses", "from": "n13", "to": "ses", "label": "SMTP send", "fromSide": "right", "toSide": "left", "via": [[640, 292], [640, 448]] },
    { "id": "cf-to-ses", "from": "cloudflare", "to": "ses", "label": "SPF/DKIM", "variant": "dashed", "via": [[340, 100], [770, 100], [770, 400]] },
    { "id": "n13-to-garage", "from": "n13", "to": "garage", "label": "portal/media", "fromSide": "top", "toSide": "bottom", "via": [[565, 180]] },
    { "id": "n13-to-borg", "from": "n13", "to": "borg", "label": "nightly Borg", "fromSide": "top", "toSide": "bottom", "via": [[565, 140], [820, 160]] },
    { "id": "borg-to-s3", "from": "borg", "to": "s3", "label": "sync -> offsite", "variant": "emphasis" },
    { "id": "garage-webui", "from": "garage", "to": "caddy", "label": "garage-ui.lab", "variant": "dashed", "via": [[600, 220], [420, 180]] }
  ],
  "cards": [
    { "dot": "rose", "title": "Retiring", "items": ["InMotion VPS (~A$100/mo) hosts the legacy sites", "cPanel / PHP / MySQL — to be decommissioned"] },
    { "dot": "emerald", "title": "Target stack", "items": [".13 NixOS host runs the sites behind Caddy", "Cloudflare DNS + PurelyMail + SES for email", "Garage local S3 with garage-ui.lab"] },
    { "dot": "cyan", "title": "Offsite", "items": ["Borg repos (photos, .13, .27) sync nightly to AWS S3", "Lifecycle tiers photo/archive to Glacier Deep Archive", "Monitor: offsite.lab.audasmedia.com.au"] }
  ]
}