# aiidateam/aiida-explorer architecture

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

- Interactive diagram: https://gitdiagram.com/aiidateam/aiida-explorer
- Repository: https://github.com/aiidateam/aiida-explorer

## Overview

##### Core Component Breakdown
The AiiDA Explorer component should be represented with these major subsystems:

a) Main Components (Primary Containers):
- NodeGrid System
- ProvenanceBrowser System
- NodeDetails System
- Statistics System

b) Supporting Components:
- Error Boundary
- Fetch Data Handler
- Helper Utilities

##### Data Flow Representation

- Data flow between the consuming application and the AiiDA Explorer component
- Internal component communication
- API calls to the AiiDA REST API

##### Specific Component Details

NodeGrid System:
- ComputersGrid
- FilterSidebar
- NodeTable

ProvenanceBrowser System:
- GraphBrowser
- CustomNode/Edge components
- BreadCrumb
- Tooltip

NodeDetails System:
- Attributes
- Files
- MetaData
- ComponentVisualizer
- BrowserSelection

##### Technical Stack Indicators

- React
- React Router
- NPM Package
- Tailwind CSS
- Vite

**[Client Application]**
- ↓
**[AiiDA Explorer Component]**
- ↙     ↓     ↘
**[NodeGrid] [Provenance] [Details]**
- ↓
**[AiiDA REST API]**

Important Considerations:

##### Component state management flow

Additional Elements:

##### Integration points with external applications

Remember to indicate that this is a library component that needs to be wrapped in a Routes object from react-router-dom, as this is a critical implementation detail mentioned in the README.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Application Layer"]
        App[Client Application]
    end

    subgraph Explorer["AiiDA Explorer Component Layer"]
        MainComponent["AiiDA Explorer"]
        ErrorBoundary["Error Boundary"]:::error
        FetchHandler["Fetch Data Handler"]:::util
        Helpers["Helper Utilities"]:::util
        
        subgraph NodeGridSystem["Node Grid System"]
            ComputersGrid["Computers Grid"]:::ui
            FilterSidebar["Filter Sidebar"]:::ui
            NodeTable["Node Table"]:::ui
        end
        
        subgraph ProvenanceSystem["Provenance Browser System"]
            GraphBrowser["Graph Browser"]:::ui
            CustomNode["Custom Node"]:::ui
            CustomEdge["Custom Edge"]:::ui
            BreadCrumb["Bread Crumb"]:::ui
            Legend["Legend"]:::ui
            Tooltip["Tooltip"]:::ui
        end
        
        subgraph DetailsSystem["Node Details System"]
            Attributes["Attributes"]:::ui
            Files["Files"]:::ui
            MetaData["Meta Data"]:::ui
            ComponentVisualizer["Component Visualizer"]:::ui
            BrowserSelection["Browser Selection"]:::ui
        end
        
        subgraph StatsSystem["Statistics System"]
            Statistics["Statistics"]:::ui
            Search["Search"]:::ui
        end
    end

    subgraph Backend["Backend Integration Layer"]
        REST["AiiDA REST API"]:::api
    end

    %% Connections
    App --> MainComponent
    MainComponent --> ErrorBoundary
    MainComponent --> FetchHandler
    MainComponent --> Helpers
    
    MainComponent --> NodeGridSystem
    MainComponent --> ProvenanceSystem
    MainComponent --> DetailsSystem
    MainComponent --> StatsSystem
    
    FetchHandler --> REST
    
    %% Click events
    click NodeGridSystem "https://github.com/aiidateam/aiida-explorer/tree/main/src/AiidaExplorer/NodeGrid/"
    click ComputersGrid "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeGrid/ComputersGrid.jsx"
    click FilterSidebar "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeGrid/FilterSidebar.jsx"
    click NodeTable "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeGrid/NodeTable.jsx"
    
    click ProvenanceSystem "https://github.com/aiidateam/aiida-explorer/tree/main/src/AiidaExplorer/ProvenanceBrowser/"
    click GraphBrowser "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/GraphBrowser.jsx"
    click CustomNode "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/CustomNode.jsx"
    click CustomEdge "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/CustomEdge.jsx"
    click BreadCrumb "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/BreadCrumb.jsx"
    click Legend "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/Legend.jsx"
    click Tooltip "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ProvenanceBrowser/Tooltip.jsx"
    
    click DetailsSystem "https://github.com/aiidateam/aiida-explorer/tree/main/src/AiidaExplorer/NodeDetails/"
    click Attributes "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeDetails/Attributes.jsx"
    click Files "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeDetails/Files.jsx"
    click MetaData "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeDetails/MetaData.jsx"
    click ComponentVisualizer "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeDetails/ComponentVisualizer.jsx"
    click BrowserSelection "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/NodeDetails/BrowserSelection.jsx"
    
    click Statistics "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/Statistics/Statistics.jsx"
    click Search "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/Statistics/Search.jsx"
    
    click ErrorBoundary "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/ErrorBoundary.jsx"
    click FetchHandler "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/FetchPageData.js"
    click Helpers "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/helpers.jsx"
    click MainComponent "https://github.com/aiidateam/aiida-explorer/blob/main/src/AiidaExplorer/index.jsx"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef api fill:#2196F3,stroke:#333,color:white
    classDef ui fill:#FF9800,stroke:#333
    classDef error fill:#F44336,stroke:#333,color:white
    classDef util fill:#4CAF50,stroke:#333,color:white

    %% Legend
    subgraph Legend
        L1["API Component"]:::api
        L2["UI Component"]:::ui
        L3["Error Handler"]:::error
        L4["Utility Component"]:::util
    end
```
