docs: update architecture documentation and manifests

Refine technical documentation to reflect current architecture, component structure, and routing conventions for the vcon console.
This commit is contained in:
Team Dark Devil committed 2026-11-17 21:22:55 +06:00
1 parent bb938c33c0
commit 367dd819f8
64 files changed
+910 -2661

No files matched your search

+5 -13
View File
@@ -1,17 +1,9 @@
# Server Manifest
# Socket.IO Ingestion Server Manifest (`server/`)
## Purpose
Independent Express.js and Socket.IO ingestion service operating on Port 4000.
Standalone Express.js and Socket.IO ingestion service running on Port `4000` (`server/index.js`).
## Architecture
- **Port**: 4000 (Decoupled from Next.js on port 3000)
- **Role**: High-throughput WebSocket handshake, JWT verify, event intake
- **Worker**: `workers/csvWriter.js` for async batch appending to `/storage/data/{clientId}/{YYYY-MM-DD}.csv`
- **Socket Handlers**: `socket/handlers.js` with client room partitioning and rate limiting.
## Dependencies
- `express`
- `socket.io`
- `cors`
- `jsonwebtoken`
- `json2csv`
- `index.js`: Initializes the HTTP/Socket.IO server, synchronizes runtime settings and client status from PostgreSQL (`admin_settings`, `client_sdks`), schedules periodic and threshold-based buffer flushes, and exposes `GET /health` and `POST /internal/flush`.
- `socket/handlers.js`: Authenticates Socket.IO handshakes via JWT, blocks revoked clients or rotated tokens in real time, validates rate limits, payload sizes, and 5-minute TTL idempotency on `sync_data` and `batch_sync`, and updates client event counters in PostgreSQL.
- `workers/csvWriter.js`: Asynchronous batch CSV writer appending queued events to `/storage/data/{clientId}/{YYYY-MM-DD}.csv` with automatic size-based file rotation (`-part2.csv`).