# kedro-org/kedro-viz architecture

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

- Interactive diagram: https://gitdiagram.com/kedro-org/kedro-viz
- Repository: https://github.com/kedro-org/kedro-viz

## Overview

##### Main Components

a) Frontend Layer:
- React Application Components (/src/components)
- State Management (Redux store - /src/store)
- GraphQL Client (Apollo - /src/apollo)
- UI Components (/src/components/ui)
- Visualization Components (Flowchart, Minimap)

b) Backend Layer:
- API Layer (/package/kedro_viz/api)
- GraphQL API (/api/graphql)
- REST API (/api/rest)
- Data Access Layer (/package/kedro_viz/data_access)
- Integration Layer (/package/kedro_viz/integrations)
- Server Component (/package/kedro_viz/server.py)

c) Storage:
- SQLite Database (for session storage)
- File System (for data persistence)

##### Component Relationships

- Frontend to Backend communication via GraphQL/REST APIs
- Data flow between Data Access Layer and Storage
- Integration points with Kedro projects
- State management flow in the frontend

##### Specific Implementation Details

Frontend Section:
**[React Components] → [Redux Store] → [Apollo Client]**
- ↓                 ↑            ↓
**[UI Components]   [State Management]   [GraphQL/REST APIs]**

Backend Section:
**[GraphQL/REST APIs] → [Data Access Layer] → [Repositories]**
- ↓                    ↓                  ↓
**[Server Component] → [Integration Layer] → [Storage Layer]**

##### Additional Elements

Include:
- Deployment options (AWS, Azure, GCP)
- Authentication flow (if applicable)
- Data processing pipeline visualization
- Experiment tracking components
- Modular pipeline structure

**[Frontend Layer]**
- ↓
**[API Layer]**
- ↓
**[Backend Layer]**
- ↓
**[Storage Layer]**

##### Notes for Implementation

- Version compatibility information
- Scaling points and extensibility options
- Security boundaries
- Public vs. private interfaces

- The separation between frontend and backend
- The role of GraphQL/REST APIs in communication
- Data flow through the system
- Integration points with Kedro projects
- Visualization capabilities and data processing

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black
    classDef api fill:#e67e22,stroke:#d35400,color:white
    classDef integration fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        RC["React Components"]:::frontend
        SM["State Management"]:::frontend
        GC["GraphQL Client"]:::frontend
        UI["UI Components"]:::frontend
        VC["Visualization Components"]:::frontend
        
        %% State Management Details
        SA["State Actions"]:::frontend
        SR["State Reducers"]:::frontend
        SS["State Selectors"]:::frontend
    end

    %% Backend Layer
    subgraph Backend
        API["API Layer"]:::backend
        DAL["Data Access Layer"]:::backend
        IL["Integration Layer"]:::backend
        SC["Server Component"]:::backend
        ML["Models Layer"]:::backend
        
        %% API Components
        GAPI["GraphQL API"]:::api
        RAPI["REST API"]:::api
        
        %% Integration Components
        DI["Deployment Integration"]:::integration
        KI["Kedro Integration"]:::integration
        CLI["CLI Interface"]:::integration
    end

    %% Storage Layer
    subgraph Storage
        DB["SQLite Database"]:::storage
        FS["File System"]:::storage
    end

    %% Relationships
    RC --> SM
    RC --> UI
    RC --> VC
    SM --> SA
    SM --> SR
    SM --> SS
    GC --> GAPI
    GC --> RAPI
    
    GAPI --> DAL
    RAPI --> DAL
    DAL --> ML
    ML --> DB
    ML --> FS
    
    IL --> DI
    IL --> KI
    IL --> CLI
    
    SC --> IL
    SC --> DAL

    %% Click Events
    click RC "https://github.com/kedro-org/kedro-viz/tree/main/src/components/"
    click SM "https://github.com/kedro-org/kedro-viz/tree/main/src/store/"
    click GC "https://github.com/kedro-org/kedro-viz/tree/main/src/apollo/"
    click UI "https://github.com/kedro-org/kedro-viz/tree/main/src/components/ui/"
    click VC "https://github.com/kedro-org/kedro-viz/tree/main/src/components/flowchart/"
    click GAPI "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/api/graphql/"
    click RAPI "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/api/rest/"
    click DAL "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/data_access/"
    click IL "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/integrations/"
    click SC "https://github.com/kedro-org/kedro-viz/blob/main/package/kedro_viz/server.py"
    click DB "https://github.com/kedro-org/kedro-viz/blob/main/package/kedro_viz/database.py"
    click SA "https://github.com/kedro-org/kedro-viz/tree/main/src/actions/"
    click SR "https://github.com/kedro-org/kedro-viz/tree/main/src/reducers/"
    click SS "https://github.com/kedro-org/kedro-viz/tree/main/src/selectors/"
    click DI "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/integrations/deployment/"
    click KI "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/integrations/kedro/"
    click CLI "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/launchers/cli/"
    click ML "https://github.com/kedro-org/kedro-viz/tree/main/package/kedro_viz/models/"

    %% Legend
    subgraph Legend
        F["Frontend Component"]:::frontend
        B["Backend Component"]:::backend
        S["Storage Component"]:::storage
        A["API Component"]:::api
        I["Integration Component"]:::integration
    end
```
