# open-argumentation/sadface architecture

> Architecture diagram of the GitHub repository open-argumentation/sadface, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-argumentation/sadface
- Repository: https://github.com/open-argumentation/sadface

## Overview

##### Main Components

a) Core Components:
- Document Parser/Generator (JSON handling)
- Argument Model Components
- Atom Nodes Handler
- Scheme Nodes Handler
- Edge Manager
- Validation System
- Export System (DOT format)

b) Tool Integration Components:
- Python Implementation
- Web Visualization Tools
- REPL Interface

**Top Level:**

- Web Viz      |    |    Python     |
- (examples/     |    |     Tools     |
- webviz)      |    | (tools/python)|

- ↓                    ↓

- SADFace Core            |
- (JSON Document Processing)      |

- ↓                    ↓

- Validation   |    |    Export     |
- System      |    |    System     |

##### Detailed Component Breakdown

a) Document Processing:

- SADFace Document |
- Metadata     |
- Nodes        |
- Edges        |
- Resources    |

b) Node Types:

- Atom Nodes  | ←→  |   Scheme   |
- (Claims)   |     |   Nodes    |

##### Implementation Details

- Relationship between the Python implementation (/tools/python/sadface/) and the web visualization component (/examples/webviz/)
- Configuration system (config.py)
- Validation flow (validation.py)
- REPL interface integration (repl.py)

##### Data Flow Indicators

- JSON document input/output
- Transformation to DOT format
- Validation checks
- Visualization rendering

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Core Components]:::core
        L2[Web Tools]:::web
        L3[Validation Components]:::validation
        L4[Export Components]:::export
        L5[Testing Components]:::testing
        L6[Configuration]:::config
    end

    subgraph "Web Layer"
        WebViz["Web Visualization"]:::web
        VizJS["Visualization Engine"]:::web
        ArgsJS["Argument Handler"]:::web
        RenderJS["Rendering System"]:::web
    end

    subgraph "Core Processing"
        DocParser["Document Parser/Generator"]:::core
        AtomNodes["Atom Nodes Handler"]:::core
        SchemeNodes["Scheme Nodes Handler"]:::core
        EdgeManager["Edge Manager"]:::core
    end

    subgraph "Implementation Layer"
        PythonImpl["Python Implementation"]:::core
        REPLInterface["REPL Interface"]:::core
        ConfigSystem["Configuration System"]:::config
    end

    subgraph "Validation & Export"
        ValidationSystem["Validation System"]:::validation
        ExportSystem["Export System"]:::export
        DOTExport["DOT Export"]:::export
        PDFExport["PDF Export"]:::export
    end

    subgraph "Testing Framework"
        CoreTests["Core Testing"]:::testing
        ValidTests["Validation Testing"]:::testing
        ConfigTests["Configuration Testing"]:::testing
    end

    WebViz --> VizJS
    WebViz --> ArgsJS
    WebViz --> RenderJS
    
    DocParser --> AtomNodes
    DocParser --> SchemeNodes
    AtomNodes <--> SchemeNodes
    SchemeNodes --> EdgeManager
    
    PythonImpl --> DocParser
    PythonImpl --> REPLInterface
    PythonImpl --> ConfigSystem
    
    DocParser --> ValidationSystem
    DocParser --> ExportSystem
    ExportSystem --> DOTExport
    ExportSystem --> PDFExport
    
    ValidationSystem --> CoreTests
    ConfigSystem --> ConfigTests
    ValidationSystem --> ValidTests

    %% Click Events
    click DocParser "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/sadface/sadface.py"
    click ValidationSystem "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/sadface/validation.py"
    click ConfigSystem "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/sadface/config.py"
    click REPLInterface "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/sadface/repl.py"
    click WebViz "https://github.com/Open-Argumentation/SADFace/tree/master/examples/webviz/"
    click VizJS "https://github.com/Open-Argumentation/SADFace/blob/master/examples/webviz/viz.js"
    click ArgsJS "https://github.com/Open-Argumentation/SADFace/blob/master/examples/webviz/args.js"
    click RenderJS "https://github.com/Open-Argumentation/SADFace/blob/master/examples/webviz/full.render.js"
    click PythonImpl "https://github.com/Open-Argumentation/SADFace/tree/master/tools/python/sadface/"
    click DOTExport "https://github.com/Open-Argumentation/SADFace/blob/master/examples/hangback/data.dot"
    click PDFExport "https://github.com/Open-Argumentation/SADFace/blob/master/examples/hangback/data.pdf"
    click CoreTests "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/tests/core_test.py"
    click ValidTests "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/tests/validation_test.py"
    click ConfigTests "https://github.com/Open-Argumentation/SADFace/blob/master/tools/python/tests/config_test.py"

    classDef core fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef web fill:#c9a8ff,stroke:#333,stroke-width:2px
    classDef validation fill:#ffd1a8,stroke:#333,stroke-width:2px
    classDef export fill:#a8ffd1,stroke:#333,stroke-width:2px
    classDef testing fill:#ffa8a8,stroke:#333,stroke-width:2px
    classDef config fill:#fff3a8,stroke:#333,stroke-width:2px
```
