# pragyanbhatt1213/tenderaudit architecture

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

- Interactive diagram: https://gitdiagram.com/pragyanbhatt1213/tenderaudit
- Repository: https://github.com/pragyanbhatt1213/tenderaudit

## Overview

TenderAudit turns bilingual procurement documents into structured, citation-grounded tender intelligence and bidder-qualification results. The principal workflow is upload through the web app, API job orchestration, document ingestion and analysis, then results and bidder scoring in the UI. The graph also preserves distinct retrieval, deterministic verification, QA, corrigendum, and adaptive-runtime capabilities. Relationships reflect the excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.

Main entry points: [`api/main.py`](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/api/main.py) (HTTP API), [`tender_extraction/main.py`](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/main.py) (Pipeline orchestrator), [`frontend/src/App.jsx`](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/App.jsx) (Web application), [`frontend/src/components/ResultViewer.jsx`](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ResultViewer.jsx) (Results viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["Web application<br/>[App.jsx]"]
  node_upload["Tender upload<br/>[UploadZone.jsx]"]
  node_results["Results viewer<br/>[ResultViewer.jsx]"]
  node_source["Citation viewer<br/>[SourceDrawer.jsx]"]
  node_profile["Bidder profile<br/>[ProfilePanel.jsx]"]
  node_scoreview["Qualification score<br/>[ScorePanel.jsx]"]
  node_chat["Tender Q&amp;A<br/>[ChatPanel.jsx]"]
  node_corrigendumview["Corrigendum diff"]
  node_runtimeview["Runtime selector"]
end

subgraph group_service["API and jobs"]
  node_api["HTTP API<br/>[main.py]"]
end

subgraph group_pipeline["Tender analysis"]
  node_orchestrator["Pipeline orchestrator<br/>[main.py]"]
  node_ingestion["Document ingestion<br/>[ingestion.py]"]
  node_ocr["Adaptive OCR<br/>[ocr_backends.py]"]
  node_tables["Table extraction"]
  node_chunking["Structure chunking<br/>[chunking.py]"]
  node_retrieval["Hybrid retrieval<br/>[retrieval.py]"]
  node_extraction["Schema extraction<br/>[extraction.py]"]
  node_schemas["Tender schemas<br/>[schemas.py]"]
  node_validation["Citation validation<br/>[validation.py]"]
  node_vision["Visual analysis<br/>[vision.py]"]
end

subgraph group_capabilities["Review and qualification"]
  node_normalization["Bilingual normalization<br/>[normalization.py]"]
  node_scoring["Bid qualification<br/>[scoring.py]"]
  node_qa["Question answering<br/>[qa.py]"]
  node_corrigendum["Corrigendum analysis<br/>[corrigendum.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_modelruntime["Model runtime<br/>[model_runtime.py]"]
  node_nativeruntime["Local inference<br/>[native_runtime.py]"]
end

node_user(("Tender auditor"))
node_llmprovider{{"LLM provider"}}
node_document["PDF or scan"]
node_bidder["Bidder records"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_upload
node_user -->|"submits document"| node_upload
node_upload -.->|"uploads document"| node_api
node_app -->|"requests jobs"| node_api
node_api -->|"runs pipeline"| node_orchestrator
node_document -->|"provides input"| node_ingestion
node_orchestrator -->|"ingests"| node_ingestion
node_ingestion -->|"routes OCR"| node_ocr
node_orchestrator -->|"extracts tables"| node_tables
node_orchestrator -->|"chunks content"| node_chunking
node_orchestrator -->|"retrieves context"| node_retrieval
node_orchestrator -->|"extracts fields"| node_extraction
node_orchestrator -->|"grounds results"| node_validation
node_orchestrator -->|"analyzes pages"| node_vision
node_extraction -->|"uses schema"| node_schemas
node_extraction -->|"normalizes values"| node_normalization
node_api -->|"scores bidder"| node_scoring
node_api -->|"answers questions"| node_qa
node_api -->|"compares revisions"| node_corrigendum
node_api -->|"configures runtime"| node_config
node_config -.->|"selects provider"| node_modelruntime
node_modelruntime -.->|"uses local inference"| node_nativeruntime
node_modelruntime -.->|"calls provider"| node_llmprovider
node_runtimeview -.->|"configures runtime"| node_api
node_bidder -.->|"provides profile"| node_api
node_api -.->|"returns job results"| node_app
node_app -->|"renders results"| node_results
node_results -->|"shows citations"| node_source
node_results -->|"shows qualification"| node_scoreview
node_results -->|"offers questions"| node_chat
node_results -->|"shows differences"| node_corrigendumview
node_app -->|"shows profile"| node_profile
node_profile -.->|"configures bidder"| node_api

click node_app "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/App.jsx"
click node_upload "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/UploadZone.jsx"
click node_results "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ResultViewer.jsx"
click node_source "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/SourceDrawer.jsx"
click node_profile "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ProfilePanel.jsx"
click node_scoreview "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ScorePanel.jsx"
click node_chat "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ChatPanel.jsx"
click node_corrigendumview "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/CorrigendumDiffPanel.jsx"
click node_runtimeview "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/RuntimeSelector.jsx"
click node_api "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/api/main.py"
click node_orchestrator "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/main.py"
click node_ingestion "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/ingestion.py"
click node_ocr "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/ocr_backends.py"
click node_tables "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/table_extraction.py"
click node_chunking "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/chunking.py"
click node_retrieval "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/retrieval.py"
click node_extraction "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/extraction.py"
click node_schemas "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/schemas.py"
click node_validation "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/validation.py"
click node_vision "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/vision.py"
click node_normalization "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/normalization.py"
click node_scoring "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/scoring.py"
click node_qa "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/qa.py"
click node_corrigendum "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/corrigendum.py"
click node_config "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/config.py"
click node_modelruntime "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/model_runtime.py"
click node_nativeruntime "https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/native_runtime.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_upload,node_results,node_source,node_profile,node_scoreview,node_chat,node_corrigendumview,node_runtimeview toneBlue
class node_api toneAmber
class node_orchestrator,node_ingestion,node_ocr,node_tables,node_chunking,node_retrieval,node_extraction,node_schemas,node_validation,node_vision toneMint
class node_normalization,node_scoring,node_qa,node_corrigendum,node_config,node_modelruntime,node_nativeruntime toneRose
class node_user,node_llmprovider,node_document,node_bidder toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tender upload](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/UploadZone.jsx): `frontend/src/components/UploadZone.jsx`
- [Results viewer](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ResultViewer.jsx): `frontend/src/components/ResultViewer.jsx`
- [Citation viewer](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/SourceDrawer.jsx): `frontend/src/components/SourceDrawer.jsx`
- [Bidder profile](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ProfilePanel.jsx): `frontend/src/components/ProfilePanel.jsx`
- [Qualification score](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ScorePanel.jsx): `frontend/src/components/ScorePanel.jsx`
- [Tender Q&A](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/ChatPanel.jsx): `frontend/src/components/ChatPanel.jsx`
- [Corrigendum diff](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/CorrigendumDiffPanel.jsx): `frontend/src/components/CorrigendumDiffPanel.jsx`
- [Runtime selector](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/frontend/src/components/RuntimeSelector.jsx): `frontend/src/components/RuntimeSelector.jsx`

### API and jobs

- [HTTP API](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/api/main.py): `api/main.py`

### Tender analysis

- [Pipeline orchestrator](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/main.py): `tender_extraction/main.py`
- [Document ingestion](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/ingestion.py): `tender_extraction/ingestion.py`
- [Adaptive OCR](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/ocr_backends.py): `tender_extraction/ocr_backends.py`
- [Table extraction](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/table_extraction.py): `tender_extraction/table_extraction.py`
- [Structure chunking](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/chunking.py): `tender_extraction/chunking.py`
- [Hybrid retrieval](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/retrieval.py): `tender_extraction/retrieval.py`
- [Schema extraction](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/extraction.py): `tender_extraction/extraction.py`
- [Tender schemas](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/schemas.py): `tender_extraction/schemas.py`
- [Citation validation](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/validation.py): `tender_extraction/validation.py`
- [Visual analysis](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/vision.py): `tender_extraction/vision.py`

### Review and qualification

- [Bilingual normalization](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/normalization.py): `tender_extraction/normalization.py`
- [Bid qualification](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/scoring.py): `tender_extraction/scoring.py`
- [Question answering](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/qa.py): `tender_extraction/qa.py`
- [Corrigendum analysis](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/corrigendum.py): `tender_extraction/corrigendum.py`
- [Runtime configuration](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/config.py): `tender_extraction/config.py`
- [Model runtime](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/model_runtime.py): `tender_extraction/model_runtime.py`
- [Local inference](https://github.com/pragyanbhatt1213/tenderaudit/blob/main/tender_extraction/native_runtime.py): `tender_extraction/native_runtime.py`

### Other components

- **Tender auditor**
- **LLM provider**
- **PDF or scan**
- **Bidder records**

## Connections

- Tender auditor → Web application: uses
- Web application → Tender upload: renders (evidence: `frontend/src/App.jsx`)
- Tender auditor → Tender upload: submits document
- Tender upload → HTTP API: uploads document
- Web application → HTTP API: requests jobs (evidence: `frontend/src/App.jsx`)
- HTTP API → Pipeline orchestrator: runs pipeline (evidence: `api/main.py`)
- PDF or scan → Document ingestion: provides input
- Pipeline orchestrator → Document ingestion: ingests (evidence: `tender_extraction/main.py`)
- Document ingestion → Adaptive OCR: routes OCR (evidence: `tender_extraction/ingestion.py`)
- Pipeline orchestrator → Table extraction: extracts tables (evidence: `tender_extraction/main.py`)
- Pipeline orchestrator → Structure chunking: chunks content (evidence: `tender_extraction/main.py`)
- Pipeline orchestrator → Hybrid retrieval: retrieves context (evidence: `tender_extraction/main.py`)
- Pipeline orchestrator → Schema extraction: extracts fields (evidence: `tender_extraction/main.py`)
- Pipeline orchestrator → Citation validation: grounds results (evidence: `tender_extraction/main.py`)
- Pipeline orchestrator → Visual analysis: analyzes pages (evidence: `tender_extraction/main.py`)
- Schema extraction → Tender schemas: uses schema (evidence: `tender_extraction/extraction.py`)
- Schema extraction → Bilingual normalization: normalizes values (evidence: `tender_extraction/extraction.py`)
- HTTP API → Bid qualification: scores bidder (evidence: `api/main.py`)
- HTTP API → Question answering: answers questions (evidence: `api/main.py`)
- HTTP API → Corrigendum analysis: compares revisions (evidence: `api/main.py`)
- HTTP API → Runtime configuration: configures runtime (evidence: `api/main.py`)
- Runtime configuration → Model runtime: selects provider
- Model runtime → Local inference: uses local inference
- Model runtime → LLM provider: calls provider
- Runtime selector → HTTP API: configures runtime
- Bidder records → HTTP API: provides profile
- HTTP API → Web application: returns job results
- Web application → Results viewer: renders results (evidence: `frontend/src/App.jsx`)
- Results viewer → Citation viewer: shows citations (evidence: `frontend/src/components/ResultViewer.jsx`)
- Results viewer → Qualification score: shows qualification (evidence: `frontend/src/components/ResultViewer.jsx`)
- Results viewer → Tender Q&A: offers questions (evidence: `frontend/src/components/ResultViewer.jsx`)
- Results viewer → Corrigendum diff: shows differences (evidence: `frontend/src/components/ResultViewer.jsx`)
- Web application → Bidder profile: shows profile (evidence: `frontend/src/App.jsx`)
- Bidder profile → HTTP API: configures bidder
