# rohitkumawat-dev/velocia1 architecture

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

- Interactive diagram: https://gitdiagram.com/rohitkumawat-dev/velocia1
- Repository: https://github.com/rohitkumawat-dev/velocia1

## Overview

Velocia recommends potentially applicable Indian Standards from product/specification text and supports tender-PDF review with citation checks and report export. The principal flow runs from the React interface through FastAPI analysis into retrieval, filtering and ranked, explainable results; tender review adds segmentation, citation audit and PDF reporting. The README documents product/category intelligence, metadata validation and typo handling, but sampled excerpts do not establish all internal wiring, so uncertain links are omitted. The RAG module is shown as an optional path, not assumed to be the main API route.

Main entry points: [`backend/main.py`](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py) (Query analysis), [`frontend/src/App.jsx`](https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/App.jsx) (Search interface), [`frontend/src/TenderReview.jsx`](https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/TenderReview.jsx) (Tender interface), [`backend/catalogue_search.py`](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/catalogue_search.py) (Hybrid retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webapp["Search interface<br/>[App.jsx]"]
  node_tenderui["Tender interface<br/>[TenderReview.jsx]"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_recommendation["Recommendations"]
  node_queryflow["Query analysis<br/>[main.py]"]
  node_catalogsearch["Hybrid retrieval"]
  node_semantic["Semantic retrieval<br/>[semantic_search.py]"]
  node_applicability["Applicability rules<br/>[applicability.py]"]
  node_typos["Typo handling<br/>[typo_correction.py]"]
  node_rag["Evidence assessment<br/>[rag_engine.py]"]
end

subgraph group_tender["Tender review"]
  node_extract["Document extraction"]
  node_tenderreview["Tender orchestration<br/>[main.py]"]
  node_segmentation["Requirement segmentation<br/>[tender_review.py]"]
  node_citationaudit["Citation audit<br/>[tender_review.py]"]
  node_snapshot[("Citation snapshot")]
  node_pdfreport["PDF reporting<br/>[report_pdf.py]"]
end

subgraph group_catalogue["Standards data"]
  node_standards[("Standards records<br/>[standards.json]")]
  node_catalogueevidence[("Scope evidence")]
end

node_user(("Procurement user"))
node_gemini["Gemini service"]
node_bis["BIS catalogue"]

node_user -->|"enters requirement"| node_webapp
node_webapp -->|"POST /api/analyze"| node_api
node_api -->|"analyzes query"| node_queryflow
node_queryflow -->|"corrects input"| node_typos
node_queryflow -->|"retrieves candidates"| node_catalogsearch
node_queryflow -->|"retrieves candidates"| node_semantic
node_catalogsearch -->|"reads records"| node_standards
node_semantic -->|"indexes records"| node_standards
node_queryflow -->|"filters candidates"| node_applicability
node_catalogsearch -->|"reads scope evidence"| node_catalogueevidence
node_webapp -->|"opens review"| node_tenderui
node_tenderui -->|"uploads PDF"| node_api
node_api -->|"handles tender"| node_tenderreview
node_tenderreview -->|"splits requirements"| node_segmentation
node_tenderreview -->|"extracts document text"| node_extract
node_tenderreview -->|"audits citations"| node_citationaudit
node_citationaudit -->|"reads snapshot"| node_snapshot
node_tenderreview -->|"searches requirements"| node_queryflow
node_tenderreview -->|"creates report"| node_pdfreport
node_tenderui -->|"downloads report"| node_api
node_api -->|"loads report"| node_pdfreport
node_queryflow -.->|"optional assessment"| node_rag
node_rag -.->|"requests assessment"| node_gemini
node_user -.->|"opens catalogue link"| node_bis

click node_webapp "https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/App.jsx"
click node_tenderui "https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/TenderReview.jsx"
click node_api "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py"
click node_queryflow "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py"
click node_catalogsearch "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/catalogue_search.py"
click node_semantic "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/semantic_search.py"
click node_applicability "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/applicability.py"
click node_typos "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/typo_correction.py"
click node_rag "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/rag_engine.py"
click node_standards "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/standards.json"
click node_catalogueevidence "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/scope_evidence.json"
click node_extract "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/document_extract.py"
click node_tenderreview "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py"
click node_segmentation "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/tender_review.py"
click node_citationaudit "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/tender_review.py"
click node_snapshot "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/citation_snapshot.json"
click node_pdfreport "https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/report_pdf.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_webapp,node_tenderui,node_api,node_user toneBlue
class node_queryflow,node_catalogsearch,node_semantic,node_applicability,node_typos,node_rag toneAmber
class node_extract,node_tenderreview,node_segmentation,node_citationaudit,node_snapshot,node_pdfreport toneMint
class node_standards,node_catalogueevidence toneRose
class node_gemini,node_bis toneIndigo
```

## Components

### User experience

- [Search interface](https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tender interface](https://github.com/rohitkumawat-dev/velocia1/blob/main/frontend/src/TenderReview.jsx): `frontend/src/TenderReview.jsx`
- [FastAPI service](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py): `backend/main.py`

### Recommendations

- [Query analysis](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py): `backend/main.py`
- [Hybrid retrieval](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/catalogue_search.py): `backend/catalogue_search.py`
- [Semantic retrieval](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/semantic_search.py): `backend/semantic_search.py`
- [Applicability rules](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/applicability.py): `backend/applicability.py`
- [Typo handling](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/typo_correction.py): `backend/typo_correction.py`
- [Evidence assessment](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/rag_engine.py): `backend/rag_engine.py`

### Tender review

- [Document extraction](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/document_extract.py): `backend/document_extract.py`
- [Tender orchestration](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/main.py): `backend/main.py`
- [Requirement segmentation](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/tender_review.py): `backend/tender_review.py`
- [Citation audit](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/tender_review.py): `backend/tender_review.py`
- [Citation snapshot](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/citation_snapshot.json): `backend/citation_snapshot.json`
- [PDF reporting](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/report_pdf.py): `backend/report_pdf.py`

### Standards data

- [Standards records](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/standards.json): `backend/standards.json`
- [Scope evidence](https://github.com/rohitkumawat-dev/velocia1/blob/main/backend/scope_evidence.json): `backend/scope_evidence.json`

### Other components

- **Procurement user**
- **Gemini service**
- **BIS catalogue**

## Connections

- Procurement user → Search interface: enters requirement
- Search interface → FastAPI service: POST /api/analyze
- FastAPI service → Query analysis: analyzes query
- Query analysis → Typo handling: corrects input
- Query analysis → Hybrid retrieval: retrieves candidates
- Query analysis → Semantic retrieval: retrieves candidates
- Hybrid retrieval → Standards records: reads records
- Semantic retrieval → Standards records: indexes records
- Query analysis → Applicability rules: filters candidates
- Hybrid retrieval → Scope evidence: reads scope evidence
- Search interface → Tender interface: opens review
- Tender interface → FastAPI service: uploads PDF
- FastAPI service → Tender orchestration: handles tender
- Tender orchestration → Requirement segmentation: splits requirements
- Tender orchestration → Document extraction: extracts document text
- Tender orchestration → Citation audit: audits citations
- Citation audit → Citation snapshot: reads snapshot
- Tender orchestration → Query analysis: searches requirements
- Tender orchestration → PDF reporting: creates report
- Tender interface → FastAPI service: downloads report
- FastAPI service → PDF reporting: loads report
- Query analysis → Evidence assessment: optional assessment
- Evidence assessment → Gemini service: requests assessment
- Procurement user → BIS catalogue: opens catalogue link
