# aryamundra/veriwise architecture

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

- Interactive diagram: https://gitdiagram.com/aryamundra/veriwise
- Repository: https://github.com/aryamundra/veriwise

## Overview

##### Project type and purpose
- VeriWise is a full-stack web application for detecting manipulated media (DeepFakes) and verifying textual claims.
- The README confirms it uses Next.js for the frontend and FastAPI-based Python services for backend AI modules (DeepFake detection, fact-checking, multimodal preprocessing).

##### File structure
- Top level splits cleanly into `frontend/` and `backend/`.
- Frontend: Next.js app under `frontend/app` with React components (`.jsx`), global styles, config files (`next.config.mjs`, `jsconfig.json`).
- Backend: Python module with:
- `main.py` – FastAPI entrypoint.
- AI service scripts: `AI_Image.py`, `Deep_video.py`, `Manipulated.py`, `biasness.py`, `fact_verify.py`.
- `factcheck/` package: core submodules (`CheckWorthy.py`, `ClaimVerify.py`, `Decompose.py`, `QueryGenerator.py`, `Retriever/serper_retriever.py`) and utilities (`api_config.py`, `data_class.py`, `multimodal.py`, `llmclient/`, `prompt/`, etc.).
- `requirements.txt`, a log directory, test data under `DeepFake/Test_data/`.

