A modern and elegant dashboard for network traffic visualization and analysis.
feat: add Excalidraw architecture and dataflow diagrams, a generation script, and update the collector app module.
luolei0c985bc77b8e
diff --git a/apps/collector/src/modules/app/app.ts b/apps/collector/src/modules/app/app.tsindex 8a1446e..27a50af 100644--- a/apps/collector/src/modules/app/app.ts+++ b/apps/collector/src/modules/app/app.ts@@ -109,8 +109,11 @@ export async function createApp(options: AppOptions) {const app = Fastify({ logger, bodyLimit: 5 * 1024 * 1024 });// Decompress gzip-encoded request bodies (used by the agent to reduce upload bandwidth)+ // content-length must be removed because it refers to the compressed size; after decompression+ // Fastify would compare the larger decompressed bytes against the original header and reject the request.app.addHook('preParsing', async (request, _reply, payload) => {if (request.headers['content-encoding'] === 'gzip') {+ delete (request.headers as Record<string, unknown>)['content-length'];return payload.pipe(createGunzip());}return payload;diff --git a/docs/architecture-agent.excalidraw b/docs/architecture-agent.excalidrawnew file mode 100644index 0000000..fe223da--- /dev/null+++ b/docs/architecture-agent.excalidraw@@ -0,0 +1,1443 @@+{+ "type": "excalidraw",+ "version": 2,+ "source": "https://excalidraw.com",+ "elements": [+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 1,+ "isDeleted": false,+ "id": "central-panel",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 350,+ "y": 50,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "#fff3e0",+ "width": 600,+ "height": 200,+ "seed": 1,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 2,+ "isDeleted": false,+ "id": "panel-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 65,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 280,+ "height": 28,+ "seed": 2,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 20,+ "fontFamily": 2,+ "text": "๐ข ไธญๅฟ้ขๆฟ (Neko Master)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ข ไธญๅฟ้ขๆฟ (Neko Master)",+ "lineHeight": 1.4,+ "baseline": 22+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 3,+ "isDeleted": false,+ "id": "fastify-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 100,+ "strokeColor": "#e65100",+ "backgroundColor": "transparent",+ "width": 160,+ "height": 20,+ "seed": 3,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "Fastify API Server",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Fastify API Server",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 4,+ "isDeleted": false,+ "id": "api-report",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 130,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#c8e6c9",+ "width": 250,+ "height": 30,+ "seed": 4,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 5,+ "isDeleted": false,+ "id": "api-report-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 378,+ "y": 137,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 234,+ "height": 16,+ "seed": 5,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "POST /api/agent/report โ ๆน้ๆต้ๅข้",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "api-report",+ "originalText": "POST /api/agent/report โ ๆน้ๆต้ๅข้",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 6,+ "isDeleted": false,+ "id": "api-heartbeat",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 640,+ "y": 130,+ "strokeColor": "#1976d2",+ "backgroundColor": "#bbdefb",+ "width": 280,+ "height": 30,+ "seed": 6,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 7,+ "isDeleted": false,+ "id": "api-heartbeat-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 648,+ "y": 137,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 264,+ "height": 16,+ "seed": 7,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "POST /api/agent/heartbeat โ ๅฟ่ทณ(ๅจ็บฟ็ถๆ)",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "api-heartbeat",+ "originalText": "POST /api/agent/heartbeat โ ๅฟ่ทณ(ๅจ็บฟ็ถๆ)",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 8,+ "isDeleted": false,+ "id": "api-config",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 170,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "#e1bee7",+ "width": 250,+ "height": 30,+ "seed": 8,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 9,+ "isDeleted": false,+ "id": "api-config-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 378,+ "y": 177,+ "strokeColor": "#4a148c",+ "backgroundColor": "transparent",+ "width": 234,+ "height": 16,+ "seed": 9,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "POST /api/agent/config-sync โ ่งๅ/ไปฃ็้ ็ฝฎ",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "api-config",+ "originalText": "POST /api/agent/config-sync โ ่งๅ/ไปฃ็้ ็ฝฎ",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 10,+ "isDeleted": false,+ "id": "api-policy",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 640,+ "y": 170,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffccbc",+ "width": 280,+ "height": 30,+ "seed": 10,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 11,+ "isDeleted": false,+ "id": "api-policy-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 648,+ "y": 177,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 264,+ "height": 16,+ "seed": 11,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "POST /api/agent/policy-state โ ๅฝๅ็ญ็ฅ็ถๆ",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "api-policy",+ "originalText": "POST /api/agent/policy-state โ ๅฝๅ็ญ็ฅ็ถๆ",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 12,+ "isDeleted": false,+ "id": "backend-type-note",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 215,+ "strokeColor": "#666666",+ "backgroundColor": "transparent",+ "width": 400,+ "height": 16,+ "seed": 12,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "Backend ็ฑปๅ: agent:// | ็ณป็ป็ๆ token | ็ปๅฎ agentId",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Backend ็ฑปๅ: agent:// | ็ณป็ป็ๆ token | ็ปๅฎ agentId",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 13,+ "isDeleted": false,+ "id": "http-connection",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 250,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 0,+ "height": 80,+ "seed": 13,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": "arrow",+ "endArrowhead": null,+ "points": [+ [0, 0],+ [0, 80]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 14,+ "isDeleted": false,+ "id": "http-label",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 275,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 120,+ "height": 28,+ "seed": 14,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "HTTP (token ้ดๆ)\nโ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "HTTP (token ้ดๆ)\nโ",+ "lineHeight": 1.4,+ "baseline": 24+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 15,+ "isDeleted": false,+ "id": "remote-host",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 350,+ "y": 330,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "#e3f2fd",+ "width": 600,+ "height": 380,+ "seed": 15,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 16,+ "isDeleted": false,+ "id": "remote-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 345,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 280,+ "height": 28,+ "seed": 16,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 20,+ "fontFamily": 2,+ "text": "๐ฅ๏ธ ็ฝๅ ณๆ่พน็ไธปๆบ (Remote Host)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ฅ๏ธ ็ฝๅ ณๆ่พน็ไธปๆบ (Remote Host)",+ "lineHeight": 1.4,+ "baseline": 22+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 17,+ "isDeleted": false,+ "id": "nekoagent-cli",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 385,+ "strokeColor": "#1565c0",+ "backgroundColor": "#ffffff",+ "width": 250,+ "height": 100,+ "seed": 17,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 18,+ "isDeleted": false,+ "id": "nekoagent-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 390,+ "y": 395,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 20,+ "seed": 18,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "nekoagent (CLI ็ฎก็ๅจ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "nekoagent (CLI ็ฎก็ๅจ)",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 19,+ "isDeleted": false,+ "id": "nekoagent-files",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 390,+ "y": 420,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 210,+ "height": 56,+ "seed": 19,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "โข /etc/neko-agent/<instance>.env\n (้ ็ฝฎๆไปถ)\nโข /var/run/neko-agent/<instance>.pid\n (PID ๆไปถ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โข /etc/neko-agent/<instance>.env\n (้ ็ฝฎๆไปถ)\nโข /var/run/neko-agent/<instance>.pid\n (PID ๆไปถ)",+ "lineHeight": 1.4,+ "baseline": 52+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 20,+ "isDeleted": false,+ "id": "neko-agent-daemon",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 640,+ "y": 385,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffffff",+ "width": 280,+ "height": 100,+ "seed": 20,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 21,+ "isDeleted": false,+ "id": "neko-agent-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 395,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 20,+ "seed": 21,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "neko-agent (ๅฎๆค่ฟ็จ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "neko-agent (ๅฎๆค่ฟ็จ)",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 22,+ "isDeleted": false,+ "id": "neko-agent-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 420,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 240,+ "height": 56,+ "seed": 22,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "Go ็ผๅ็ๆฐๆฎ้้ๅฎๆค่ฟ็จ\nๅจๆๆงๆๅ็ฝๅ ณๆฐๆฎๅนถไธๆฅๅฐ้ขๆฟ\nPID ้: ๅไธ backendId ๅ่ฟ็จ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Go ็ผๅ็ๆฐๆฎ้้ๅฎๆค่ฟ็จ\nๅจๆๆงๆๅ็ฝๅ ณๆฐๆฎๅนถไธๆฅๅฐ้ขๆฟ\nPID ้: ๅไธ backendId ๅ่ฟ็จ",+ "lineHeight": 1.4,+ "baseline": 52+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 23,+ "isDeleted": false,+ "id": "agent-workflow",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 370,+ "y": 505,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#f1f8e9",+ "width": 550,+ "height": 185,+ "seed": 23,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 24,+ "isDeleted": false,+ "id": "workflow-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 390,+ "y": 515,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 20,+ "seed": 24,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "ๅทฅไฝๆต็จ:",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๅทฅไฝๆต็จ:",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 25,+ "isDeleted": false,+ "id": "step1",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 390,+ "y": 545,+ "strokeColor": "#1565c0",+ "backgroundColor": "#e3f2fd",+ "width": 240,+ "height": 50,+ "seed": 25,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 26,+ "isDeleted": false,+ "id": "step1-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 400,+ "y": 550,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 40,+ "seed": 26,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "1. ๆๅ็ฝๅ ณๆฐๆฎ\n โข Clash: WebSocket /connections\n โข Surge: HTTP GET /v1/requests/recent",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step1",+ "originalText": "1. ๆๅ็ฝๅ ณๆฐๆฎ\n โข Clash: WebSocket /connections\n โข Surge: HTTP GET /v1/requests/recent",+ "lineHeight": 1.3,+ "baseline": 36+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 27,+ "isDeleted": false,+ "id": "step2",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 545,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffccbc",+ "width": 250,+ "height": 50,+ "seed": 27,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 28,+ "isDeleted": false,+ "id": "step2-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 550,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 230,+ "height": 40,+ "seed": 28,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "2. ๅข้่ฎก็ฎ (Delta)\n โข ่ฏๅซๆฐ่ฟๆฅ / ๆดๆฐ่ฟๆฅ\n โข ่ฎก็ฎ upload/download ๅข้",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step2",+ "originalText": "2. ๅข้่ฎก็ฎ (Delta)\n โข ่ฏๅซๆฐ่ฟๆฅ / ๆดๆฐ่ฟๆฅ\n โข ่ฎก็ฎ upload/download ๅข้",+ "lineHeight": 1.3,+ "baseline": 36+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 29,+ "isDeleted": false,+ "id": "step3",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 390,+ "y": 610,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#c8e6c9",+ "width": 240,+ "height": 35,+ "seed": 29,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 30,+ "isDeleted": false,+ "id": "step3-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 400,+ "y": 615,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 25,+ "seed": 30,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "3. ๆน้ไธๆฅ (ๆฏ 2s)\n POST /api/agent/report",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step3",+ "originalText": "3. ๆน้ไธๆฅ (ๆฏ 2s)\n POST /api/agent/report",+ "lineHeight": 1.3,+ "baseline": 21+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 31,+ "isDeleted": false,+ "id": "step3-note",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 395,+ "y": 648,+ "strokeColor": "#666666",+ "backgroundColor": "transparent",+ "width": 230,+ "height": 14,+ "seed": 31,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 9,+ "fontFamily": 2,+ "text": "ๆๅค 1000 ๆก/ๆน, ็งฏๅไธ้ 50000 ๆก",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆๅค 1000 ๆก/ๆน, ็งฏๅไธ้ 50000 ๆก",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 32,+ "isDeleted": false,+ "id": "step4",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 610,+ "strokeColor": "#1976d2",+ "backgroundColor": "#bbdefb",+ "width": 120,+ "height": 35,+ "seed": 32,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 33,+ "isDeleted": false,+ "id": "step4-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 615,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 25,+ "seed": 33,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "4. ๅฟ่ทณ (ๆฏ 30s)\n /agent/heartbeat",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step4",+ "originalText": "4. ๅฟ่ทณ (ๆฏ 30s)\n /agent/heartbeat",+ "lineHeight": 1.3,+ "baseline": 21+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 34,+ "isDeleted": false,+ "id": "step5",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 790,+ "y": 610,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "#e1bee7",+ "width": 110,+ "height": 35,+ "seed": 34,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 35,+ "isDeleted": false,+ "id": "step5-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 800,+ "y": 615,+ "strokeColor": "#4a148c",+ "backgroundColor": "transparent",+ "width": 90,+ "height": 25,+ "seed": 35,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "5. ้ ็ฝฎๅๆญฅ\n (ๆฏ 2min)",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step5",+ "originalText": "5. ้ ็ฝฎๅๆญฅ\n (ๆฏ 2min)",+ "lineHeight": 1.3,+ "baseline": 21+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 36,+ "isDeleted": false,+ "id": "step6",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 655,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffccbc",+ "width": 250,+ "height": 25,+ "seed": 36,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 37,+ "isDeleted": false,+ "id": "step6-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 659,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 230,+ "height": 16,+ "seed": 37,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "6. ็ญ็ฅ็ถๆๅๆญฅ (ๆฏ 30s, ็ถๆๅๅๆไธๆฅ)",+ "textAlign": "left",+ "verticalAlign": "middle",+ "containerId": "step6",+ "originalText": "6. ็ญ็ฅ็ถๆๅๆญฅ (ๆฏ 30s, ็ถๆๅๅๆไธๆฅ)",+ "lineHeight": 1.4,+ "baseline": 12+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 38,+ "isDeleted": false,+ "id": "lan-connection",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 710,+ "strokeColor": "#666666",+ "backgroundColor": "transparent",+ "width": 0,+ "height": 50,+ "seed": 38,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": null,+ "points": [+ [0, 0],+ [0, 50]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 39,+ "isDeleted": false,+ "id": "lan-label",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 720,+ "strokeColor": "#666666",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 28,+ "seed": 39,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "ๆฌๅฐ็ฝ็ป (LAN)\nโ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆฌๅฐ็ฝ็ป (LAN)\nโ",+ "lineHeight": 1.4,+ "baseline": 24+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 40,+ "isDeleted": false,+ "id": "gateway",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 550,+ "y": 760,+ "strokeColor": "#424242",+ "backgroundColor": "#eeeeee",+ "width": 200,+ "height": 60,+ "seed": 40,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 41,+ "isDeleted": false,+ "id": "gateway-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 570,+ "y": 770,+ "strokeColor": "#212121",+ "backgroundColor": "transparent",+ "width": 160,+ "height": 40,+ "seed": 41,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "Clash/Mihomo or Surge\nGateway API",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "gateway",+ "originalText": "Clash/Mihomo or Surge\nGateway API",+ "lineHeight": 1.4,+ "baseline": 35+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 42,+ "isDeleted": false,+ "id": "comparison-table",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 50,+ "y": 50,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "#f5f5f5",+ "width": 280,+ "height": 250,+ "seed": 42,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 43,+ "isDeleted": false,+ "id": "comparison-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 65,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 22,+ "seed": 43,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "็ด่ฟ vs Agent ๆจกๅผ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "็ด่ฟ vs Agent ๆจกๅผ",+ "lineHeight": 1.4,+ "baseline": 17+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 44,+ "isDeleted": false,+ "id": "comparison-content",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 95,+ "strokeColor": "#333333",+ "backgroundColor": "transparent",+ "width": 240,+ "height": 189,+ "seed": 44,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "็ปดๅบฆ | ็ด่ฟ | Agent\n------------------------|--------|--------\n่ฟๆฅ็ฝๅ ณ | โ ้่ฆ | โ ไธ้่ฆ\nๆฐๆฎๅฎๆถๆง | ๆฏซ็ง็บง | ~2s\n็ฝ็ป้็ฆป | ้ๅ ฅ็ซ | ไป ๅบ็ซ\nๅค็ซ็นๅบๆฏ | ๅคๆ | ๅ็ๆฏๆ\nๅฎๅ จ่พน็ | ๅ ฑไบซtoken| ้็ฆปtoken\n\nไผๅฟ:\nโข Agent ๅ่ตท่ฟๆฅ, ๆ ้ๅ ฅ็ซ\nโข ๆฏ็ซ็น็ฌ็ซ agent\nโข ้ขๆฟ token ไธ็ฝๅ ณ้็ฆป",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "็ปดๅบฆ | ็ด่ฟ | Agent\n------------------------|--------|--------\n่ฟๆฅ็ฝๅ ณ | โ ้่ฆ | โ ไธ้่ฆ\nๆฐๆฎๅฎๆถๆง | ๆฏซ็ง็บง | ~2s\n็ฝ็ป้็ฆป | ้ๅ ฅ็ซ | ไป ๅบ็ซ\nๅค็ซ็นๅบๆฏ | ๅคๆ | ๅ็ๆฏๆ\nๅฎๅ จ่พน็ | ๅ ฑไบซtoken| ้็ฆปtoken\n\nไผๅฟ:\nโข Agent ๅ่ตท่ฟๆฅ, ๆ ้ๅ ฅ็ซ\nโข ๆฏ็ซ็น็ฌ็ซ agent\nโข ้ขๆฟ token ไธ็ฝๅ ณ้็ฆป",+ "lineHeight": 1.5,+ "baseline": 185+ }+ ],+ "appState": {+ "gridSize": null,+ "viewBackgroundColor": "#ffffff"+ },+ "files": {}+}diff --git a/docs/architecture-dataflow.excalidraw b/docs/architecture-dataflow.excalidrawnew file mode 100644index 0000000..e02aa97--- /dev/null+++ b/docs/architecture-dataflow.excalidraw@@ -0,0 +1,2091 @@+{+ "type": "excalidraw",+ "version": 2,+ "source": "https://excalidraw.com",+ "elements": [+ {+ "type": "text",+ "version": 1,+ "versionNonce": 1,+ "isDeleted": false,+ "id": "main-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 400,+ "y": 30,+ "strokeColor": "#1e1e1e",+ "backgroundColor": "transparent",+ "width": 400,+ "height": 32,+ "seed": 1,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 24,+ "fontFamily": 2,+ "text": "๐ Neko Master ๆฐๆฎๆต่ฏฆ่งฃ",+ "textAlign": "center",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ Neko Master ๆฐๆฎๆต่ฏฆ่งฃ",+ "lineHeight": 1.3,+ "baseline": 26+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 2,+ "isDeleted": false,+ "id": "clash-flow-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 50,+ "y": 80,+ "strokeColor": "#1565c0",+ "backgroundColor": "#e3f2fd",+ "width": 550,+ "height": 280,+ "seed": 2,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 3,+ "isDeleted": false,+ "id": "clash-flow-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 95,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 24,+ "seed": 3,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "๐ต 1. Clash ๆฐๆฎ้้ๆต็จ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ต 1. Clash ๆฐๆฎ้้ๆต็จ",+ "lineHeight": 1.5,+ "baseline": 19+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 4,+ "isDeleted": false,+ "id": "clash-gateway",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 130,+ "strokeColor": "#1565c0",+ "backgroundColor": "#ffffff",+ "width": 120,+ "height": 50,+ "seed": 4,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 5,+ "isDeleted": false,+ "id": "clash-gateway-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 85,+ "y": 145,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 90,+ "height": 20,+ "seed": 5,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "Clash Gateway",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "clash-gateway",+ "originalText": "Clash Gateway",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 6,+ "isDeleted": false,+ "id": "clash-arrow1",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 130,+ "y": 180,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 0,+ "height": 30,+ "seed": 6,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [0, 30]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 7,+ "isDeleted": false,+ "id": "clash-ws-label",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 140,+ "y": 185,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 140,+ "height": 28,+ "seed": 7,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "WebSocket ๆจ้\n(ๆฏ็ง/ๆฏ่ฟๆฅๆดๆฐ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "WebSocket ๆจ้\n(ๆฏ็ง/ๆฏ่ฟๆฅๆดๆฐ)",+ "lineHeight": 1.4,+ "baseline": 24+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 8,+ "isDeleted": false,+ "id": "clash-collector",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 210,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffffff",+ "width": 140,+ "height": 130,+ "seed": 8,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 9,+ "isDeleted": false,+ "id": "clash-collector-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 80,+ "y": 220,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 120,+ "height": 18,+ "seed": 9,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "ClashCollector",+ "textAlign": "center",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ClashCollector",+ "lineHeight": 1.4,+ "baseline": 13+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 10,+ "isDeleted": false,+ "id": "clash-collector-steps",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 80,+ "y": 245,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 120,+ "height": 84,+ "seed": 10,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "1. ๆต้่ฟฝ่ธช\n2. ๆน้็ผๅฒ(30s)\n3. GeoIP ๆฅ่ฏข\n4. ๆฐๆฎๅๅ ฅ\n5. ่งฆๅๅนฟๆญ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "1. ๆต้่ฟฝ่ธช\n2. ๆน้็ผๅฒ(30s)\n3. GeoIP ๆฅ่ฏข\n4. ๆฐๆฎๅๅ ฅ\n5. ่งฆๅๅนฟๆญ",+ "lineHeight": 1.4,+ "baseline": 80+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 11,+ "isDeleted": false,+ "id": "clash-arrow2",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 210,+ "y": 240,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 11,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 12,+ "isDeleted": false,+ "id": "sqlite-label1",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 220,+ "y": 220,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 50,+ "height": 14,+ "seed": 12,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ SQLite",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ SQLite",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 13,+ "isDeleted": false,+ "id": "clash-arrow3",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 210,+ "y": 270,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 13,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 14,+ "isDeleted": false,+ "id": "clickhouse-label1",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 220,+ "y": 250,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 14,+ "seed": 14,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ ClickHouse (ๅฏ้)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ ClickHouse (ๅฏ้)",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 15,+ "isDeleted": false,+ "id": "clash-arrow4",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 210,+ "y": 300,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 15,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 16,+ "isDeleted": false,+ "id": "realtime-label1",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 220,+ "y": 280,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 14,+ "seed": 16,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ RealtimeStore",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ RealtimeStore",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 17,+ "isDeleted": false,+ "id": "clash-arrow5",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 140,+ "y": 340,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 0,+ "height": 40,+ "seed": 17,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [0, 40]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 18,+ "isDeleted": false,+ "id": "broadcast-label",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 150,+ "y": 350,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 180,+ "height": 14,+ "seed": 18,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "WebSocketServer.broadcastStats()",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "WebSocketServer.broadcastStats()",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 19,+ "isDeleted": false,+ "id": "surge-flow-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 630,+ "y": 80,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "#f3e5f5",+ "width": 550,+ "height": 280,+ "seed": 19,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 20,+ "isDeleted": false,+ "id": "surge-flow-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 95,+ "strokeColor": "#4a148c",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 24,+ "seed": 20,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "๐ฃ 2. Surge ๆฐๆฎ้้ๆต็จ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ฃ 2. Surge ๆฐๆฎ้้ๆต็จ",+ "lineHeight": 1.5,+ "baseline": 19+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 21,+ "isDeleted": false,+ "id": "surge-gateway",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 130,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "#ffffff",+ "width": 120,+ "height": 50,+ "seed": 21,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 22,+ "isDeleted": false,+ "id": "surge-gateway-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 665,+ "y": 145,+ "strokeColor": "#4a148c",+ "backgroundColor": "transparent",+ "width": 90,+ "height": 20,+ "seed": 22,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "Surge Gateway",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "surge-gateway",+ "originalText": "Surge Gateway",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 23,+ "isDeleted": false,+ "id": "surge-arrow1",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 710,+ "y": 180,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "transparent",+ "width": 0,+ "height": 30,+ "seed": 23,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [0, 30]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 24,+ "isDeleted": false,+ "id": "surge-http-label",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 720,+ "y": 185,+ "strokeColor": "#6a1b9a",+ "backgroundColor": "transparent",+ "width": 140,+ "height": 28,+ "seed": 24,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "HTTP ่ฝฎ่ฏข (2s้ด้)\nGET /v1/requests/recent",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "HTTP ่ฝฎ่ฏข (2s้ด้)\nGET /v1/requests/recent",+ "lineHeight": 1.4,+ "baseline": 24+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 25,+ "isDeleted": false,+ "id": "surge-collector",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 210,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffffff",+ "width": 140,+ "height": 130,+ "seed": 25,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 26,+ "isDeleted": false,+ "id": "surge-collector-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 220,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 120,+ "height": 18,+ "seed": 26,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "SurgeCollector",+ "textAlign": "center",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "SurgeCollector",+ "lineHeight": 1.4,+ "baseline": 13+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 27,+ "isDeleted": false,+ "id": "surge-collector-steps",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 660,+ "y": 245,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 120,+ "height": 84,+ "seed": 27,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "1. ่ฏทๆฑๅค็\n2. ๆต้่ฟฝ่ธช\n3. ็ญ็ฅ็ผๅญๅๆญฅ\n4. ๆน้็ผๅฒ\n5. ๆฐๆฎๅๅ ฅ+ๅนฟๆญ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "1. ่ฏทๆฑๅค็\n2. ๆต้่ฟฝ่ธช\n3. ็ญ็ฅ็ผๅญๅๆญฅ\n4. ๆน้็ผๅฒ\n5. ๆฐๆฎๅๅ ฅ+ๅนฟๆญ",+ "lineHeight": 1.4,+ "baseline": 80+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 28,+ "isDeleted": false,+ "id": "surge-arrow2",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 790,+ "y": 240,+ "strokeColor": "#2e7d32",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 28,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 29,+ "isDeleted": false,+ "id": "sqlite-label2",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 800,+ "y": 220,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 50,+ "height": 14,+ "seed": 29,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ SQLite",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ SQLite",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 30,+ "isDeleted": false,+ "id": "surge-arrow3",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 790,+ "y": 270,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 30,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 31,+ "isDeleted": false,+ "id": "clickhouse-label2",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 800,+ "y": 250,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 14,+ "seed": 31,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ ClickHouse (ๅฏ้)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ ClickHouse (ๅฏ้)",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "arrow",+ "version": 1,+ "versionNonce": 32,+ "isDeleted": false,+ "id": "surge-arrow4",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 790,+ "y": 300,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 60,+ "height": 0,+ "seed": 32,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 2 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "startBinding": null,+ "endBinding": null,+ "lastCommittedPoint": null,+ "startArrowhead": null,+ "endArrowhead": "arrow",+ "points": [+ [0, 0],+ [60, 0]+ ]+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 33,+ "isDeleted": false,+ "id": "realtime-label2",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 800,+ "y": 280,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 100,+ "height": 14,+ "seed": 33,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "โ RealtimeStore",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ RealtimeStore",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 34,+ "isDeleted": false,+ "id": "triple-write-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 50,+ "y": 390,+ "strokeColor": "#e65100",+ "backgroundColor": "#fff3e0",+ "width": 1130,+ "height": 180,+ "seed": 34,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 35,+ "isDeleted": false,+ "id": "triple-write-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 405,+ "strokeColor": "#e65100",+ "backgroundColor": "transparent",+ "width": 160,+ "height": 24,+ "seed": 35,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "๐ ไธๅๆจกๅผ (Triple Write)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ ไธๅๆจกๅผ (Triple Write)",+ "lineHeight": 1.5,+ "baseline": 19+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 36,+ "isDeleted": false,+ "id": "sqlite-write-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 440,+ "strokeColor": "#1565c0",+ "backgroundColor": "#ffffff",+ "width": 330,+ "height": 110,+ "seed": 36,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 37,+ "isDeleted": false,+ "id": "sqlite-write-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 90,+ "y": 450,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 140,+ "height": 20,+ "seed": 37,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "โ SQLite (ๅง็ปๅๅ ฅ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ SQLite (ๅง็ปๅๅ ฅ)",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 38,+ "isDeleted": false,+ "id": "sqlite-write-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 90,+ "y": 480,+ "strokeColor": "#1565c0",+ "backgroundColor": "transparent",+ "width": 290,+ "height": 56,+ "seed": 38,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "โข ๆไน ๅๅญๅจ\nโข ้ ็ฝฎ/ๅ ๆฐๆฎ/็ป่ฎกๅๅฒ\nโข CH ไธๅฏ็จๆถ่ชๅจๅ้\nโข WAL Mode ๅนถๅไผๅ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โข ๆไน ๅๅญๅจ\nโข ้ ็ฝฎ/ๅ ๆฐๆฎ/็ป่ฎกๅๅฒ\nโข CH ไธๅฏ็จๆถ่ชๅจๅ้\nโข WAL Mode ๅนถๅไผๅ",+ "lineHeight": 1.4,+ "baseline": 52+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 39,+ "isDeleted": false,+ "id": "clickhouse-write-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 420,+ "y": 440,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffffff",+ "width": 360,+ "height": 110,+ "seed": 39,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 40,+ "isDeleted": false,+ "id": "clickhouse-write-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 440,+ "y": 450,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 180,+ "height": 20,+ "seed": 40,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "โ ClickHouse (ๅฏ้ๅๅ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ ClickHouse (ๅฏ้ๅๅ)",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 41,+ "isDeleted": false,+ "id": "clickhouse-write-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 440,+ "y": 480,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 320,+ "height": 56,+ "seed": 41,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "โข CH_WRITE_ENABLED=1 ๆถๅฏ็จ\nโข Buffer ่กจ โ SummingMergeTree\nโข ่ฟ็ปญๅคฑ่ดฅ่ชๅจๅ้ SQLite\nโข ๅคงๆถ้ด็ชๅฃ่ๅๆ้ 10x+",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โข CH_WRITE_ENABLED=1 ๆถๅฏ็จ\nโข Buffer ่กจ โ SummingMergeTree\nโข ่ฟ็ปญๅคฑ่ดฅ่ชๅจๅ้ SQLite\nโข ๅคงๆถ้ด็ชๅฃ่ๅๆ้ 10x+",+ "lineHeight": 1.4,+ "baseline": 52+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 42,+ "isDeleted": false,+ "id": "realtime-write-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 800,+ "y": 440,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffffff",+ "width": 350,+ "height": 110,+ "seed": 42,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 43,+ "isDeleted": false,+ "id": "realtime-write-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 820,+ "y": 450,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 20,+ "seed": 43,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 14,+ "fontFamily": 2,+ "text": "โ RealtimeStore (ๅ ๅญ)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ RealtimeStore (ๅ ๅญ)",+ "lineHeight": 1.4,+ "baseline": 15+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 44,+ "isDeleted": false,+ "id": "realtime-write-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 820,+ "y": 480,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 310,+ "height": 56,+ "seed": 44,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "โข ๅฎๆถๆฐๆฎๅฑ็คบ\nโข ไฝๅปถ่ฟๆจ้ (<100ms)\nโข ่กฅๅฟ Buffer ๅปถ่ฟ\nโข merge* ๆนๆณๅๅนถ DB+ๅข้",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โข ๅฎๆถๆฐๆฎๅฑ็คบ\nโข ไฝๅปถ่ฟๆจ้ (<100ms)\nโข ่กฅๅฟ Buffer ๅปถ่ฟ\nโข merge* ๆนๆณๅๅนถ DB+ๅข้",+ "lineHeight": 1.4,+ "baseline": 52+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 45,+ "isDeleted": false,+ "id": "read-routing-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 50,+ "y": 590,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#f1f8e9",+ "width": 550,+ "height": 200,+ "seed": 45,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 46,+ "isDeleted": false,+ "id": "read-routing-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 605,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 280,+ "height": 24,+ "seed": 46,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "๐ ่ฏปๅ่ทฏ็ฑ (STATS_QUERY_SOURCE)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ ่ฏปๅ่ทฏ็ฑ (STATS_QUERY_SOURCE)",+ "lineHeight": 1.5,+ "baseline": 19+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 47,+ "isDeleted": false,+ "id": "route-sqlite",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 640,+ "strokeColor": "#1565c0",+ "backgroundColor": "#e3f2fd",+ "width": 160,+ "height": 50,+ "seed": 47,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 48,+ "isDeleted": false,+ "id": "route-sqlite-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 80,+ "y": 650,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 140,+ "height": 30,+ "seed": 48,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "sqlite\nๅ จ้จ่ฏป SQLite (้ป่ฎค)",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "route-sqlite",+ "originalText": "sqlite\nๅ จ้จ่ฏป SQLite (้ป่ฎค)",+ "lineHeight": 1.4,+ "baseline": 26+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 49,+ "isDeleted": false,+ "id": "route-ch",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 250,+ "y": 640,+ "strokeColor": "#d84315",+ "backgroundColor": "#ffccbc",+ "width": 160,+ "height": 50,+ "seed": 49,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 50,+ "isDeleted": false,+ "id": "route-ch-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 260,+ "y": 650,+ "strokeColor": "#bf360c",+ "backgroundColor": "transparent",+ "width": 140,+ "height": 30,+ "seed": 50,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "clickhouse\nๅ จ้จ่ฏป ClickHouse",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "route-ch",+ "originalText": "clickhouse\nๅ จ้จ่ฏป ClickHouse",+ "lineHeight": 1.4,+ "baseline": 26+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 51,+ "isDeleted": false,+ "id": "route-auto",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 430,+ "y": 640,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#c8e6c9",+ "width": 150,+ "height": 80,+ "seed": 51,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 52,+ "isDeleted": false,+ "id": "route-auto-text",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 440,+ "y": 650,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 130,+ "height": 60,+ "seed": 52,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 11,+ "fontFamily": 2,+ "text": "auto (ๆบ่ฝ่ทฏ็ฑ)\nโข ่ฟๆ โ ClickHouse\nโข ๅๅฒ โ SQLite\nโข ๆ ๆ่ๅด โ SQLite",+ "textAlign": "center",+ "verticalAlign": "middle",+ "containerId": "route-auto",+ "originalText": "auto (ๆบ่ฝ่ทฏ็ฑ)\nโข ่ฟๆ โ ClickHouse\nโข ๅๅฒ โ SQLite\nโข ๆ ๆ่ๅด โ SQLite",+ "lineHeight": 1.3,+ "baseline": 56+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 53,+ "isDeleted": false,+ "id": "delta-merge-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 735,+ "strokeColor": "#d84315",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 18,+ "seed": 53,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "ๅข้ๅๅนถๆจกๅผ (Delta Merge)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๅข้ๅๅนถๆจกๅผ (Delta Merge)",+ "lineHeight": 1.4,+ "baseline": 13+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 54,+ "isDeleted": false,+ "id": "delta-merge-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 70,+ "y": 760,+ "strokeColor": "#424242",+ "backgroundColor": "transparent",+ "width": 480,+ "height": 14,+ "seed": 54,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "ๅฎขๆท็ซฏ่ฏทๆฑ โ DB ๅบ็กๆฐๆฎ + RealtimeStore.merge*() ๅ ๅญๅข้ โ ๅๅนถๅๆฐๆฎ (ๅฆ: 100MB + 5MB ๆ่ฟ30็ง)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๅฎขๆท็ซฏ่ฏทๆฑ โ DB ๅบ็กๆฐๆฎ + RealtimeStore.merge*() ๅ ๅญๅข้ โ ๅๅนถๅๆฐๆฎ (ๅฆ: 100MB + 5MB ๆ่ฟ30็ง)",+ "lineHeight": 1.4,+ "baseline": 10+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 55,+ "isDeleted": false,+ "id": "frontend-flow-box",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 630,+ "y": 590,+ "strokeColor": "#1976d2",+ "backgroundColor": "#e3f2fd",+ "width": 550,+ "height": 200,+ "seed": 55,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 56,+ "isDeleted": false,+ "id": "frontend-flow-title",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 605,+ "strokeColor": "#0d47a1",+ "backgroundColor": "transparent",+ "width": 220,+ "height": 24,+ "seed": 56,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 16,+ "fontFamily": 2,+ "text": "๐ ๅ็ซฏๆฐๆฎ่ทๅๆต็จ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ ๅ็ซฏๆฐๆฎ่ทๅๆต็จ",+ "lineHeight": 1.5,+ "baseline": 19+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 57,+ "isDeleted": false,+ "id": "react-query-flow",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 650,+ "y": 640,+ "strokeColor": "#ff6f00",+ "backgroundColor": "#ffe0b2",+ "width": 240,+ "height": 130,+ "seed": 57,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 58,+ "isDeleted": false,+ "id": "react-query-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 670,+ "y": 650,+ "strokeColor": "#e65100",+ "backgroundColor": "transparent",+ "width": 180,+ "height": 18,+ "seed": 58,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "ๆนๅผ1: React Query (HTTP)",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆนๅผ1: React Query (HTTP)",+ "lineHeight": 1.4,+ "baseline": 13+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 59,+ "isDeleted": false,+ "id": "react-query-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 670,+ "y": 675,+ "strokeColor": "#e65100",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 84,+ "seed": 59,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "useTrafficTrend()\n โ\napi.getTrafficTrendAggregated()\n โ\nCollector API (REST)\n โ\nStatsService โ DB Query",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "useTrafficTrend()\n โ\napi.getTrafficTrendAggregated()\n โ\nCollector API (REST)\n โ\nStatsService โ DB Query",+ "lineHeight": 1.4,+ "baseline": 80+ },+ {+ "type": "rectangle",+ "version": 1,+ "versionNonce": 60,+ "isDeleted": false,+ "id": "websocket-flow",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 910,+ "y": 640,+ "strokeColor": "#2e7d32",+ "backgroundColor": "#c8e6c9",+ "width": 240,+ "height": 130,+ "seed": 60,+ "groupIds": [],+ "frameId": null,+ "roundness": { "type": 3 },+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 61,+ "isDeleted": false,+ "id": "websocket-title",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 930,+ "y": 650,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 180,+ "height": 18,+ "seed": 61,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 13,+ "fontFamily": 2,+ "text": "ๆนๅผ2: WebSocket Hook",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆนๅผ2: WebSocket Hook",+ "lineHeight": 1.4,+ "baseline": 13+ },+ {+ "type": "text",+ "version": 1,+ "versionNonce": 62,+ "isDeleted": false,+ "id": "websocket-desc",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 1,+ "opacity": 100,+ "angle": 0,+ "x": 930,+ "y": 675,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "width": 200,+ "height": 84,+ "seed": 62,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "boundElements": [],+ "updated": 1,+ "link": null,+ "locked": false,+ "fontSize": 10,+ "fontFamily": 2,+ "text": "useStatsWebSocket()\n โ\nWebSocket ่ฟๆฅ\n โ\nโข subscribe ่ฎข้ ๆถๆฏ\nโข stats/pong ๆฅๆถๆจ้\nโข ่ชๅจ้่ฟๆบๅถ",+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "useStatsWebSocket()\n โ\nWebSocket ่ฟๆฅ\n โ\nโข subscribe ่ฎข้ ๆถๆฏ\nโข stats/pong ๆฅๆถๆจ้\nโข ่ชๅจ้่ฟๆบๅถ",+ "lineHeight": 1.4,+ "baseline": 80+ }+ ],+ "appState": {+ "gridSize": null,+ "viewBackgroundColor": "#ffffff"+ },+ "files": {}+}diff --git a/docs/architecture.excalidraw b/docs/architecture.excalidrawnew file mode 100644index 0000000..aa73879--- /dev/null+++ b/docs/architecture.excalidraw@@ -0,0 +1,2384 @@+{+ "type": "excalidraw",+ "version": 2,+ "source": "https://excalidraw.com",+ "elements": [+ {+ "id": "title",+ "type": "text",+ "x": 40,+ "y": -50,+ "width": 282.56,+ "height": 51.4,+ "angle": 0,+ "strokeColor": "#212529",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1000,+ "version": 1,+ "versionNonce": 1001,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Neko Master ็ณป็ปๆถๆๅพ",+ "fontSize": 28,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Neko Master ็ณป็ปๆถๆๅพ",+ "lineHeight": 1.55,+ "baseline": 28+ },+ {+ "id": "fe-layer",+ "type": "rectangle",+ "x": 40,+ "y": 0,+ "width": 1760,+ "height": 440,+ "angle": 0,+ "strokeColor": "#1971c2",+ "backgroundColor": "#e7f5ff",+ "fillStyle": "solid",+ "strokeWidth": 3,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1002,+ "version": 1,+ "versionNonce": 1003,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-title",+ "type": "text",+ "x": 60,+ "y": 8,+ "width": 453.92,+ "height": 34.35,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1004,+ "version": 1,+ "versionNonce": 1005,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "๐ฅ ๅ็ซฏๅฑ็คบๅฑ (Frontend) ยท Next.js 16 App Router",+ "fontSize": 17,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ฅ ๅ็ซฏๅฑ็คบๅฑ (Frontend) ยท Next.js 16 App Router",+ "lineHeight": 1.55,+ "baseline": 17+ },+ {+ "id": "fe-nextjs",+ "type": "rectangle",+ "x": 70,+ "y": 38,+ "width": 1700,+ "height": 185,+ "angle": 0,+ "strokeColor": "#339af0",+ "backgroundColor": "#d0ebff",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1006,+ "version": 1,+ "versionNonce": 1007,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-nextjs-t",+ "type": "text",+ "x": 90,+ "y": 46,+ "width": 196.32000000000002,+ "height": 29.7,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1008,+ "version": 1,+ "versionNonce": 1009,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Next.js 16 (App Router)",+ "fontSize": 14,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Next.js 16 (App Router)",+ "lineHeight": 1.55,+ "baseline": 14+ },+ {+ "id": "fe-dash-r",+ "type": "rectangle",+ "x": 90,+ "y": 72,+ "width": 390,+ "height": 138,+ "angle": 0,+ "strokeColor": "#74c0fc",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1010,+ "version": 1,+ "versionNonce": 1011,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-dash-t",+ "type": "text",+ "x": 102,+ "y": 82,+ "width": 76.48,+ "height": 82.4,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1012,+ "version": 1,+ "versionNonce": 1013,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Dashboard\nไปช่กจๆฟ\n\nไธปๆฐๆฎ็ๆฟ",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Dashboard\nไปช่กจๆฟ\n\nไธปๆฐๆฎ็ๆฟ",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "fe-over-r",+ "type": "rectangle",+ "x": 500,+ "y": 72,+ "width": 390,+ "height": 138,+ "angle": 0,+ "strokeColor": "#74c0fc",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1014,+ "version": 1,+ "versionNonce": 1015,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-over-t",+ "type": "text",+ "x": 512,+ "y": 82,+ "width": 69.76,+ "height": 82.4,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1016,+ "version": 1,+ "versionNonce": 1017,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Overview\nๆฆ่ง\n\nๆฑๆป็ป่ฎก",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Overview\nๆฆ่ง\n\nๆฑๆป็ป่ฎก",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "fe-charts-r",+ "type": "rectangle",+ "x": 910,+ "y": 72,+ "width": 390,+ "height": 138,+ "angle": 0,+ "strokeColor": "#74c0fc",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1018,+ "version": 1,+ "versionNonce": 1019,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-charts-t",+ "type": "text",+ "x": 922,+ "y": 82,+ "width": 56.32000000000001,+ "height": 82.4,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1020,+ "version": 1,+ "versionNonce": 1021,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Charts\nๅพ่กจ\n\n่ถๅฟๅฏ่งๅ",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Charts\nๅพ่กจ\n\n่ถๅฟๅฏ่งๅ",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "fe-tables-r",+ "type": "rectangle",+ "x": 1320,+ "y": 72,+ "width": 440,+ "height": 138,+ "angle": 0,+ "strokeColor": "#74c0fc",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1022,+ "version": 1,+ "versionNonce": 1023,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-tables-t",+ "type": "text",+ "x": 1332,+ "y": 82,+ "width": 136.96,+ "height": 82.4,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1024,+ "version": 1,+ "versionNonce": 1025,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Interactive Tables\nไบคไบๅผ่กจๆ ผ\n\nๅๅ/IP/ไปฃ็/่งๅ",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Interactive Tables\nไบคไบๅผ่กจๆ ผ\n\nๅๅ/IP/ไปฃ็/่งๅ",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "fe-rq-r",+ "type": "rectangle",+ "x": 70,+ "y": 235,+ "width": 835,+ "height": 185,+ "angle": 0,+ "strokeColor": "#339af0",+ "backgroundColor": "#e7f5ff",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1026,+ "version": 1,+ "versionNonce": 1027,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-rq-t",+ "type": "text",+ "x": 90,+ "y": 245,+ "width": 176.16000000000003,+ "height": 108.75,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1028,+ "version": 1,+ "versionNonce": 1029,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "React Query (TanStack)\n\nยท API ๆฐๆฎ่ทๅไธ็ผๅญ\nยท ไน่งๆดๆฐไธ็ถๆ็ฎก็\nยท ่ชๅจ้่ฏไธ้่ฏฏๅค็",+ "fontSize": 13,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "React Query (TanStack)\n\nยท API ๆฐๆฎ่ทๅไธ็ผๅญ\nยท ไน่งๆดๆฐไธ็ถๆ็ฎก็\nยท ่ชๅจ้่ฏไธ้่ฏฏๅค็",+ "lineHeight": 1.55,+ "baseline": 13+ },+ {+ "id": "fe-wsh-r",+ "type": "rectangle",+ "x": 925,+ "y": 235,+ "width": 845,+ "height": 185,+ "angle": 0,+ "strokeColor": "#339af0",+ "backgroundColor": "#e7f5ff",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1030,+ "version": 1,+ "versionNonce": 1031,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "fe-wsh-t",+ "type": "text",+ "x": 945,+ "y": 245,+ "width": 176.16000000000003,+ "height": 108.75,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1032,+ "version": 1,+ "versionNonce": 1033,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "useStatsWebSocket Hook\n\nยท WebSocket ่ฟๆฅ็ฎก็\nยท ๅฎๆถๆฐๆฎ่ฎข้ \nยท ่ชๅจ้่ฟไธๅฟ่ทณ",+ "fontSize": 13,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "useStatsWebSocket Hook\n\nยท WebSocket ่ฟๆฅ็ฎก็\nยท ๅฎๆถๆฐๆฎ่ฎข้ \nยท ่ชๅจ้่ฟไธๅฟ่ทณ",+ "lineHeight": 1.55,+ "baseline": 13+ },+ {+ "id": "arr-fe-svc",+ "type": "arrow",+ "x": 950,+ "y": 440,+ "width": 0,+ "height": 70,+ "angle": 0,+ "strokeColor": "#1971c2",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1034,+ "version": 1,+ "versionNonce": 1035,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 70+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "arr-fe-svc-lbl",+ "type": "text",+ "x": 960,+ "y": 448,+ "width": 210.88000000000002,+ "height": 26.6,+ "angle": 0,+ "strokeColor": "#1971c2",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1036,+ "version": 1,+ "versionNonce": 1037,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "HTTP / WebSocket (Cookie ่ฎค่ฏ)",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "HTTP / WebSocket (Cookie ่ฎค่ฏ)",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-layer",+ "type": "rectangle",+ "x": 40,+ "y": 510,+ "width": 1760,+ "height": 1190,+ "angle": 0,+ "strokeColor": "#2f9e44",+ "backgroundColor": "#ebfbee",+ "fillStyle": "solid",+ "strokeWidth": 3,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1038,+ "version": 1,+ "versionNonce": 1039,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-title",+ "type": "text",+ "x": 60,+ "y": 518,+ "width": 273.04,+ "height": 34.35,+ "angle": 0,+ "strokeColor": "#2b8a3e",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1040,+ "version": 1,+ "versionNonce": 1041,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "โ๏ธ ๆๅกๅฑ (Collector Service)",+ "fontSize": 17,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โ๏ธ ๆๅกๅฑ (Collector Service)",+ "lineHeight": 1.55,+ "baseline": 17+ },+ {+ "id": "svc-api-r",+ "type": "rectangle",+ "x": 70,+ "y": 550,+ "width": 840,+ "height": 300,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1042,+ "version": 1,+ "versionNonce": 1043,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-api-t",+ "type": "text",+ "x": 90,+ "y": 560,+ "width": 197.44000000000003,+ "height": 249.8,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1044,+ "version": 1,+ "versionNonce": 1045,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "API Server (Fastify)\n\nREST API Endpoints:\n /api/backends - ๅ็ซฏ็ฎก็\n /api/stats - ็ป่ฎกๆฐๆฎ\n /api/auth - ่ฎค่ฏ็ฎก็\n /api/domains - ๅๅ็ป่ฎก\n /api/ips - IP ็ป่ฎก\n /api/proxies - ไปฃ็็ป่ฎก\n /api/rules - ่งๅ็ป่ฎก\n /api/devices - ่ฎพๅค็ป่ฎก\n /api/gateway/* - ็ฝๅ ณไปฃ็\n /api/retention - ๆฐๆฎไฟ็",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "API Server (Fastify)\n\nREST API Endpoints:\n /api/backends - ๅ็ซฏ็ฎก็\n /api/stats - ็ป่ฎกๆฐๆฎ\n /api/auth - ่ฎค่ฏ็ฎก็\n /api/domains - ๅๅ็ป่ฎก\n /api/ips - IP ็ป่ฎก\n /api/proxies - ไปฃ็็ป่ฎก\n /api/rules - ่งๅ็ป่ฎก\n /api/devices - ่ฎพๅค็ป่ฎก\n /api/gateway/* - ็ฝๅ ณไปฃ็\n /api/retention - ๆฐๆฎไฟ็",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-ws-r",+ "type": "rectangle",+ "x": 930,+ "y": 550,+ "width": 835,+ "height": 300,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1046,+ "version": 1,+ "versionNonce": 1047,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-ws-t",+ "type": "text",+ "x": 950,+ "y": 560,+ "width": 251.20000000000002,+ "height": 194,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1048,+ "version": 1,+ "versionNonce": 1049,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "WebSocket Server (ws)\n\nยท ่ฟๆฅ็ฎก็ (Client Connections)\nยท ่ฎข้ ็ฎก็ (Range / Backend / Interval)\nยท ๅนฟๆญๆจ้ (Broadcast Stats)\nยท ๆ่ฆ็ผๅญ (Summary Cache, 2s TTL)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (Surge Policy Sync)\n\nๆฐๆฎๅ ็ฑปๅ:\n stats trend domains ips pong",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "WebSocket Server (ws)\n\nยท ่ฟๆฅ็ฎก็ (Client Connections)\nยท ่ฎข้ ็ฎก็ (Range / Backend / Interval)\nยท ๅนฟๆญๆจ้ (Broadcast Stats)\nยท ๆ่ฆ็ผๅญ (Summary Cache, 2s TTL)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (Surge Policy Sync)\n\nๆฐๆฎๅ ็ฑปๅ:\n stats trend domains ips pong",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-gc-outer",+ "type": "rectangle",+ "x": 70,+ "y": 870,+ "width": 1700,+ "height": 310,+ "angle": 0,+ "strokeColor": "#20c997",+ "backgroundColor": "#c3fae8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1050,+ "version": 1,+ "versionNonce": 1051,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-gc-title",+ "type": "text",+ "x": 90,+ "y": 878,+ "width": 227.68,+ "height": 29.7,+ "angle": 0,+ "strokeColor": "#087f5b",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1052,+ "version": 1,+ "versionNonce": 1053,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Gateway Collectors (ๆฐๆฎ้้ๅจ)",+ "fontSize": 14,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Gateway Collectors (ๆฐๆฎ้้ๅจ)",+ "lineHeight": 1.55,+ "baseline": 14+ },+ {+ "id": "svc-clash1-r",+ "type": "rectangle",+ "x": 90,+ "y": 908,+ "width": 520,+ "height": 255,+ "angle": 0,+ "strokeColor": "#63e6be",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1054,+ "version": 1,+ "versionNonce": 1055,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-clash1-t",+ "type": "text",+ "x": 102,+ "y": 918,+ "width": 176.16000000000003,+ "height": 195.55,+ "angle": 0,+ "strokeColor": "#087f5b",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1056,+ "version": 1,+ "versionNonce": 1057,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "svc-clash2-r",+ "type": "rectangle",+ "x": 630,+ "y": 908,+ "width": 520,+ "height": 255,+ "angle": 0,+ "strokeColor": "#63e6be",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1058,+ "version": 1,+ "versionNonce": 1059,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-clash2-t",+ "type": "text",+ "x": 642,+ "y": 918,+ "width": 176.16000000000003,+ "height": 195.55,+ "angle": 0,+ "strokeColor": "#087f5b",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1060,+ "version": 1,+ "versionNonce": 1061,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "svc-surge1-r",+ "type": "rectangle",+ "x": 1170,+ "y": 908,+ "width": 580,+ "height": 255,+ "angle": 0,+ "strokeColor": "#63e6be",+ "backgroundColor": "#ffffff",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1062,+ "version": 1,+ "versionNonce": 1063,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-surge1-t",+ "type": "text",+ "x": 1182,+ "y": 918,+ "width": 206.96,+ "height": 195.55,+ "angle": 0,+ "strokeColor": "#087f5b",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1064,+ "version": 1,+ "versionNonce": 1065,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Surge Collector\n\nๅ่ฎฎ: HTTP REST Polling (2s)\n GET /v1/requests/recent\n\nๅ่ฝ:\nยท ้ฒ้ๅค่ฎก็ฎ (recentlyCompleted Map)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (10min ๅฎๆถ)\nยท ๅข้่ฎก็ฎ + ๆน้็ผๅฒ (30s)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฏ (โค5ๆฌก)",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Surge Collector\n\nๅ่ฎฎ: HTTP REST Polling (2s)\n GET /v1/requests/recent\n\nๅ่ฝ:\nยท ้ฒ้ๅค่ฎก็ฎ (recentlyCompleted Map)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (10min ๅฎๆถ)\nยท ๅข้่ฎก็ฎ + ๆน้็ผๅฒ (30s)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฏ (โค5ๆฌก)",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "svc-ps-r",+ "type": "rectangle",+ "x": 70,+ "y": 1210,+ "width": 840,+ "height": 170,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1066,+ "version": 1,+ "versionNonce": 1067,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-ps-t",+ "type": "text",+ "x": 90,+ "y": 1220,+ "width": 257.92,+ "height": 119.60000000000001,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1068,+ "version": 1,+ "versionNonce": 1069,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Policy Sync Service (่ๆฏไปปๅก)\n\nยท ๅฎๆถๅๆญฅ Surge ็ญ็ฅ: /v1/policies\n /v1/policy_groups/select\nยท ๅญๅจ: surge_policy_cache ่กจ\nยท ็ผๅญ่ฟๆ: 10 ๅ้ | ๅ้: ็ดๆฅ API",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Policy Sync Service (่ๆฏไปปๅก)\n\nยท ๅฎๆถๅๆญฅ Surge ็ญ็ฅ: /v1/policies\n /v1/policy_groups/select\nยท ๅญๅจ: surge_policy_cache ่กจ\nยท ็ผๅญ่ฟๆ: 10 ๅ้ | ๅ้: ็ดๆฅ API",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-rt-r",+ "type": "rectangle",+ "x": 930,+ "y": 1210,+ "width": 835,+ "height": 170,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1070,+ "version": 1,+ "versionNonce": 1071,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-rt-t",+ "type": "text",+ "x": 950,+ "y": 1220,+ "width": 278.08000000000004,+ "height": 156.8,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1072,+ "version": 1,+ "versionNonce": 1073,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "RealtimeStore (ๅ ๅญๅฎๆถๆฐๆฎ, ๆ backendId ้็ฆป)\n\nยท summaryByBackend ยท minuteByBackend\nยท domainByBackend ยท ipByBackend\nยท proxyByBackend ยท ruleByBackend\nยท countryByBackend ยท deviceByBackend\n\nmerge*() ๅๅนถ DB ๆฐๆฎไธๅฎๆถๅข้",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "RealtimeStore (ๅ ๅญๅฎๆถๆฐๆฎ, ๆ backendId ้็ฆป)\n\nยท summaryByBackend ยท minuteByBackend\nยท domainByBackend ยท ipByBackend\nยท proxyByBackend ยท ruleByBackend\nยท countryByBackend ยท deviceByBackend\n\nmerge*() ๅๅนถ DB ๆฐๆฎไธๅฎๆถๅข้",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-geo-r",+ "type": "rectangle",+ "x": 70,+ "y": 1410,+ "width": 1700,+ "height": 160,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1074,+ "version": 1,+ "versionNonce": 1075,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-geo-t",+ "type": "text",+ "x": 90,+ "y": 1420,+ "width": 459.52000000000004,+ "height": 82.4,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1076,+ "version": 1,+ "versionNonce": 1077,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "GeoIP Service\n\nProviders: IP-API.com (้ป่ฎค) | IPInfo.io (ๅค้)\nๅ่ฝ: ๆฌๅฐ LRU ็ผๅญ ยท ๆน้ๆฅ่ฏขไผๅ ยท ๅคฑ่ดฅๅทๅดๆบๅถ ยท IPv4/IPv6 ๅๆ ยท ASN ๆฅ่ฏข",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "GeoIP Service\n\nProviders: IP-API.com (้ป่ฎค) | IPInfo.io (ๅค้)\nๅ่ฝ: ๆฌๅฐ LRU ็ผๅญ ยท ๆน้ๆฅ่ฏขไผๅ ยท ๅคฑ่ดฅๅทๅดๆบๅถ ยท IPv4/IPv6 ๅๆ ยท ASN ๆฅ่ฏข",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "svc-bb-r",+ "type": "rectangle",+ "x": 70,+ "y": 1605,+ "width": 1700,+ "height": 80,+ "angle": 0,+ "strokeColor": "#51cf66",+ "backgroundColor": "#d3f9d8",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1078,+ "version": 1,+ "versionNonce": 1079,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "svc-bb-t",+ "type": "text",+ "x": 90,+ "y": 1617,+ "width": 661.1200000000001,+ "height": 45.2,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1080,+ "version": 1,+ "versionNonce": 1081,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "BatchBuffer.flush() ยท ไธๅๆจกๅผ (Triple Write):\n โ SQLite (ๅง็ปๅๅ ฅ) โก ClickHouse Buffer ่กจ (CH_WRITE_ENABLED=1) โข RealtimeStore (ๅ ๅญๅฎๆถ)",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "BatchBuffer.flush() ยท ไธๅๆจกๅผ (Triple Write):\n โ SQLite (ๅง็ปๅๅ ฅ) โก ClickHouse Buffer ่กจ (CH_WRITE_ENABLED=1) โข RealtimeStore (ๅ ๅญๅฎๆถ)",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "arr-svc-sq",+ "type": "arrow",+ "x": 480,+ "y": 1700,+ "width": 0,+ "height": 20,+ "angle": 0,+ "strokeColor": "#f08c00",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1082,+ "version": 1,+ "versionNonce": 1083,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 20+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "arr-svc-ch",+ "type": "arrow",+ "x": 1400,+ "y": 1700,+ "width": 0,+ "height": 20,+ "angle": 0,+ "strokeColor": "#f08c00",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "dashed",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1084,+ "version": 1,+ "versionNonce": 1085,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 20+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "arr-svc-sq-lbl",+ "type": "text",+ "x": 490,+ "y": 1704,+ "width": 96.08000000000001,+ "height": 25.05,+ "angle": 0,+ "strokeColor": "#e67700",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1086,+ "version": 1,+ "versionNonce": 1087,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "SQLite (ๅง็ปๅๅ ฅ)",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "SQLite (ๅง็ปๅๅ ฅ)",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "arr-svc-ch-lbl",+ "type": "text",+ "x": 1220,+ "y": 1704,+ "width": 231.60000000000002,+ "height": 25.05,+ "angle": 0,+ "strokeColor": "#e67700",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1088,+ "version": 1,+ "versionNonce": 1089,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "ClickHouse (CH_WRITE_ENABLED=1, ๅฏ้)",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ClickHouse (CH_WRITE_ENABLED=1, ๅฏ้)",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "st-layer",+ "type": "rectangle",+ "x": 40,+ "y": 1720,+ "width": 1760,+ "height": 480,+ "angle": 0,+ "strokeColor": "#f59f00",+ "backgroundColor": "#fff9db",+ "fillStyle": "solid",+ "strokeWidth": 3,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1090,+ "version": 1,+ "versionNonce": 1091,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "st-title",+ "type": "text",+ "x": 60,+ "y": 1728,+ "width": 196.88000000000002,+ "height": 34.35,+ "angle": 0,+ "strokeColor": "#e67700",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1092,+ "version": 1,+ "versionNonce": 1093,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "๐พ ๆฐๆฎๅญๅจๅฑ (Storage)",+ "fontSize": 17,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐พ ๆฐๆฎๅญๅจๅฑ (Storage)",+ "lineHeight": 1.55,+ "baseline": 17+ },+ {+ "id": "st-sq-r",+ "type": "rectangle",+ "x": 70,+ "y": 1762,+ "width": 840,+ "height": 415,+ "angle": 0,+ "strokeColor": "#fcc419",+ "backgroundColor": "#fff3bf",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1094,+ "version": 1,+ "versionNonce": 1095,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "st-sq-t",+ "type": "text",+ "x": 90,+ "y": 1772,+ "width": 331.84000000000003,+ "height": 305.6,+ "angle": 0,+ "strokeColor": "#7d5807",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1096,+ "version": 1,+ "versionNonce": 1097,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "SQLite Database (WAL Mode) [ๅง็ปๅฏ็จ]\n\n็ป่ฎก่กจ (ๆ backend_id ๅๅบ):\n domain_stats ip_stats proxy_stats\n rule_stats country_stats device_stats\n minute_stats hourly_stats daily_stats\n\n้ ็ฝฎ / ็ผๅญ่กจ:\n backend_configs geoip_cache asn_cache\n auth_config retention_config\n surge_policy_cache\n\nRepository ๆจกๅผ (12 ไธช Repo ็ฑป):\n domain ยท ip ยท rule ยท proxy ยท device\n country ยท timeseries ยท config ยท backend\n auth ยท surge ยท trafficWriter",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "SQLite Database (WAL Mode) [ๅง็ปๅฏ็จ]\n\n็ป่ฎก่กจ (ๆ backend_id ๅๅบ):\n domain_stats ip_stats proxy_stats\n rule_stats country_stats device_stats\n minute_stats hourly_stats daily_stats\n\n้ ็ฝฎ / ็ผๅญ่กจ:\n backend_configs geoip_cache asn_cache\n auth_config retention_config\n surge_policy_cache\n\nRepository ๆจกๅผ (12 ไธช Repo ็ฑป):\n domain ยท ip ยท rule ยท proxy ยท device\n country ยท timeseries ยท config ยท backend\n auth ยท surge ยท trafficWriter",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "st-ch-r",+ "type": "rectangle",+ "x": 930,+ "y": 1762,+ "width": 835,+ "height": 415,+ "angle": 0,+ "strokeColor": "#fcc419",+ "backgroundColor": "#fff3bf",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1098,+ "version": 1,+ "versionNonce": 1099,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "st-ch-t",+ "type": "text",+ "x": 950,+ "y": 1772,+ "width": 264.64,+ "height": 305.6,+ "angle": 0,+ "strokeColor": "#7d5807",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1100,+ "version": 1,+ "versionNonce": 1101,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "ClickHouse [ๅฏ้, CH_ENABLED=1]\n\nBuffer ่กจ (ๅผๆญฅๆฅๆถ, ~5min ๅๅนถ):\n traffic_detail_buffer\n traffic_agg_buffer\n country_buffer\n โ merge (SummingMergeTree)\nไธปๆฐๆฎ่กจ:\n traffic_detail (่ฟๆฅ่ฏฆๆ )\n traffic_agg (่ๅ็ป่ฎก)\n country_stats (ๅฝๅฎถ็ป่ฎก)\n\n่ฏปๅ่ทฏ็ฑ (STATS_QUERY_SOURCE):\n sqlite โ ๅ จ้จ่ฏป SQLite (้ป่ฎค)\n clickhouse โ ๅ จ้จ่ฏป ClickHouse\n auto โ ๆบ่ฝ่ทฏ็ฑ",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ClickHouse [ๅฏ้, CH_ENABLED=1]\n\nBuffer ่กจ (ๅผๆญฅๆฅๆถ, ~5min ๅๅนถ):\n traffic_detail_buffer\n traffic_agg_buffer\n country_buffer\n โ merge (SummingMergeTree)\nไธปๆฐๆฎ่กจ:\n traffic_detail (่ฟๆฅ่ฏฆๆ )\n traffic_agg (่ๅ็ป่ฎก)\n country_stats (ๅฝๅฎถ็ป่ฎก)\n\n่ฏปๅ่ทฏ็ฑ (STATS_QUERY_SOURCE):\n sqlite โ ๅ จ้จ่ฏป SQLite (้ป่ฎค)\n clickhouse โ ๅ จ้จ่ฏป ClickHouse\n auto โ ๆบ่ฝ่ทฏ็ฑ",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "arr-ds-svc",+ "type": "arrow",+ "x": 100,+ "y": 2220,+ "width": 0,+ "height": 520,+ "angle": 0,+ "strokeColor": "#9c36b5",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1102,+ "version": 1,+ "versionNonce": 1103,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ -520+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "arr-ds-lbl",+ "type": "text",+ "x": 112,+ "y": 2100,+ "width": 83.76,+ "height": 59.15,+ "angle": 0,+ "strokeColor": "#9c36b5",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1104,+ "version": 1,+ "versionNonce": 1105,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "ๆฐๆฎ้้\nWebSocket\n/ HTTP Poll",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆฐๆฎ้้\nWebSocket\n/ HTTP Poll",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "ds-layer",+ "type": "rectangle",+ "x": 40,+ "y": 2220,+ "width": 1760,+ "height": 360,+ "angle": 0,+ "strokeColor": "#9c36b5",+ "backgroundColor": "#f3d9fa",+ "fillStyle": "solid",+ "strokeWidth": 3,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1106,+ "version": 1,+ "versionNonce": 1107,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ds-title",+ "type": "text",+ "x": 60,+ "y": 2228,+ "width": 339.68,+ "height": 34.35,+ "angle": 0,+ "strokeColor": "#862e9c",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1108,+ "version": 1,+ "versionNonce": 1109,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "๐ก ๆฐๆฎๆบๅฑ (Data Sources / Gateways)",+ "fontSize": 17,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "๐ก ๆฐๆฎๆบๅฑ (Data Sources / Gateways)",+ "lineHeight": 1.55,+ "baseline": 17+ },+ {+ "id": "ds-clash-r",+ "type": "rectangle",+ "x": 70,+ "y": 2262,+ "width": 840,+ "height": 295,+ "angle": 0,+ "strokeColor": "#cc5de8",+ "backgroundColor": "#eedefa",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1110,+ "version": 1,+ "versionNonce": 1111,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ds-clash-t",+ "type": "text",+ "x": 90,+ "y": 2272,+ "width": 284.8,+ "height": 268.40000000000003,+ "angle": 0,+ "strokeColor": "#862e9c",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1112,+ "version": 1,+ "versionNonce": 1113,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Clash / Mihomo Gateway\n\nWebSocket ็ซฏ็น:\n WS /connections (ๅฎๆถๆจ้, ๆฏ่ฟๆฅๆดๆฐ)\n WS /traffic\n HTTP /rules /proxies\n\n่ฟๆฅๆฐๆฎๆ ผๅผ:\n { connections: [{\n id: \"uuid\",\n metadata: {\n host, destinationIP, sourceIP,\n chains: [...], rule, rulePayload,\n upload, download }}]}",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Clash / Mihomo Gateway\n\nWebSocket ็ซฏ็น:\n WS /connections (ๅฎๆถๆจ้, ๆฏ่ฟๆฅๆดๆฐ)\n WS /traffic\n HTTP /rules /proxies\n\n่ฟๆฅๆฐๆฎๆ ผๅผ:\n { connections: [{\n id: \"uuid\",\n metadata: {\n host, destinationIP, sourceIP,\n chains: [...], rule, rulePayload,\n upload, download }}]}",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "ds-surge-r",+ "type": "rectangle",+ "x": 930,+ "y": 2262,+ "width": 835,+ "height": 295,+ "angle": 0,+ "strokeColor": "#cc5de8",+ "backgroundColor": "#eedefa",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1114,+ "version": 1,+ "versionNonce": 1115,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ds-surge-t",+ "type": "text",+ "x": 950,+ "y": 2272,+ "width": 284.8,+ "height": 249.8,+ "angle": 0,+ "strokeColor": "#862e9c",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1116,+ "version": 1,+ "versionNonce": 1117,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Surge Gateway (v5+)\n\nHTTP REST API ็ซฏ็น:\n GET /v1/requests/recent (ๆ่ฟ่ฟๆฅ, 2s ่ฝฎ่ฏข)\n GET /v1/policies (็ญ็ฅๅ่กจ)\n GET /v1/policy_groups/select (็ญ็ฅ็ป)\n\nๅผๅฏๆนๅผ:\n http-api = 127.0.0.1:9091\n http-api-tls = false\n\nๆณจๆ: DNS ๅจไปฃ็ๆๅกๅจ่งฃๆ\n ๆ ๆณ่ทๅ็ๅฎ่ฝๅฐ IP",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Surge Gateway (v5+)\n\nHTTP REST API ็ซฏ็น:\n GET /v1/requests/recent (ๆ่ฟ่ฟๆฅ, 2s ่ฝฎ่ฏข)\n GET /v1/policies (็ญ็ฅๅ่กจ)\n GET /v1/policy_groups/select (็ญ็ฅ็ป)\n\nๅผๅฏๆนๅผ:\n http-api = 127.0.0.1:9091\n http-api-tls = false\n\nๆณจๆ: DNS ๅจไปฃ็ๆๅกๅจ่งฃๆ\n ๆ ๆณ่ทๅ็ๅฎ่ฝๅฐ IP",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "ag-section-title",+ "type": "text",+ "x": 40,+ "y": 2622,+ "width": 813.44,+ "height": 32.8,+ "angle": 0,+ "strokeColor": "#495057",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1118,+ "version": 1,+ "versionNonce": 1119,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "โโ Agent ๆจกๅผๆถๆ (่ฟ็จๆฐๆฎ้้) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ",+ "fontSize": 16,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "โโ Agent ๆจกๅผๆถๆ (่ฟ็จๆฐๆฎ้้) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ",+ "lineHeight": 1.55,+ "baseline": 16+ },+ {+ "id": "ag-panel-r",+ "type": "rectangle",+ "x": 600,+ "y": 2660,+ "width": 700,+ "height": 380,+ "angle": 0,+ "strokeColor": "#1971c2",+ "backgroundColor": "#e7f5ff",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1120,+ "version": 1,+ "versionNonce": 1121,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ag-panel-t",+ "type": "text",+ "x": 620,+ "y": 2670,+ "width": 217.60000000000002,+ "height": 268.40000000000003,+ "angle": 0,+ "strokeColor": "#1864ab",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1122,+ "version": 1,+ "versionNonce": 1123,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "ไธญๅฟ้ขๆฟ (Neko Master)\n\nFastify API Server:\n POST /api/agent/report\n ๆฅๆถๆน้ๆต้ๅข้\n POST /api/agent/heartbeat\n ๆฅๆถๅฟ่ทณ (ๅจ็บฟ็ถๆ)\n POST /api/agent/config-sync\n ่งๅ/ไปฃ็/Provider ้ ็ฝฎ\n POST /api/agent/policy-state\n ๅฝๅ็ญ็ฅ็ถๆ\n\nBackend ็ฑปๅ: agent://\n็ณป็ป็ๆ token, ็ปๅฎ agentId",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ไธญๅฟ้ขๆฟ (Neko Master)\n\nFastify API Server:\n POST /api/agent/report\n ๆฅๆถๆน้ๆต้ๅข้\n POST /api/agent/heartbeat\n ๆฅๆถๅฟ่ทณ (ๅจ็บฟ็ถๆ)\n POST /api/agent/config-sync\n ่งๅ/ไปฃ็/Provider ้ ็ฝฎ\n POST /api/agent/policy-state\n ๅฝๅ็ญ็ฅ็ถๆ\n\nBackend ็ฑปๅ: agent://\n็ณป็ป็ๆ token, ็ปๅฎ agentId",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "ag-arr-up",+ "type": "arrow",+ "x": 950,+ "y": 3110,+ "width": 0,+ "height": 70,+ "angle": 0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1124,+ "version": 1,+ "versionNonce": 1125,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ -70+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "ag-arr-lbl",+ "type": "text",+ "x": 960,+ "y": 3060,+ "width": 114.56,+ "height": 25.05,+ "angle": 0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1126,+ "version": 1,+ "versionNonce": 1127,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "HTTP (token ้ดๆ)",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "HTTP (token ้ดๆ)",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "ag-host-r",+ "type": "rectangle",+ "x": 300,+ "y": 3110,+ "width": 1300,+ "height": 500,+ "angle": 0,+ "strokeColor": "#2f9e44",+ "backgroundColor": "#ebfbee",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1128,+ "version": 1,+ "versionNonce": 1129,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ag-host-t",+ "type": "text",+ "x": 320,+ "y": 3120,+ "width": 399.04,+ "height": 361.40000000000003,+ "angle": 0,+ "strokeColor": "#1b5e20",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1130,+ "version": 1,+ "versionNonce": 1131,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "็ฝๅ ณๆ่พน็ไธปๆบ (Remote Host)\n\nnekoagent (CLI ็ฎก็ๅจ, Shell ่ๆฌ)\n /etc/neko-agent/<instance>.env ้ ็ฝฎๆไปถ\n /var/run/neko-agent/<instance>.pid PID ๆไปถ\n\nneko-agent (ๅฎๆค่ฟ็จ, Go)\n 1. ๆๅ็ฝๅ ณๆฐๆฎ\n Clash/Mihomo: WS /connections (ๅฎๆถๆจ้)\n Surge: HTTP GET /v1/requests/recent (2s ่ฝฎ่ฏข)\n 2. ๅข้่ฎก็ฎ (Delta)\n ่ฏๅซๆฐ/ๆดๆฐ่ฟๆฅ โ ่ฎก็ฎ upload/download ๅข้ โ ่ๅ\n 3. ๆน้ไธๆฅ (ๆฏ 2s) POST /api/agent/report\n ๆๅค 1000 ๆก/ๆน, ็งฏๅไธ้ 50000 ๆก\n 4. ๅฟ่ทณ (ๆฏ 30s) POST /api/agent/heartbeat\n 5. ้ ็ฝฎๅๆญฅ (ๆฏ 2min, MD5 ๅป้) POST /api/agent/config-sync\n 6. ็ญ็ฅๅๆญฅ (ๆฏ 30s, ๅๅๆถ) POST /api/agent/policy-state\n\nPID ้: ๅไธ backendId ๅๆถๅชๅ ่ฎธไธไธช่ฟ็จ่ฟ่ก",+ "fontSize": 12,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "็ฝๅ ณๆ่พน็ไธปๆบ (Remote Host)\n\nnekoagent (CLI ็ฎก็ๅจ, Shell ่ๆฌ)\n /etc/neko-agent/<instance>.env ้ ็ฝฎๆไปถ\n /var/run/neko-agent/<instance>.pid PID ๆไปถ\n\nneko-agent (ๅฎๆค่ฟ็จ, Go)\n 1. ๆๅ็ฝๅ ณๆฐๆฎ\n Clash/Mihomo: WS /connections (ๅฎๆถๆจ้)\n Surge: HTTP GET /v1/requests/recent (2s ่ฝฎ่ฏข)\n 2. ๅข้่ฎก็ฎ (Delta)\n ่ฏๅซๆฐ/ๆดๆฐ่ฟๆฅ โ ่ฎก็ฎ upload/download ๅข้ โ ่ๅ\n 3. ๆน้ไธๆฅ (ๆฏ 2s) POST /api/agent/report\n ๆๅค 1000 ๆก/ๆน, ็งฏๅไธ้ 50000 ๆก\n 4. ๅฟ่ทณ (ๆฏ 30s) POST /api/agent/heartbeat\n 5. ้ ็ฝฎๅๆญฅ (ๆฏ 2min, MD5 ๅป้) POST /api/agent/config-sync\n 6. ็ญ็ฅๅๆญฅ (ๆฏ 30s, ๅๅๆถ) POST /api/agent/policy-state\n\nPID ้: ๅไธ backendId ๅๆถๅชๅ ่ฎธไธไธช่ฟ็จ่ฟ่ก",+ "lineHeight": 1.55,+ "baseline": 12+ },+ {+ "id": "ag-arr-gw",+ "type": "arrow",+ "x": 950,+ "y": 3680,+ "width": 0,+ "height": 70,+ "angle": 0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 2+ },+ "seed": 1132,+ "version": 1,+ "versionNonce": 1133,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ -70+ ]+ ],+ "lastCommittedPoint": null,+ "startBinding": null,+ "endBinding": null,+ "startArrowhead": null,+ "endArrowhead": "arrow"+ },+ {+ "id": "ag-gw-lbl",+ "type": "text",+ "x": 960,+ "y": 3620,+ "width": 77.60000000000001,+ "height": 25.05,+ "angle": 0,+ "strokeColor": "#868e96",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1134,+ "version": 1,+ "versionNonce": 1135,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "ๆฌๅฐ็ฝ็ป (LAN)",+ "fontSize": 11,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "ๆฌๅฐ็ฝ็ป (LAN)",+ "lineHeight": 1.55,+ "baseline": 11+ },+ {+ "id": "ag-gw-r",+ "type": "rectangle",+ "x": 600,+ "y": 3680,+ "width": 700,+ "height": 100,+ "angle": 0,+ "strokeColor": "#9c36b5",+ "backgroundColor": "#f3d9fa",+ "fillStyle": "solid",+ "strokeWidth": 2,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": {+ "type": 3+ },+ "seed": 1136,+ "version": 1,+ "versionNonce": 1137,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false+ },+ {+ "id": "ag-gw-t",+ "type": "text",+ "x": 620,+ "y": 3700,+ "width": 290.40000000000003,+ "height": 29.7,+ "angle": 0,+ "strokeColor": "#862e9c",+ "backgroundColor": "transparent",+ "fillStyle": "solid",+ "strokeWidth": 1,+ "strokeStyle": "solid",+ "roughness": 0,+ "opacity": 100,+ "groupIds": [],+ "frameId": null,+ "roundness": null,+ "seed": 1138,+ "version": 1,+ "versionNonce": 1139,+ "isDeleted": false,+ "boundElements": [],+ "updated": 1771730359905,+ "link": null,+ "locked": false,+ "text": "Clash/Mihomo ๆ Surge Gateway API",+ "fontSize": 14,+ "fontFamily": 1,+ "textAlign": "left",+ "verticalAlign": "top",+ "containerId": null,+ "originalText": "Clash/Mihomo ๆ Surge Gateway API",+ "lineHeight": 1.55,+ "baseline": 14+ }+ ],+ "appState": {+ "gridSize": null,+ "viewBackgroundColor": "#f8f9fa"+ },+ "files": {}+}\ No newline at end of filediff --git a/scripts/gen-excalidraw.js b/scripts/gen-excalidraw.jsnew file mode 100644index 0000000..5dba707--- /dev/null+++ b/scripts/gen-excalidraw.js@@ -0,0 +1,280 @@+#!/usr/bin/env node+// Generates docs/architecture.excalidraw from the architecture in docs/architecture.md++const fs = require('fs');++let _seed = 1000;+const now = Date.now();++function s() { return _seed++; }++function rect(id, x, y, w, h, bg, strokeColor = "#495057", strokeWidth = 2) {+ return {+ id, type: "rectangle",+ x, y, width: w, height: h,+ angle: 0, strokeColor, backgroundColor: bg,+ fillStyle: "solid", strokeWidth, strokeStyle: "solid",+ roughness: 0, opacity: 100, groupIds: [], frameId: null,+ roundness: { type: 3 }, seed: s(), version: 1, versionNonce: s(),+ isDeleted: false, boundElements: [], updated: now, link: null, locked: false+ };+}++function text(id, x, y, content, fontSize = 13, color = "#212529", align = "left") {+ const lines = content.split('\n');+ const w = Math.max(...lines.map(l => l.length)) * fontSize * 0.56 + 16;+ const h = lines.length * fontSize * 1.55 + 8;+ return {+ id, type: "text",+ x, y, width: w, height: h,+ angle: 0, strokeColor: color, backgroundColor: "transparent",+ fillStyle: "solid", strokeWidth: 1, strokeStyle: "solid",+ roughness: 0, opacity: 100, groupIds: [], frameId: null,+ roundness: null, seed: s(), version: 1, versionNonce: s(),+ isDeleted: false, boundElements: [], updated: now, link: null, locked: false,+ text: content, fontSize, fontFamily: 1,+ textAlign: align, verticalAlign: "top",+ containerId: null, originalText: content,+ lineHeight: 1.55, baseline: fontSize+ };+}++function arrow(id, x1, y1, x2, y2, color = "#868e96", dashed = false) {+ const dx = x2 - x1, dy = y2 - y1;+ return {+ id, type: "arrow",+ x: x1, y: y1, width: Math.abs(dx), height: Math.abs(dy),+ angle: 0, strokeColor: color, backgroundColor: "transparent",+ fillStyle: "solid", strokeWidth: 2,+ strokeStyle: dashed ? "dashed" : "solid",+ roughness: 0, opacity: 100, groupIds: [], frameId: null,+ roundness: { type: 2 }, seed: s(), version: 1, versionNonce: s(),+ isDeleted: false, boundElements: [], updated: now, link: null, locked: false,+ points: [[0, 0], [dx, dy]],+ lastCommittedPoint: null, startBinding: null, endBinding: null,+ startArrowhead: null, endArrowhead: "arrow"+ };+}++function label(id, x, y, content, fontSize = 12, color = "#495057") {+ return text(id, x, y, content, fontSize, color);+}++const elements = [];+const e = (...args) => elements.push(...args);++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// TITLE+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+e(text("title", 40, -50, "Neko Master ็ณป็ปๆถๆๅพ", 28, "#212529"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// LAYER 1: FRONTEND y: 0 โ 440+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const FE_Y = 0, FE_H = 440;+e(rect("fe-layer", 40, FE_Y, 1760, FE_H, "#e7f5ff", "#1971c2", 3));+e(text("fe-title", 60, FE_Y + 8, "๐ฅ ๅ็ซฏๅฑ็คบๅฑ (Frontend) ยท Next.js 16 App Router", 17, "#1864ab"));++// Next.js inner container+e(rect("fe-nextjs", 70, FE_Y + 38, 1700, 185, "#d0ebff", "#339af0", 2));+e(text("fe-nextjs-t", 90, FE_Y + 46, "Next.js 16 (App Router)", 14, "#1864ab"));++// 4 page cards+const CARDS = [+ ["fe-dash", 90, FE_Y+72, 390, 138, "Dashboard\nไปช่กจๆฟ\n\nไธปๆฐๆฎ็ๆฟ"],+ ["fe-over", 500, FE_Y+72, 390, 138, "Overview\nๆฆ่ง\n\nๆฑๆป็ป่ฎก"],+ ["fe-charts", 910, FE_Y+72, 390, 138, "Charts\nๅพ่กจ\n\n่ถๅฟๅฏ่งๅ"],+ ["fe-tables",1320, FE_Y+72, 440, 138, "Interactive Tables\nไบคไบๅผ่กจๆ ผ\n\nๅๅ/IP/ไปฃ็/่งๅ"],+];+CARDS.forEach(([id, x, y, w, h, txt]) => {+ e(rect(id + "-r", x, y, w, h, "#ffffff", "#74c0fc", 1));+ e(text(id + "-t", x + 12, y + 10, txt, 12, "#1864ab"));+});++// React Query & WS Hook+e(rect("fe-rq-r", 70, FE_Y+235, 835, 185, "#e7f5ff", "#339af0", 2));+e(text("fe-rq-t", 90, FE_Y+245,+ "React Query (TanStack)\n\nยท API ๆฐๆฎ่ทๅไธ็ผๅญ\nยท ไน่งๆดๆฐไธ็ถๆ็ฎก็\nยท ่ชๅจ้่ฏไธ้่ฏฏๅค็",+ 13, "#1864ab"));++e(rect("fe-wsh-r", 925, FE_Y+235, 845, 185, "#e7f5ff", "#339af0", 2));+e(text("fe-wsh-t", 945, FE_Y+245,+ "useStatsWebSocket Hook\n\nยท WebSocket ่ฟๆฅ็ฎก็\nยท ๅฎๆถๆฐๆฎ่ฎข้ \nยท ่ชๅจ้่ฟไธๅฟ่ทณ",+ 13, "#1864ab"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// Arrow FE โ SVC+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const SVC_Y = 510;+e(arrow("arr-fe-svc", 950, FE_Y + FE_H, 950, SVC_Y, "#1971c2"));+e(label("arr-fe-svc-lbl", 960, FE_Y + FE_H + 8, "HTTP / WebSocket (Cookie ่ฎค่ฏ)", 12, "#1971c2"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// LAYER 2: SERVICE y: 510 โ 1700+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const SVC_H = 1190;+e(rect("svc-layer", 40, SVC_Y, 1760, SVC_H, "#ebfbee", "#2f9e44", 3));+e(text("svc-title", 60, SVC_Y + 8, "โ๏ธ ๆๅกๅฑ (Collector Service)", 17, "#2b8a3e"));++// API Server+e(rect("svc-api-r", 70, SVC_Y + 40, 840, 300, "#d3f9d8", "#51cf66", 2));+e(text("svc-api-t", 90, SVC_Y + 50,+ "API Server (Fastify)\n\nREST API Endpoints:\n /api/backends - ๅ็ซฏ็ฎก็\n /api/stats - ็ป่ฎกๆฐๆฎ\n /api/auth - ่ฎค่ฏ็ฎก็\n /api/domains - ๅๅ็ป่ฎก\n /api/ips - IP ็ป่ฎก\n /api/proxies - ไปฃ็็ป่ฎก\n /api/rules - ่งๅ็ป่ฎก\n /api/devices - ่ฎพๅค็ป่ฎก\n /api/gateway/* - ็ฝๅ ณไปฃ็\n /api/retention - ๆฐๆฎไฟ็",+ 12, "#1b5e20"));++// WebSocket Server+e(rect("svc-ws-r", 930, SVC_Y + 40, 835, 300, "#d3f9d8", "#51cf66", 2));+e(text("svc-ws-t", 950, SVC_Y + 50,+ "WebSocket Server (ws)\n\nยท ่ฟๆฅ็ฎก็ (Client Connections)\nยท ่ฎข้ ็ฎก็ (Range / Backend / Interval)\nยท ๅนฟๆญๆจ้ (Broadcast Stats)\nยท ๆ่ฆ็ผๅญ (Summary Cache, 2s TTL)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (Surge Policy Sync)\n\nๆฐๆฎๅ ็ฑปๅ:\n stats trend domains ips pong",+ 12, "#1b5e20"));++// Gateway Collectors container+const GC_Y = SVC_Y + 360;+e(rect("svc-gc-outer", 70, GC_Y, 1700, 310, "#c3fae8", "#20c997", 2));+e(text("svc-gc-title", 90, GC_Y + 8, "Gateway Collectors (ๆฐๆฎ้้ๅจ)", 14, "#087f5b"));++// Clash Collector ร2 + Surge Collector+const COL_Y = GC_Y + 38;+const COLS = [+ ["svc-clash1", 90, COL_Y, 520, 255,+ "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ"],+ ["svc-clash2", 630, COL_Y, 520, 255,+ "Clash Collector (Mihomo)\n\nๅ่ฎฎ: WebSocket\n WS /connections ๅฎๆถๆจ้\n\nๅ่ฝ:\nยท ๆต้่ฟฝ่ธช + ๅข้่ฎก็ฎ (delta)\nยท ไปฃ็้พๆๅ (chains)\nยท ๆน้็ผๅฒ (30s flush / 5000ๆก)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฟ"],+ ["svc-surge1",1170, COL_Y, 580, 255,+ "Surge Collector\n\nๅ่ฎฎ: HTTP REST Polling (2s)\n GET /v1/requests/recent\n\nๅ่ฝ:\nยท ้ฒ้ๅค่ฎก็ฎ (recentlyCompleted Map)\nยท ็ญ็ฅ็ผๅญๅๆญฅ (10min ๅฎๆถ)\nยท ๅข้่ฎก็ฎ + ๆน้็ผๅฒ (30s)\nยท GeoIP ๆฅ่ฏข้ๆ\nยท ๆๆฐ้้ฟ้่ฏ (โค5ๆฌก)"],+];+COLS.forEach(([id, x, y, w, h, txt]) => {+ e(rect(id + "-r", x, y, w, h, "#ffffff", "#63e6be", 1));+ e(text(id + "-t", x + 12, y + 10, txt, 11, "#087f5b"));+});++// Policy Sync + RealtimeStore+const PS_Y = SVC_Y + 700;+e(rect("svc-ps-r", 70, PS_Y, 840, 170, "#d3f9d8", "#51cf66", 2));+e(text("svc-ps-t", 90, PS_Y + 10,+ "Policy Sync Service (่ๆฏไปปๅก)\n\nยท ๅฎๆถๅๆญฅ Surge ็ญ็ฅ: /v1/policies\n /v1/policy_groups/select\nยท ๅญๅจ: surge_policy_cache ่กจ\nยท ็ผๅญ่ฟๆ: 10 ๅ้ | ๅ้: ็ดๆฅ API",+ 12, "#1b5e20"));++e(rect("svc-rt-r", 930, PS_Y, 835, 170, "#d3f9d8", "#51cf66", 2));+e(text("svc-rt-t", 950, PS_Y + 10,+ "RealtimeStore (ๅ ๅญๅฎๆถๆฐๆฎ, ๆ backendId ้็ฆป)\n\nยท summaryByBackend ยท minuteByBackend\nยท domainByBackend ยท ipByBackend\nยท proxyByBackend ยท ruleByBackend\nยท countryByBackend ยท deviceByBackend\n\nmerge*() ๅๅนถ DB ๆฐๆฎไธๅฎๆถๅข้",+ 12, "#1b5e20"));++// GeoIP Service+const GEO_Y = SVC_Y + 900;+e(rect("svc-geo-r", 70, GEO_Y, 1700, 160, "#d3f9d8", "#51cf66", 2));+e(text("svc-geo-t", 90, GEO_Y + 10,+ "GeoIP Service\n\nProviders: IP-API.com (้ป่ฎค) | IPInfo.io (ๅค้)\nๅ่ฝ: ๆฌๅฐ LRU ็ผๅญ ยท ๆน้ๆฅ่ฏขไผๅ ยท ๅคฑ่ดฅๅทๅดๆบๅถ ยท IPv4/IPv6 ๅๆ ยท ASN ๆฅ่ฏข",+ 12, "#1b5e20"));++// BatchBuffer (triple write hint)+const BB_Y = SVC_Y + 1095;+e(rect("svc-bb-r", 70, BB_Y, 1700, 80, "#d3f9d8", "#51cf66", 2));+e(text("svc-bb-t", 90, BB_Y + 12,+ "BatchBuffer.flush() ยท ไธๅๆจกๅผ (Triple Write):\n โ SQLite (ๅง็ปๅๅ ฅ) โก ClickHouse Buffer ่กจ (CH_WRITE_ENABLED=1) โข RealtimeStore (ๅ ๅญๅฎๆถ)",+ 12, "#1b5e20"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// Arrows SVC โ Storage+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const ST_Y = SVC_Y + SVC_H + 20;+e(arrow("arr-svc-sq", 480, SVC_Y + SVC_H, 480, ST_Y, "#f08c00"));+e(arrow("arr-svc-ch", 1400, SVC_Y + SVC_H, 1400, ST_Y, "#f08c00", true));+e(label("arr-svc-sq-lbl", 490, SVC_Y + SVC_H + 4, "SQLite (ๅง็ปๅๅ ฅ)", 11, "#e67700"));+e(label("arr-svc-ch-lbl", 1220, SVC_Y + SVC_H + 4, "ClickHouse (CH_WRITE_ENABLED=1, ๅฏ้)", 11, "#e67700"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// LAYER 3: STORAGE y: ST_Y โ ST_Y+500+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const ST_H = 480;+e(rect("st-layer", 40, ST_Y, 1760, ST_H, "#fff9db", "#f59f00", 3));+e(text("st-title", 60, ST_Y + 8, "๐พ ๆฐๆฎๅญๅจๅฑ (Storage)", 17, "#e67700"));++// SQLite+e(rect("st-sq-r", 70, ST_Y + 42, 840, 415, "#fff3bf", "#fcc419", 2));+e(text("st-sq-t", 90, ST_Y + 52,+ "SQLite Database (WAL Mode) [ๅง็ปๅฏ็จ]\n\n็ป่ฎก่กจ (ๆ backend_id ๅๅบ):\n domain_stats ip_stats proxy_stats\n rule_stats country_stats device_stats\n minute_stats hourly_stats daily_stats\n\n้ ็ฝฎ / ็ผๅญ่กจ:\n backend_configs geoip_cache asn_cache\n auth_config retention_config\n surge_policy_cache\n\nRepository ๆจกๅผ (12 ไธช Repo ็ฑป):\n domain ยท ip ยท rule ยท proxy ยท device\n country ยท timeseries ยท config ยท backend\n auth ยท surge ยท trafficWriter",+ 12, "#7d5807"));++// ClickHouse+e(rect("st-ch-r", 930, ST_Y + 42, 835, 415, "#fff3bf", "#fcc419", 2));+e(text("st-ch-t", 950, ST_Y + 52,+ "ClickHouse [ๅฏ้, CH_ENABLED=1]\n\nBuffer ่กจ (ๅผๆญฅๆฅๆถ, ~5min ๅๅนถ):\n traffic_detail_buffer\n traffic_agg_buffer\n country_buffer\n โ merge (SummingMergeTree)\nไธปๆฐๆฎ่กจ:\n traffic_detail (่ฟๆฅ่ฏฆๆ )\n traffic_agg (่ๅ็ป่ฎก)\n country_stats (ๅฝๅฎถ็ป่ฎก)\n\n่ฏปๅ่ทฏ็ฑ (STATS_QUERY_SOURCE):\n sqlite โ ๅ จ้จ่ฏป SQLite (้ป่ฎค)\n clickhouse โ ๅ จ้จ่ฏป ClickHouse\n auto โ ๆบ่ฝ่ทฏ็ฑ",+ 12, "#7d5807"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// Arrow DS โ SVC (upward, left side)+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const DS_Y = ST_Y + ST_H + 20;+e(arrow("arr-ds-svc", 100, DS_Y, 100, SVC_Y + SVC_H, "#9c36b5"));+e(label("arr-ds-lbl", 112, DS_Y - 120, "ๆฐๆฎ้้\nWebSocket\n/ HTTP Poll", 11, "#9c36b5"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// LAYER 4: DATA SOURCES y: DS_Y โ DS_Y+360+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const DS_H = 360;+e(rect("ds-layer", 40, DS_Y, 1760, DS_H, "#f3d9fa", "#9c36b5", 3));+e(text("ds-title", 60, DS_Y + 8, "๐ก ๆฐๆฎๆบๅฑ (Data Sources / Gateways)", 17, "#862e9c"));++// Clash/Mihomo+e(rect("ds-clash-r", 70, DS_Y + 42, 840, 295, "#eedefa", "#cc5de8", 2));+e(text("ds-clash-t", 90, DS_Y + 52,+ "Clash / Mihomo Gateway\n\nWebSocket ็ซฏ็น:\n WS /connections (ๅฎๆถๆจ้, ๆฏ่ฟๆฅๆดๆฐ)\n WS /traffic\n HTTP /rules /proxies\n\n่ฟๆฅๆฐๆฎๆ ผๅผ:\n { connections: [{\n id: \"uuid\",\n metadata: {\n host, destinationIP, sourceIP,\n chains: [...], rule, rulePayload,\n upload, download }}]}",+ 12, "#862e9c"));++// Surge+e(rect("ds-surge-r", 930, DS_Y + 42, 835, 295, "#eedefa", "#cc5de8", 2));+e(text("ds-surge-t", 950, DS_Y + 52,+ "Surge Gateway (v5+)\n\nHTTP REST API ็ซฏ็น:\n GET /v1/requests/recent (ๆ่ฟ่ฟๆฅ, 2s ่ฝฎ่ฏข)\n GET /v1/policies (็ญ็ฅๅ่กจ)\n GET /v1/policy_groups/select (็ญ็ฅ็ป)\n\nๅผๅฏๆนๅผ:\n http-api = 127.0.0.1:9091\n http-api-tls = false\n\nๆณจๆ: DNS ๅจไปฃ็ๆๅกๅจ่งฃๆ\n ๆ ๆณ่ทๅ็ๅฎ่ฝๅฐ IP",+ 12, "#862e9c"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// AGENT MODE SECTION (below main arch)+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const AG_Y = DS_Y + DS_H + 80;++e(text("ag-section-title", 40, AG_Y - 38, "โโ Agent ๆจกๅผๆถๆ (่ฟ็จๆฐๆฎ้้) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ", 16, "#495057"));++// Central Panel+e(rect("ag-panel-r", 600, AG_Y, 700, 380, "#e7f5ff", "#1971c2", 2));+e(text("ag-panel-t", 620, AG_Y + 10,+ "ไธญๅฟ้ขๆฟ (Neko Master)\n\nFastify API Server:\n POST /api/agent/report\n ๆฅๆถๆน้ๆต้ๅข้\n POST /api/agent/heartbeat\n ๆฅๆถๅฟ่ทณ (ๅจ็บฟ็ถๆ)\n POST /api/agent/config-sync\n ่งๅ/ไปฃ็/Provider ้ ็ฝฎ\n POST /api/agent/policy-state\n ๅฝๅ็ญ็ฅ็ถๆ\n\nBackend ็ฑปๅ: agent://\n็ณป็ป็ๆ token, ็ปๅฎ agentId",+ 12, "#1864ab"));++// Arrow: Agent โ Panel+const AG_HOST_Y = AG_Y + 450;+e(arrow("ag-arr-up", 950, AG_HOST_Y, 950, AG_Y + 380, "#868e96"));+e(label("ag-arr-lbl", 960, AG_HOST_Y - 50, "HTTP (token ้ดๆ)", 11, "#868e96"));++// Remote Host+e(rect("ag-host-r", 300, AG_HOST_Y, 1300, 500, "#ebfbee", "#2f9e44", 2));+e(text("ag-host-t", 320, AG_HOST_Y + 10,+ "็ฝๅ ณๆ่พน็ไธปๆบ (Remote Host)\n\nnekoagent (CLI ็ฎก็ๅจ, Shell ่ๆฌ)\n /etc/neko-agent/<instance>.env ้ ็ฝฎๆไปถ\n /var/run/neko-agent/<instance>.pid PID ๆไปถ\n\nneko-agent (ๅฎๆค่ฟ็จ, Go)\n 1. ๆๅ็ฝๅ ณๆฐๆฎ\n Clash/Mihomo: WS /connections (ๅฎๆถๆจ้)\n Surge: HTTP GET /v1/requests/recent (2s ่ฝฎ่ฏข)\n 2. ๅข้่ฎก็ฎ (Delta)\n ่ฏๅซๆฐ/ๆดๆฐ่ฟๆฅ โ ่ฎก็ฎ upload/download ๅข้ โ ่ๅ\n 3. ๆน้ไธๆฅ (ๆฏ 2s) POST /api/agent/report\n ๆๅค 1000 ๆก/ๆน, ็งฏๅไธ้ 50000 ๆก\n 4. ๅฟ่ทณ (ๆฏ 30s) POST /api/agent/heartbeat\n 5. ้ ็ฝฎๅๆญฅ (ๆฏ 2min, MD5 ๅป้) POST /api/agent/config-sync\n 6. ็ญ็ฅๅๆญฅ (ๆฏ 30s, ๅๅๆถ) POST /api/agent/policy-state\n\nPID ้: ๅไธ backendId ๅๆถๅชๅ ่ฎธไธไธช่ฟ็จ่ฟ่ก",+ 12, "#1b5e20"));++// Gateway below agent host+const AG_GW_Y = AG_HOST_Y + 570;+e(arrow("ag-arr-gw", 950, AG_GW_Y, 950, AG_HOST_Y + 500, "#868e96"));+e(label("ag-gw-lbl", 960, AG_HOST_Y + 510, "ๆฌๅฐ็ฝ็ป (LAN)", 11, "#868e96"));++e(rect("ag-gw-r", 600, AG_GW_Y, 700, 100, "#f3d9fa", "#9c36b5", 2));+e(text("ag-gw-t", 620, AG_GW_Y + 20, "Clash/Mihomo ๆ Surge Gateway API", 14, "#862e9c"));++// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+// OUTPUT+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+const diagram = {+ type: "excalidraw",+ version: 2,+ source: "https://excalidraw.com",+ elements,+ appState: {+ gridSize: null,+ viewBackgroundColor: "#f8f9fa"+ },+ files: {}+};++const outPath = 'docs/architecture.excalidraw';+fs.writeFileSync(outPath, JSON.stringify(diagram, null, 2), 'utf-8');+console.log(`โ Generated ${outPath} (${elements.length} elements)`);