# matiasdamelio/rofex_fix architecture

> Architecture diagram of the GitHub repository matiasdamelio/rofex_fix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/matiasdamelio/rofex_fix
- Repository: https://github.com/matiasdamelio/rofex_fix

## Overview

##### File structure
- Top-level “Main” folder contains:
- application.py – orchestrator/entry point
- client.py & socket_client.py – likely FIX client wrapper and WebSocket client examples
- WebSocket/ – implements a BroadcasterWebsocketServer and tests (test_socket.py)
- “conf” folder holds:
- rofex.cfg – connection settings (host, port, credentials)
- spec/*.xml – FIX message specifications
- “model/logger.py” – centralized logging utility

Architectural patterns:
- Layered design (configuration → protocol handling → networking → logging)
- Pub/Sub or broadcaster pattern in the WebSocket server

##### README for additional insights
- README only contains a project title, so all architectural clues come from file names and structure.

##### Diagramming recommendations
- Blue for networking (WebSocket, FIX)
- Green for configuration
- Orange for core application logic
- Gray for external systems

##### Final checklist
- Notation for external systems vs in-process modules

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "External Systems"
        Clients["WebSocket Clients"]:::external
        ROFEX["ROFEX Exchange"]:::external
    end

    subgraph "Networking Layer"
        WS_Server["BroadcasterWebsocketServer"]:::networking
        WS_Test["test_socket.py"]:::networking
        WS_Client["socket_client.py"]:::networking
        FIX_Client["FIX Client (session manager)"]:::networking
    end

    subgraph "Core Layer"
        AppCore["application.py"]:::core
    end

    subgraph "Configuration Layer"
        ConfigLoader["Configuration Loader (rofex.cfg)"]:::configuration
        Spec1["FIX50SP2.xml"]:::configuration
        Spec2["FIX50SP2_rofex.xml"]:::configuration
        Spec3["FIXT11.xml"]:::configuration
    end

    Logger["Logger"]:::logging

    Clients -->|JSON over WS| WS_Server
    WS_Client -->|JSON over WS| WS_Server
    WS_Server -->|calls| AppCore
    AppCore -->|dashed init| ConfigLoader
    ConfigLoader -->|reads specs| Spec1
    ConfigLoader -->|reads specs| Spec2
    ConfigLoader -->|reads specs| Spec3
    AppCore -->|initialize| FIX_Client
    AppCore -->|FIX messages| FIX_Client
    FIX_Client -->|TCP FIX| ROFEX
    ROFEX -->|FIX responses| FIX_Client
    WS_Server -->|broadcast FIX updates| Clients

    WS_Server -.->|logs| Logger
    WS_Test -.->|logs| Logger
    WS_Client -.->|logs| Logger
    FIX_Client -.->|logs| Logger
    AppCore -.->|logs| Logger
    ConfigLoader -.->|logs| Logger

    click WS_Server "https://github.com/matiasdamelio/rofex_fix/blob/master/Main/WebSocket/BroadcasterWebsocketServer.py"
    click WS_Test "https://github.com/matiasdamelio/rofex_fix/blob/master/Main/WebSocket/test_socket.py"
    click FIX_Client "https://github.com/matiasdamelio/rofex_fix/blob/master/Main/client.py"
    click WS_Client "https://github.com/matiasdamelio/rofex_fix/blob/master/Main/socket_client.py"
    click AppCore "https://github.com/matiasdamelio/rofex_fix/blob/master/Main/application.py"
    click ConfigLoader "https://github.com/matiasdamelio/rofex_fix/blob/master/conf/rofex.cfg"
    click Spec1 "https://github.com/matiasdamelio/rofex_fix/blob/master/conf/spec/FIX50SP2.xml"
    click Spec2 "https://github.com/matiasdamelio/rofex_fix/blob/master/conf/spec/FIX50SP2_rofex.xml"
    click Spec3 "https://github.com/matiasdamelio/rofex_fix/blob/master/conf/spec/FIXT11.xml"

    classDef networking fill:#ADD8E6,stroke:#000,color:#000;
    classDef configuration fill:#90EE90,stroke:#000,color:#000;
    classDef core fill:#FFA500,stroke:#000,color:#000;
    classDef external fill:#D3D3D3,stroke:#000,color:#000;
    classDef logging fill:#D3D3D3,stroke:#000,color:#000;
```
