CyxWiz LogoCyxWiz
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|
+------+------+------+------+------+------+------+------+------+
ComponentPurpose
ApplicationWindow creation, ImGui init, main loop
MainWindowDocking layout, panel coordination
NodeEditorVisual ML pipeline builder
ScriptEditorPython/CyxWiz code editing
ConsolePython REPL, log output
TrainingExecutorLocal model training

Central Server Architecture

ModulePathPurpose
api::grpcsrc/api/grpc/gRPC service implementations
api::restsrc/api/rest/REST API endpoints
schedulersrc/scheduler/Job queue, node matcher
databasesrc/database/Models, queries, migrations
cachesrc/cache/Redis integration
blockchainsrc/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

PatternProtocolUse Case
Request-ResponsegRPC UnaryJob submission, status queries
Server StreaminggRPC StreamReal-time job updates
HeartbeatgRPC UnaryNode keep-alive
P2P (Future)WebRTC/QUICDirect Engine-Node transfer

Port Allocation

ServicePortProtocolPurpose
Central Server gRPC50051gRPC/HTTP2Main API
Central Server REST8080HTTP/1.1Web dashboard
Server Node Deployment50052gRPC/HTTP2Model deployment
Server Node Terminal50053gRPC/HTTP2Remote terminal
Server Node OpenAI API8000HTTP/1.1Model 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
)