# infomics/mdr-ra-opal-datashield-documentation architecture

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

- Interactive diagram: https://gitdiagram.com/infomics/mdr-ra-opal-datashield-documentation
- Repository: https://github.com/infomics/mdr-ra-opal-datashield-documentation

## Overview

##### Project Type and Purpose
This is a deployment configuration project for a federated data analysis system (Opal-DataSHIELD) specifically tailored for the MDR-RA project. The system enables secure, privacy-preserving analysis of distributed data across multiple partners.

##### Main Components

A. Infrastructure Layer:
- Docker Container Environment
- Traefik Reverse Proxy (for SSL termination and routing)
- SSL/TLS Certificate Management

B. Core Services:
- Opal Server
- R Server (ROCK)
- DataSHIELD Analysis Engine

C. Security Components:
- Two-Factor Authentication (2FA)
- Permission Management System
- SSL/TLS Encryption

D. Data Management:
- Project Storage
- File System
- Table Management

**┌─ Client Layer ─────────────────────────┐**
- Web Browsers                         │
- R Clients                           │
- ┬─────────────────────────┘
- (HTTPS)
**┌─ Gateway Layer ────────────────────────┐**
- Traefik Reverse Proxy               │
- SSL/TLS Termination                 │
- ┬─────────────────────────┘

**┌─ Application Layer ───────────────────┐**
- ┌─ Security ─┐  ┌─ Core Services ─┐  │
- 2FA      │  │ - Opal Server   │  │
- Auth     │  │ - ROCK (R)      │  │
- ┘  │ - DataSHIELD    │  │
- ┘  │
- ┬────────────────────────┘

**┌─ Data Layer ──────────────────────────┐**
- Project Storage                     │
- File System                         │
- Tables                             │
- ┘

##### Key Elements to Highlight

- Blue: Core services
- Green: Security components
- Orange: Data management
- Gray: Infrastructure components

- Client → Traefik → Opal Server
- Opal Server ↔ R Server
- Opal Server ↔ Data Storage

c. Security boundaries:
- SSL/TLS encryption points
- Authentication checkpoints

##### Implementation Notes

- Clear labels and annotations
- Maintain proper spacing and alignment
- Version numbers where relevant

##### Documentation Integration

- A brief overview of each component
- Configuration requirements
- Security considerations
- Deployment prerequisites
- Scaling capabilities

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph CL["Client Layer"]
        WB["Web Browsers"]
        RC["R Clients"]
    end

    %% Gateway Layer
    subgraph GL["Gateway Layer"]
        TR["Traefik Reverse Proxy"]:::infra
        SSL["SSL/TLS Termination"]:::security
    end
    click TR "https://github.com/InfOmics/MDR-RA-Opal-DataSHIELD-documentation/blob/main/traefik.yml"

    %% Application Layer
    subgraph AL["Application Layer"]
        subgraph SEC["Security Components"]
            TFA["Two-Factor Authentication"]:::security
            AUTH["Permission Management"]:::security
        end

        subgraph CS["Core Services"]
            OS["Opal Server"]:::core
            RS["R Server (ROCK)"]:::core
            DS["DataSHIELD Engine"]:::core
        end
    end

    %% Data Layer
    subgraph DL["Data Layer"]
        PS["Project Storage"]:::data
        FS["File System"]:::data
        TM["Table Management"]:::data
    end

    %% Docker Environment
    subgraph DE["Docker Environment"]
        DC["Container Orchestration"]:::infra
    end
    click DC "https://github.com/InfOmics/MDR-RA-Opal-DataSHIELD-documentation/blob/main/docker-compose.yml"

    %% Documentation
    subgraph DOC["Documentation"]
        AT["Advanced Topics"]:::doc
        TUT["User Tutorial"]:::doc
        SETUP["System Setup"]:::doc
    end
    click AT "https://github.com/InfOmics/MDR-RA-Opal-DataSHIELD-documentation/blob/main/docs/AdvancedTopics.md"
    click TUT "https://github.com/InfOmics/MDR-RA-Opal-DataSHIELD-documentation/blob/main/tutorial/Tutorial.md"
    click SETUP "https://github.com/InfOmics/MDR-RA-Opal-DataSHIELD-documentation/blob/main/src/setup.sh"

    %% Relationships
    WB & RC --> TR
    TR --> SSL
    SSL --> OS
    OS <--> RS
    OS <--> DS
    OS --> PS
    OS --> FS
    OS --> TM
    TFA & AUTH --> OS
    DC -.-> AL & DL

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef security fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef doc fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["Core Services"]:::core
        L2["Security Components"]:::security
        L3["Data Components"]:::data
        L4["Infrastructure"]:::infra
        L5["Documentation"]:::doc
    end
```
