# arghyadipchak/research-radar architecture

> Architecture diagram of the GitHub repository arghyadipchak/research-radar, 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/arghyadipchak/research-radar
- Repository: https://github.com/arghyadipchak/research-radar

## Overview

##### Main Components Identification

The project consists of three major components:
- Frontend (Svelte-based web application)
- Scrapper (Python-based data collection service)
- External Services (Ollama and Meilisearch instances)

##### Detailed Component Breakdown

Frontend Section:
- UI Layer (Svelte Components)
- App.svelte (Main Application)
- Chart.svelte (Data Visualization)
- Service Layer
- meili.ts (Search Service)
- ollama.ts (AI Processing)
- pdf.ts (Document Handling)

Scrapper Section:
- Data Collection
- scrapper.py
- update_db.py
- Security
- create_key.py

##### Implementation Details

A. Technology Stack (Add as labels):
- Frontend: Svelte, TypeScript, Tailwind CSS
- Scrapper: Python
- Search: Meilisearch
- AI Processing: Ollama

B. Key Interactions:
- Use different line styles for different types of interactions
- API calls and data processing flows

##### Storage/Processing Layer (Middle)
- Meilisearch
- Ollama

##### Specific Elements to Highlight

- Search functionality flow
- Document processing pipeline
- Data synchronization between scrapper and database
- Frontend state management
- API integration points

Remember to include:
- System boundaries
- External dependencies
- Security touchpoints
- Data transformation points
- Error handling paths

This will provide a comprehensive view of the Research Radar system while maintaining technical accuracy and usefulness for development and maintenance purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef scrapper fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#9b59b6,stroke:#8e44ad,color:white
    classDef ai fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef service fill:#1abc9c,stroke:#16a085,color:white

    %% External Data Sources
    subgraph ExternalSources["External Data Sources"]
        ExtData1["Research Data"]:::external
        ExtData2["Academic Papers"]:::external
    end

    %% Scrapper Layer
    subgraph ScrapperLayer["Scrapper Layer"]
        Scrapper["Data Collection Service"]:::scrapper
        UpdateDB["Database Update Service"]:::scrapper
        KeyGen["Key Generation Service"]:::scrapper
    end

    %% Storage/Processing Layer
    subgraph StorageLayer["Storage & Processing Layer"]
        Meilisearch[(Meilisearch DB)]:::database
        Ollama{"Ollama AI Instance"}:::ai
    end

    %% Frontend Layer
    subgraph FrontendLayer["Frontend Layer"]
        App["Main Application"]:::frontend
        Chart["Chart Visualization"]:::frontend
        
        subgraph Services["Service Layer"]
            MeiliService["Search Service"]:::service
            OllamaService["AI Processing Service"]:::service
            PDFService["PDF Handler"]:::service
        end
    end

    %% Relationships
    ExtData1 --> Scrapper
    ExtData2 --> Scrapper
    Scrapper --> UpdateDB
    UpdateDB --> Meilisearch
    KeyGen --> Meilisearch

    MeiliService --> Meilisearch
    OllamaService --> Ollama
    
    App --> MeiliService
    App --> OllamaService
    App --> PDFService
    App --> Chart

    %% Click Events
    click App "https://github.com/arghyadipchak/research-radar/blob/main/frontend/src/App.svelte"
    click Chart "https://github.com/arghyadipchak/research-radar/blob/main/frontend/src/lib/Chart.svelte"
    click MeiliService "https://github.com/arghyadipchak/research-radar/blob/main/frontend/src/lib/meili.ts"
    click OllamaService "https://github.com/arghyadipchak/research-radar/blob/main/frontend/src/lib/ollama.ts"
    click PDFService "https://github.com/arghyadipchak/research-radar/blob/main/frontend/src/lib/pdf.ts"
    click Scrapper "https://github.com/arghyadipchak/research-radar/blob/main/scrapper/scrapper.py"
    click UpdateDB "https://github.com/arghyadipchak/research-radar/blob/main/scrapper/update_db.py"
    click KeyGen "https://github.com/arghyadipchak/research-radar/blob/main/scrapper/create_key.py"
```
