Skip to content

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.ts
index 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.excalidraw
new file mode 100644
index 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.excalidraw
new file mode 100644
index 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.excalidraw
new file mode 100644
index 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 file
diff --git a/scripts/gen-excalidraw.js b/scripts/gen-excalidraw.js
new file mode 100644
index 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)`);