{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "iSpeed.my — App Init & Configuration Flow",
    "subtitle": "Device registration, appID, config load, and version check",
    "output": "ispeed-app-init-config.html",
    "viewBox": [1080, 620],
    "column_fit": "spread",
    "animation": "trace",
    "quality_profile": "showcase",
    "views": [
      { "id": "register", "label": "Device Register", "focus": ["user", "app", "web-api", "authdb"], "note": "Init service registers the device and returns appID" },
      { "id": "config", "label": "Load Config", "focus": ["app", "web-api", "ebglobal", "vbroker", "authdb"], "note": "App config plus mandatory version check" },
      { "id": "full-flow", "label": "Full Flow", "focus": ["user", "app", "web-api", "authdb", "ebglobal", "vbroker"], "note": "Complete init lifecycle" }
    ]
  },
  "participants": [
    { "id": "user", "type": "external", "label": "User", "sublabel": "Device" },
    { "id": "app", "type": "frontend", "label": "React Native App", "sublabel": "Expo SDK 56" },
    { "id": "web-api", "type": "backend", "label": "Web API", "sublabel": "Init / Config service" },
    { "id": "authdb", "type": "database", "label": "Auth DB", "sublabel": "APP_INFO / DEVICES" },
    { "id": "ebglobal", "type": "database", "label": "EBGLOBAL", "sublabel": "settings / indices" },
    { "id": "vbroker", "type": "backend", "label": "VBroker API", "sublabel": "/general/config_values" }
  ],
  "segments": [
    { "from": 150, "to": 295, "label": "Device Register" },
    { "from": 305, "to": 565, "label": "Load Config" }
  ],
  "messages": [
    { "id": "i1", "from": "user", "to": "app", "y": 160, "label": "Launch app", "variant": "default" },
    { "id": "i2", "from": "app", "to": "web-api", "y": 190, "label": "/Init/Base register device", "variant": "emphasis" },
    { "id": "i3", "from": "web-api", "to": "authdb", "y": 220, "label": "insert APP_INFO / DEVICES", "variant": "default" },
    { "id": "i4", "from": "authdb", "to": "web-api", "y": 250, "label": "appID", "variant": "return" },
    { "id": "i5", "from": "web-api", "to": "app", "y": 280, "label": "appID", "variant": "return" },
    { "id": "i6", "from": "app", "to": "web-api", "y": 310, "label": "/Config/Base app config", "variant": "emphasis" },
    { "id": "i7", "from": "web-api", "to": "authdb", "y": 340, "label": "has_version_update", "variant": "security" },
    { "id": "i8", "from": "authdb", "to": "web-api", "y": 370, "label": "version status", "variant": "return" },
    { "id": "i9", "from": "web-api", "to": "ebglobal", "y": 400, "label": "settings / indices / config", "variant": "default" },
    { "id": "i10", "from": "web-api", "to": "vbroker", "y": 430, "label": "/general/config_values", "variant": "default" },
    { "id": "i11", "from": "vbroker", "to": "web-api", "y": 460, "label": "MX config values", "variant": "return" },
    { "id": "i12", "from": "web-api", "to": "app", "y": 490, "label": "app config + versionDetail", "variant": "return" },
    { "id": "i13", "from": "app", "to": "user", "y": 520, "label": "Apply config / force update", "variant": "return" }
  ],
  "activations": [
    { "participant": "app", "from": 155, "to": 530, "type": "frontend" },
    { "participant": "web-api", "from": 185, "to": 505, "type": "backend" },
    { "participant": "authdb", "from": 215, "to": 380, "type": "database" },
    { "participant": "ebglobal", "from": 395, "to": 410, "type": "database" },
    { "participant": "vbroker", "from": 425, "to": 470, "type": "backend" }
  ],
  "cards": [
    {
      "dot": "emerald",
      "title": "Client Config",
      "items": [
        "Menu, quick actions, font size, depth levels held in Redux",
        "Persisted to RT_REDUX_STORAGE_KEY2",
        "Not returned by /api/init"
      ]
    },
    {
      "dot": "violet",
      "title": "Server Config",
      "items": [
        "ConfigService returns data.app + versionDetail",
        "Reads settings, indices, config tables",
        "MX values from vbroker /general/config_values"
      ]
    },
    {
      "dot": "rose",
      "title": "Force Update",
      "items": [
        "has_version_update stored proc",
        "mandatory=true returns early with versionDetail",
        "New RN app does not call RequestID 40005"
      ]
    }
  ]
}
