# graphlit/graphlit-samples architecture

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

- Interactive diagram: https://gitdiagram.com/graphlit/graphlit-samples
- Repository: https://github.com/graphlit/graphlit-samples

## Overview

##### High-Level Architecture Overview
The system can be divided into three main technology stacks:

a. .NET Applications
- GraphlitIngest
- SimpleChatExample

b. Next.js Web Applications
- Multiple chat and extraction applications
- File and web processing capabilities

c. Python Applications
- Streamlit-based multipage applications
- Notebook examples
- Integration examples (Slack bot)

##### Main Components

Core Components:
##### Frontend Layer
- Next.js Applications (chat, file-extraction, web-extraction)
- Streamlit Applications (multiple specialized UIs)

##### Backend Services
- .NET Services (GraphlitIngest)
- Python Services (various data processing modules)

##### Integration Components
- External Services Integration (Slack, OneDrive, SharePoint)
- Data Processing Pipelines

##### Data Sources
- File Systems
- Blob Storage
- External APIs
- Knowledge Graphs

**[User Interfaces]**

- Next.js Apps
- Chat Applications
- Extraction Tools
- Web Processing

- Streamlit Apps
- PDF Processing
- Knowledge Graphs
- Media Processing

**[Backend Services]**

- .NET Services
- GraphlitIngest
- Chat Examples

- Python Services
- Data Processing
- Graph Generation
- Integration Handlers

**[External Integrations]**

- Cloud Services
- Azure Blob
- SharePoint
- OneDrive

- Communication
- Slack
- Other APIs

##### Additional Details

Important aspects:
- Data flow directions between components
- API endpoints and communication protocols
- Integration points with external services
- Processing pipelines for different data types
- Knowledge graph generation and usage flows

##### Notes for Implementation

- The modular nature of the applications
- Clear separation between different technology stacks
- Integration points with the Graphlit Platform
- Data processing flows
- User interaction paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        direction TB
        subgraph NextApps["Next.js Applications"]
            direction TB
            Chat["Chat Interface"]:::nextjs
            FileExt["File Extraction"]:::nextjs
            WebExt["Web Extraction"]:::nextjs
            GraphChat["Graph-based Chat"]:::nextjs
        end

        subgraph StreamApps["Streamlit Applications"]
            direction TB
            PDFProc["PDF Processing"]:::streamlit
            KGraphUI["Knowledge Graph UI"]:::streamlit
            WebProc["Web Processing"]:::streamlit
            PodcastProc["Podcast Processing"]:::streamlit
        end
    end

    subgraph BE["Backend Services"]
        direction TB
        subgraph DotNet[".NET Services"]
            direction TB
            Ingest["GraphlitIngest"]:::dotnet
            SimpleChat["Simple Chat"]:::dotnet
        end

        subgraph PyServices["Python Services"]
            direction TB
            DataProc["Data Processing"]:::python
            GraphGen["Graph Generation"]:::python
            IntHandler["Integration Handlers"]:::python
        end
    end

    subgraph EXT["External Integrations"]
        direction TB
        subgraph Cloud["Cloud Services"]
            direction TB
            Blob[("Azure Blob")]:::external
            SharePoint["SharePoint"]:::external
            OneDrive["OneDrive"]:::external
        end

        subgraph Comm["Communication"]
            direction TB
            Slack["Slack Bot"]:::external
            ExtAPI["External APIs"]:::external
        end
    end

    %% Connections
    Chat --> DataProc
    FileExt --> DataProc
    WebExt --> DataProc
    GraphChat --> GraphGen
    
    PDFProc --> IntHandler
    KGraphUI --> GraphGen
    WebProc --> IntHandler
    PodcastProc --> DataProc
    
    IntHandler --> Cloud
    IntHandler --> Comm
    
    Ingest --> DataProc
    SimpleChat --> DataProc
    
    %% Click Events
    click Chat "https://github.com/graphlit/graphlit-samples/tree/main/nextjs/chat/"
    click FileExt "https://github.com/graphlit/graphlit-samples/tree/main/nextjs/file-extraction/"
    click WebExt "https://github.com/graphlit/graphlit-samples/tree/main/nextjs/web-extraction/"
    click GraphChat "https://github.com/graphlit/graphlit-samples/tree/main/nextjs/chat-graph/"
    click Ingest "https://github.com/graphlit/graphlit-samples/tree/main/dotnet/GraphlitIngest/"
    click SimpleChat "https://github.com/graphlit/graphlit-samples/tree/main/dotnet/SimpleChatExample/"
    click PDFProc "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-extract-pdf/"
    click KGraphUI "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-files-graph/"
    click WebProc "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-web-graph/"
    click PodcastProc "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-podcast-graph/"
    click Slack "https://github.com/graphlit/graphlit-samples/tree/main/python/slack-bot/"
    click OneDrive "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-onedrive-graph/"
    click SharePoint "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-sharepoint-graph/"
    click DataProc "https://github.com/graphlit/graphlit-samples/tree/main/python/Notebook Examples/"
    click GraphGen "https://github.com/graphlit/graphlit-samples/tree/main/python/streamlit-multipage-files-graph/"

    %% Styles
    classDef nextjs fill:#3498db,stroke:#2980b9,color:white
    classDef streamlit fill:#2ecc71,stroke:#27ae60,color:white
    classDef dotnet fill:#9b59b6,stroke:#8e44ad,color:white
    classDef python fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        direction TB
        N["Next.js"]:::nextjs
        S["Streamlit"]:::streamlit
        D[".NET"]:::dotnet
        P["Python"]:::python
        E["External"]:::external
    end
```
