DocsArchitecture
System Architecture
Comprehensive overview of CyxWiz's system architecture, component relationships, and data flows.
High-Level Architecture
CYXWIZ PLATFORM ARCHITECTURE
+------------------+ +------------------+
| | | |
| CyxWiz Engine | +--------------------+ | Server Node 1 |
| (Desktop GUI) |<------>| |<-------->| (GPU Worker) |
| | gRPC | CyxWiz Central | gRPC | |
+------------------+ | Server | +------------------+
| | | |
| | (Rust/Tokio) | |
v | | v
+------------------+ +--------------------+ +------------------+
| | | | | | |
| cyxwiz-backend | | | | | Server Node 2 |
| (Shared DLL) | | | | | (CPU Worker) |
| | | | | | |
+------------------+ | | | +------------------+
| | |
+------------+ | +------------+
| | |
v v v
+-----------+ +-----------+ +-----------+
|PostgreSQL | | Redis | | Solana |
| SQLite | | Cache | |Blockchain |
+-----------+ +-----------+ +-----------+CyxWiz Engine Architecture
cyxwiz-engine/
+-------------------+
| Application | <- Main entry point, GLFW window management
+-------------------+
|
v
+-------------------+
| Main Window | <- Dockable window layout, panel management
+-------------------+
|
+----+----+----+----+----+----+----+----+
| | | | | | | | |
v v v v v v v v v
+------+------+------+------+------+------+------+------+------+
|Node |Script|Console|Props |Asset |View- |Train |Dataset|Tool |
|Editor|Editor| |Panel |Brows.|port |Dashbd|Panel |Panels|
+------+------+------+------+------+------+------+------+------+| Component | Purpose |
|---|---|
| Application | Window creation, ImGui init, main loop |
| MainWindow | Docking layout, panel coordination |
| NodeEditor | Visual ML pipeline builder |
| ScriptEditor | Python/CyxWiz code editing |
| Console | Python REPL, log output |
| TrainingExecutor | Local model training |
Central Server Architecture
| Module | Path | Purpose |
|---|---|---|
| api::grpc | src/api/grpc/ | gRPC service implementations |
| api::rest | src/api/rest/ | REST API endpoints |
| scheduler | src/scheduler/ | Job queue, node matcher |
| database | src/database/ | Models, queries, migrations |
| cache | src/cache/ | Redis integration |
| blockchain | src/blockchain/ | Solana client, escrow |
Network Topology
+---------------------+
| Central Server |
| (Single Point) |
+---------------------+
/|\
/ | \
/ | \
/ | \
/ | \
v v v
+------+ +------+ +------+
|Node 1| |Node 2| |Node 3|
| | | | | |
+------+ +------+ +------+
| | |
v v v
+------+ +------+ +------+
| GPU | | GPU | | CPU |
+------+ +------+ +------+Communication Patterns
| Pattern | Protocol | Use Case |
|---|---|---|
| Request-Response | gRPC Unary | Job submission, status queries |
| Server Streaming | gRPC Stream | Real-time job updates |
| Heartbeat | gRPC Unary | Node keep-alive |
| P2P (Future) | WebRTC/QUIC | Direct Engine-Node transfer |
Port Allocation
| Service | Port | Protocol | Purpose |
|---|---|---|---|
| Central Server gRPC | 50051 | gRPC/HTTP2 | Main API |
| Central Server REST | 8080 | HTTP/1.1 | Web dashboard |
| Server Node Deployment | 50052 | gRPC/HTTP2 | Model deployment |
| Server Node Terminal | 50053 | gRPC/HTTP2 | Remote terminal |
| Server Node OpenAI API | 8000 | HTTP/1.1 | Model inference |
Database Schema Overview
-- Nodes table
nodes (
id UUID PRIMARY KEY,
name VARCHAR(255),
ip_address VARCHAR(45),
port INTEGER,
cpu_cores INTEGER,
ram_total BIGINT,
status VARCHAR(20),
reputation DECIMAL(3,2),
created_at TIMESTAMP,
last_seen TIMESTAMP
)
-- Jobs table
jobs (
id UUID PRIMARY KEY,
user_id UUID,
job_type VARCHAR(20),
status VARCHAR(20),
priority INTEGER,
model_config JSONB,
assigned_node UUID REFERENCES nodes(id),
progress DECIMAL(5,4),
payment_amount DECIMAL(20,8),
escrow_tx VARCHAR(88),
created_at TIMESTAMP,
completed_at TIMESTAMP
)