# rambo-lc/sih26108 architecture

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

- Interactive diagram: https://gitdiagram.com/rambo-lc/sih26108
- Repository: https://github.com/rambo-lc/sih26108

## Overview

MANAK-RAKSHAK supports procurement officers drafting standards-backed clauses and auditors checking tenders for statutory defects, with a shared BIS standards catalog. Its documented capabilities also include foreign-to-Indian standards concordance, clause neutralization, a procurement copilot, bulk catalog imports, audit reporting, and CVO surveillance. The graph follows the visible frontend-to-API search path and the backend’s explicit search and import behavior; other backend service links reflect documented product roles, but unsampled implementation details limit certainty about their exact wiring.

Main entry points: [`backend/main.py`](https://github.com/rambo-lc/sih26108/blob/main/backend/main.py) (FastAPI Backend), [`frontend/src/lib/api.ts`](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/lib/api.ts) (API Client), [`backend/auditor.py`](https://github.com/rambo-lc/sih26108/blob/main/backend/auditor.py) (Tender Auditor), [`frontend/src/app/admin/page.tsx`](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/app/admin/page.tsx) (CVO Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Workspaces"]
  node_search_ui["Standards Search"]
  node_officer_ui["Officer Studio"]
  node_auditor_ui["Auditor Bench"]
  node_tender_ui["Tender Auditor"]
  node_copilot_ui["Procurement Copilot<br/>[CopilotView.tsx]"]
  node_admin_ui["CVO Admin<br/>[page.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
end

subgraph group_api["Application API"]
  node_backend_api["FastAPI Backend<br/>[main.py]"]
end

subgraph group_standards["Standards Intelligence"]
  node_query_processor["Query Processing<br/>[query_processor.py]"]
  node_search_engine["Standards Search<br/>[search_engine.py]"]
  node_retrieval["Hybrid Retrieval"]
end

subgraph group_governance["Tender Governance"]
  node_clause_generator["Clause Generation"]
  node_concordance["Standards Concordance"]
  node_auditor["Tender Auditor<br/>[auditor.py]"]
  node_risk["Risk Analysis<br/>[risk_analyzer.py]"]
  node_pdf["Audit PDF<br/>[pdf_generator.py]"]
end

subgraph group_state["Data and Integrations"]
  node_standards_store[("Standards Catalog<br/>[database.py]")]
  node_firebase[("Firebase Ledger<br/>[firebase.ts]")]
end

node_officer(("Procurement Officer"))
node_auditor_user(("CAG Auditor"))
node_external_ai(("Neural AI Service"))

node_officer -->|"drafts with"| node_officer_ui
node_officer -->|"searches"| node_search_ui
node_auditor_user -->|"submits tender"| node_tender_ui
node_auditor_user -->|"reviews audit"| node_auditor_ui
node_search_ui -->|"requests search"| node_api_client
node_officer_ui -->|"requests drafting"| node_api_client
node_tender_ui -->|"requests audit"| node_api_client
node_copilot_ui -->|"asks copilot"| node_api_client
node_admin_ui -->|"imports standards"| node_api_client
node_api_client -->|"HTTP requests"| node_backend_api
node_backend_api -->|"searches catalog"| node_search_engine
node_backend_api -->|"processes queries"| node_query_processor
node_query_processor -->|"enhances query"| node_retrieval
node_retrieval -->|"reads standards"| node_standards_store
node_backend_api -->|"generates clauses"| node_clause_generator
node_backend_api -->|"audits tender"| node_auditor
node_auditor -->|"analyzes risks"| node_risk
node_backend_api -->|"generates report"| node_pdf
node_backend_api -.->|"syncs audit"| node_firebase
node_backend_api -.->|"requests AI response"| node_external_ai
node_admin_ui -->|"bulk import"| node_backend_api
node_backend_api -->|"reindexes catalog"| node_search_engine
node_backend_api -->|"refreshes catalog"| node_auditor

click node_search_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/StandardsSearch.tsx"
click node_officer_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/OfficerStudioView.tsx"
click node_auditor_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/AuditorBenchView.tsx"
click node_tender_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/TenderAuditorView.tsx"
click node_copilot_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/CopilotView.tsx"
click node_admin_ui "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/app/admin/page.tsx"
click node_api_client "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/lib/api.ts"
click node_backend_api "https://github.com/rambo-lc/sih26108/blob/main/backend/main.py"
click node_query_processor "https://github.com/rambo-lc/sih26108/blob/main/backend/services/query_processor.py"
click node_search_engine "https://github.com/rambo-lc/sih26108/blob/main/backend/search_engine.py"
click node_retrieval "https://github.com/rambo-lc/sih26108/blob/main/backend/services/retrieval_engine.py"
click node_standards_store "https://github.com/rambo-lc/sih26108/blob/main/backend/models/database.py"
click node_clause_generator "https://github.com/rambo-lc/sih26108/blob/main/backend/services/clause_generator.py"
click node_concordance "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/ConcordanceBridge.tsx"
click node_auditor "https://github.com/rambo-lc/sih26108/blob/main/backend/auditor.py"
click node_risk "https://github.com/rambo-lc/sih26108/blob/main/backend/services/risk_analyzer.py"
click node_pdf "https://github.com/rambo-lc/sih26108/blob/main/backend/pdf_generator.py"
click node_firebase "https://github.com/rambo-lc/sih26108/blob/main/frontend/src/lib/firebase.ts"

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_search_ui,node_officer_ui,node_auditor_ui,node_tender_ui,node_copilot_ui,node_admin_ui,node_api_client toneBlue
class node_backend_api toneAmber
class node_query_processor,node_search_engine,node_retrieval toneMint
class node_clause_generator,node_concordance,node_auditor,node_risk,node_pdf toneRose
class node_standards_store,node_firebase,node_officer,node_auditor_user,node_external_ai toneIndigo
```

## Components

### User Workspaces

- [Standards Search](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/StandardsSearch.tsx): `frontend/src/components/StandardsSearch.tsx`
- [Officer Studio](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/OfficerStudioView.tsx): `frontend/src/components/OfficerStudioView.tsx`
- [Auditor Bench](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/AuditorBenchView.tsx): `frontend/src/components/AuditorBenchView.tsx`
- [Tender Auditor](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/TenderAuditorView.tsx): `frontend/src/components/TenderAuditorView.tsx`
- [Procurement Copilot](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/CopilotView.tsx): `frontend/src/components/CopilotView.tsx`
- [CVO Admin](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/app/admin/page.tsx): `frontend/src/app/admin/page.tsx`
- [API Client](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Application API

- [FastAPI Backend](https://github.com/rambo-lc/sih26108/blob/main/backend/main.py): `backend/main.py`

### Standards Intelligence

- [Query Processing](https://github.com/rambo-lc/sih26108/blob/main/backend/services/query_processor.py): `backend/services/query_processor.py`
- [Standards Search](https://github.com/rambo-lc/sih26108/blob/main/backend/search_engine.py): `backend/search_engine.py`
- [Hybrid Retrieval](https://github.com/rambo-lc/sih26108/blob/main/backend/services/retrieval_engine.py): `backend/services/retrieval_engine.py`

### Tender Governance

- [Clause Generation](https://github.com/rambo-lc/sih26108/blob/main/backend/services/clause_generator.py): `backend/services/clause_generator.py`
- [Standards Concordance](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/components/ConcordanceBridge.tsx): `frontend/src/components/ConcordanceBridge.tsx`
- [Tender Auditor](https://github.com/rambo-lc/sih26108/blob/main/backend/auditor.py): `backend/auditor.py`
- [Risk Analysis](https://github.com/rambo-lc/sih26108/blob/main/backend/services/risk_analyzer.py): `backend/services/risk_analyzer.py`
- [Audit PDF](https://github.com/rambo-lc/sih26108/blob/main/backend/pdf_generator.py): `backend/pdf_generator.py`

### Data and Integrations

- [Standards Catalog](https://github.com/rambo-lc/sih26108/blob/main/backend/models/database.py): `backend/models/database.py`
- [Firebase Ledger](https://github.com/rambo-lc/sih26108/blob/main/frontend/src/lib/firebase.ts): `frontend/src/lib/firebase.ts`

### Other components

- **Procurement Officer**
- **CAG Auditor**
- **Neural AI Service**

## Connections

- Procurement Officer → Officer Studio: drafts with
- Procurement Officer → Standards Search: searches
- CAG Auditor → Tender Auditor: submits tender
- CAG Auditor → Auditor Bench: reviews audit
- Standards Search → API Client: requests search
- Officer Studio → API Client: requests drafting
- Tender Auditor → API Client: requests audit
- Procurement Copilot → API Client: asks copilot
- CVO Admin → API Client: imports standards
- API Client → FastAPI Backend: HTTP requests
- FastAPI Backend → Standards Search: searches catalog
- FastAPI Backend → Query Processing: processes queries
- Query Processing → Hybrid Retrieval: enhances query
- Hybrid Retrieval → Standards Catalog: reads standards
- FastAPI Backend → Clause Generation: generates clauses
- FastAPI Backend → Tender Auditor: audits tender
- Tender Auditor → Risk Analysis: analyzes risks
- FastAPI Backend → Audit PDF: generates report
- FastAPI Backend → Firebase Ledger: syncs audit
- FastAPI Backend → Neural AI Service: requests AI response
- CVO Admin → FastAPI Backend: bulk import
- FastAPI Backend → Standards Search: reindexes catalog
- FastAPI Backend → Tender Auditor: refreshes catalog