##### README for additional insights
- Architecture block shows: Browser → Next.js → Backend API → DeepFake Service / Fact-Check Service → Multimodal Utils.
- Technology stack: Frontend (Next.js, Tailwind), Backend (FastAPI, Python), AI libs (OpenCV, PyTorch, Transformers), retrieval services (Gemini, Serper).

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client"
        Browser["Browser"]:::external
    end

    subgraph "Frontend (Next.js)" 
        Page["page.js"]:::frontend
        Layout["layout.js"]:::frontend
        FileUploader["FileUploader.jsx"]:::frontend
        ResultCard["ResultCard.jsx"]:::frontend
        Navbar["Navbar.jsx"]:::frontend
        Globals["globals.css"]:::frontend
        NextConfig["next.config.mjs"]:::frontend
        JSConfig["jsconfig.json"]:::frontend
        Package["package.json"]:::frontend
        UtilsLib["utils.js"]:::frontend
    end

    subgraph "Backend (FastAPI)"
        APIGateway["main.py"]:::backend

        subgraph "DeepFake Detection Service"
            AIImage["AI_Image.py"]:::service
            DeepVideo["Deep_video.py"]:::service
            Manipulated["Manipulated.py"]:::service
            Biasness["biasness.py"]:::service
            TestData["Test_data"]:::data
        end

        subgraph "Fact-Check Service"
            FactVerify["fact_verify.py"]:::service
            subgraph "Core Modules"
                CheckWorthy["CheckWorthy.py"]:::service
                ClaimVerify["ClaimVerify.py"]:::service
                Decompose["Decompose.py"]:::service
                QueryGenerator["QueryGenerator.py"]:::service
                SerperRetriever["serper_retriever.py"]:::service
            end
        end

        subgraph "Utilities"
            Multimodal["multimodal.py"]:::utils
            GeminiClient["gemini.py"]:::utils
            BaseLLMClient["base.py"]:::utils
            APIConfig["api_config.py"]:::utils
            Prompt["gemini_prompt.py"]:::utils
            RateLimiter["rate_limiter.py"]:::utils
            LoggerUtil["logger.py"]:::utils
            DataClass["data_class.py"]:::utils
            WebUtil["web_util.py"]:::utils
        end

        Logs["log/"]:::data
    end

    subgraph "External Services"
        GeminiAPI["Gemini API"]:::external
        SerperSearch["Serper Retriever API"]:::external
    end

    Browser -->|uses| Page
    Page -->|renders| Layout
    Layout -->|includes| FileUploader
    Layout -->|includes| ResultCard
    Layout -->|includes| Navbar
    Page -->|imports| Globals
    Page -->|imports| NextConfig
    Page -->|imports| JSConfig
    Page -->|imports| Package
    Page -->|imports| UtilsLib

    Page -->|calls| APIGateway
    APIGateway -->|routes to| AIImage
    APIGateway --> DeepVideo
    APIGateway --> Manipulated
    APIGateway --> Biasness
    APIGateway --> FactVerify

    AIImage --> TestData
    DeepVideo --> TestData
    Manipulated --> TestData
    Biasness --> TestData

    FactVerify --> CheckWorthy
    FactVerify --> ClaimVerify
    FactVerify --> Decompose
    FactVerify --> QueryGenerator
    FactVerify --> SerperRetriever

    AIImage -->|uses| Multimodal
    DeepVideo --> Multimodal
    Manipulated --> Multimodal
    Biasness --> Multimodal
    FactVerify --> Multimodal

    ClaimVerify --> BaseLLMClient
    SerperRetriever --> BaseLLMClient
    BaseLLMClient --> GeminiAPI
    SerperRetriever --> SerperSearch

    FactVerify --> Prompt
    Prompt --> GeminiClient
    FactVerify --> APIConfig
    FactVerify --> RateLimiter
    APIGateway --> LoggerUtil
    FactVerify --> LoggerUtil
    FactVerify --> DataClass
    FactVerify --> WebUtil

    Logs -->|stores logs| APIGateway
    Logs --> FactVerify

    click Page "https://github.com/aryamundra/veriwise/blob/main/frontend/app/page.js"
    click Layout "https://github.com/aryamundra/veriwise/blob/main/frontend/app/layout.js"
    click FileUploader "https://github.com/aryamundra/veriwise/blob/main/frontend/app/components/FileUploader.jsx"
    click ResultCard "https://github.com/aryamundra/veriwise/blob/main/frontend/app/components/ResultCard.jsx"
    click Navbar "https://github.com/aryamundra/veriwise/blob/main/frontend/app/components/Navbar.jsx"
    click Globals "https://github.com/aryamundra/veriwise/blob/main/frontend/app/globals.css"
    click NextConfig "https://github.com/aryamundra/veriwise/blob/main/frontend/next.config.mjs"
    click JSConfig "https://github.com/aryamundra/veriwise/blob/main/frontend/jsconfig.json"
    click Package "https://github.com/aryamundra/veriwise/blob/main/frontend/package.json"
    click UtilsLib "https://github.com/aryamundra/veriwise/blob/main/frontend/lib/utils.js"

    click APIGateway "https://github.com/aryamundra/veriwise/blob/main/backend/main.py"
    click AIImage "https://github.com/aryamundra/veriwise/blob/main/backend/AI_Image.py"
    click DeepVideo "https://github.com/aryamundra/veriwise/blob/main/backend/Deep_video.py"
    click Manipulated "https://github.com/aryamundra/veriwise/blob/main/backend/Manipulated.py"
    click Biasness "https://github.com/aryamundra/veriwise/blob/main/backend/biasness.py"
    click TestData "https://github.com/aryamundra/veriwise/tree/main/backend/DeepFake/Test_data"

    click FactVerify "https://github.com/aryamundra/veriwise/blob/main/backend/fact_verify.py"
    click CheckWorthy "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/core/CheckWorthy.py"
    click ClaimVerify "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/core/ClaimVerify.py"
    click Decompose "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/core/Decompose.py"
    click QueryGenerator "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/core/QueryGenerator.py"
    click SerperRetriever "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/core/Retriever/serper_retriever.py"

    click Multimodal "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/multimodal.py"
    click GeminiClient "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/llmclient/gemini.py"
    click BaseLLMClient "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/llmclient/base.py"
    click APIConfig "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/api_config.py"
    click Prompt "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/prompt/gemini_prompt.py"
    click RateLimiter "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/rate_limiter.py"
    click LoggerUtil "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/logger.py"
    click DataClass "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/data_class.py"
    click WebUtil "https://github.com/aryamundra/veriwise/blob/main/backend/factcheck/utils/web_util.py"
    click Logs "https://github.com/aryamundra/veriwise/tree/main/backend/log"

    classDef frontend fill:#E0F7FA,stroke:#0277BD,color:#01579B
    classDef backend fill:#E8F5E9,stroke:#2E7D32,color:#1B5E20
    classDef service fill:#FFF3E0,stroke:#F57C00,color:#E65100
    classDef utils fill:#ECEFF1,stroke:#546E7A,color:#37474F
    classDef external fill:#F3E5F5,stroke:#8E24AA,color:#6A1B9A
    classDef data fill:#CFD8DC,stroke:#455A64,color:#263238
```
