# ukaea/uda architecture

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

- Interactive diagram: https://gitdiagram.com/ukaea/uda
- Repository: https://github.com/ukaea/uda

## Overview

##### Main Components

a. Core Components:
- UDA Client (both thin and fat client options)
- UDA Server
- Plugin System
- Authentication/Security Layer
- Cache System
- Data Access Layer

b. External Interfaces:
- Various Client Wrappers (Python, C++, Java, IDL, MATLAB, etc.)
- Plugin Interfaces
- External Data Sources

##### Architectural Patterns to Highlight

- Client-Server Architecture
- Plugin Architecture
- Multi-protocol Support (XDR, CapnProto)
- Caching Strategy
- Security Layer

**[Client Applications Layer]**

**[Client Wrappers Layer]**

**[Core Client Layer]**

**[Security/Authentication Layer]**

**[Network Layer]**

**[Server Layer]**

**[Plugin System Layer]**

**[Data Sources Layer]**

##### Component Details

Client Side:
**[Client Applications]**
- ↓
**[Language Wrappers]**
- Python (pyuda)
- C++
- Java
- IDL
- MATLAB
- PHP
- REST
- ↓
**[Client Core]**
- Client API
- XDR Stream
- Connection Management
- Error Handling

Server Side:
**[Server Core]**
- Request Processing
- Plugin Management
- Data Management
- Protocol Handling
- ↓
**[Plugin System]**
- Plugin Registry
- Plugin Loader
- Standard Plugins (HDF5, etc.)
- ↓
**[Data Access]**
- Data Source Connectors
- Cache Management
- Data Transformation

##### Connection Lines

- Double lines: API boundaries

##### Additional Elements

Supporting components:
- SSL/Authentication mechanisms
- Cache system (memcached)
- Configuration management
- Logging system
- Error handling

##### Implementation Notes

- Maintain proper spacing between components
- Related components visually
- Version information
- Build/deployment notes

- The plugin-driven architecture
- Flexibility in client deployment (thin/fat)
- Security integration
- Multiple language support
- Data abstraction capabilities

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef client fill:#90EE90
    classDef core fill:#87CEEB
    classDef security fill:#FFB6C6
    classDef plugin fill:#FFE4B5
    classDef cache fill:#FFA500
    classDef data fill:#DDA0DD
    classDef wrapper fill:#98FB98
    classDef logging fill:#A9A9A9

    %% Client Applications Layer
    subgraph ClientApps
        APP1[Client Applications]
        APP2[External Tools]
    end

    %% Client Wrappers Layer
    subgraph Wrappers
        PY[Python Wrapper]:::wrapper
        CPP[C++ Wrapper]:::wrapper
        JAVA[Java Wrapper]:::wrapper
        IDL[IDL Wrapper]:::wrapper
        MAT[MATLAB Wrapper]:::wrapper
        PHP[PHP Wrapper]:::wrapper
        REST[REST Wrapper]:::wrapper
    end

    %% Core Client Layer
    subgraph CoreClient
        CCAPI[Client API]:::core
        XDR[XDR Stream]:::core
        CONN[Connection Manager]:::core
        ERR[Error Handler]:::core
    end

    %% Security Layer
    subgraph Security
        AUTH[Authentication]:::security
        SSL[SSL/TLS]:::security
        CERT[Certificates]:::security
    end

    %% Server Layer
    subgraph Server
        SCORE[Server Core]:::core
        REQP[Request Processor]:::core
        PMAN[Plugin Manager]:::core
        DMAN[Data Manager]:::core
    end

    %% Cache System
    subgraph CacheSystem
        MCACHE[Memcached]:::cache
        FCACHE[File Cache]:::cache
    end

    %% Plugin System
    subgraph Plugins
        PREG[Plugin Registry]:::plugin
        PLOAD[Plugin Loader]:::plugin
        STDP[Standard Plugins]:::plugin
    end

    %% Data Sources Layer
    subgraph DataSources
        HDF5[HDF5]:::data
        DB[Databases]:::data
        FILES[File Systems]:::data
    end

    %% Logging System
    subgraph Logging
        ALOG[Access Log]:::logging
        SLOG[System Log]:::logging
    end

    %% Connections
    ClientApps --> Wrappers
    Wrappers --> CoreClient
    CoreClient --> Security
    Security --> Server
    Server --> Plugins
    Server --> CacheSystem
    Plugins --> DataSources
    Server --> Logging

    %% Click Events
    click PY "https://github.com/ukaea/UDA/tree/main//source/wrappers/python/"
    click CPP "https://github.com/ukaea/UDA/tree/main//source/wrappers/c++/"
    click JAVA "https://github.com/ukaea/UDA/tree/main//source/wrappers/java/"
    click IDL "https://github.com/ukaea/UDA/tree/main//source/wrappers/idl/"
    click MAT "https://github.com/ukaea/UDA/tree/main//source/wrappers/matlab/"
    click PHP "https://github.com/ukaea/UDA/tree/main//source/wrappers/PHP/"
    click REST "https://github.com/ukaea/UDA/tree/main//source/wrappers/REST/"
    click CCAPI "https://github.com/ukaea/UDA/tree/main//source/client/"
    click SCORE "https://github.com/ukaea/UDA/tree/main//source/server/"
    click PREG "https://github.com/ukaea/UDA/tree/main//source/plugins/"
    click AUTH "https://github.com/ukaea/UDA/tree/main//source/authentication/"
    click MCACHE "https://github.com/ukaea/UDA/blob/main//source/cache/memcache.hpp"
    click FCACHE "https://github.com/ukaea/UDA/blob/main//source/cache/fileCache.h"
    click XDR "https://github.com/ukaea/UDA/blob/main//source/clientserver/xdrlib.h"
    click ALOG "https://github.com/ukaea/UDA/blob/main//source/logging/accessLog.h"
    click SLOG "https://github.com/ukaea/UDA/blob/main//source/logging/logging.h"

    %% Legend
    subgraph Legend
        L1[Client Components]:::client
        L2[Core Components]:::core
        L3[Security Components]:::security
        L4[Plugin Components]:::plugin
        L5[Cache Components]:::cache
        L6[Data Components]:::data
        L7[Wrapper Components]:::wrapper
        L8[Logging Components]:::logging
    end
```
