# yaseenshaikh2006/quora-duplicate-question-detector architecture

> Architecture diagram of the GitHub repository yaseenshaikh2006/quora-duplicate-question-detector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yaseenshaikh2006/quora-duplicate-question-detector
- Repository: https://github.com/yaseenshaikh2006/quora-duplicate-question-detector

## Overview

This is a local React/FastAPI Quora duplicate-question detector. A user enters two questions and an optional threshold; the UI sends them to the API, which validates the request, runs a transparent lexical cosine-similarity pipeline, and returns a classification plus inspection data for the result view. The product also provides benchmark samples and educational pages, including a pipeline diagram and data-structure inspection panel. Relationships for the sampled request path are evidenced in the excerpts; the detector-to-inspection-panel rendering link is documented but not visible in the sampled source, so it is shown as unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/App.jsx) (App navigation), [`backend/app/routes/duplicate.py`](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/routes/duplicate.py) (Duplicate API route), [`frontend/src/services/api.js`](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/services/api.js) (API client), [`frontend/src/pages/Detector.jsx`](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Detector.jsx) (Question detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App navigation<br/>[App.jsx]"]
  node_detector["Question detector<br/>[Detector.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_dataset_page["Sample browser<br/>[Dataset.jsx]"]
  node_home["Landing page<br/>[Home.jsx]"]
  node_about["Technical overview<br/>[About.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_backend["API and samples"]
  node_backend_app["FastAPI application<br/>[main.py]"]
  node_duplicate_route["Duplicate API route<br/>[duplicate.py]"]
  node_health_route["Health route<br/>[health.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_dataset_service["Sample dataset reader<br/>[dataset_service.py]"]
  node_sample_csv["Sample question pairs"]
end

subgraph group_analysis["Similarity engine"]
  node_pipeline["Similarity pipeline<br/>[similarity.py]"]
  node_stopwords["Stopword set<br/>[stopwords.py]"]
end

subgraph group_learning["Learning interface"]
  node_flow_page["Process explainer<br/>[HowItWorks.jsx]"]
  node_flow_diagram["Pipeline diagram<br/>[FlowDiagram.jsx]"]
  node_inspection_panel["Data-structure inspector"]
end

node_user(("Question author"))

node_user -->|"enters questions"| node_detector
node_app -->|"renders"| node_detector
node_app -->|"renders"| node_home
node_app -->|"renders"| node_dataset_page
node_app -->|"renders"| node_about
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"checks health"| node_api_client
node_detector -->|"submits questions"| node_api_client
node_dataset_page -->|"fetches samples"| node_api_client
node_api_client -->|"posts questions"| node_duplicate_route
node_api_client -->|"checks health"| node_health_route
node_backend_app -->|"registers route"| node_duplicate_route
node_backend_app -->|"registers route"| node_health_route
node_duplicate_route -->|"validates and serializes"| node_schemas
node_duplicate_route -->|"calls analysis"| node_pipeline
node_duplicate_route -->|"loads samples"| node_dataset_service
node_dataset_service -->|"builds sample records"| node_schemas
node_dataset_service -->|"reads pairs"| node_sample_csv
node_pipeline -->|"uses stopwords"| node_stopwords
node_flow_page -->|"renders"| node_flow_diagram
node_detector -.->|"displays analysis details"| node_inspection_panel

click node_app "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/App.jsx"
click node_detector "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Detector.jsx"
click node_api_client "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/services/api.js"
click node_dataset_page "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Dataset.jsx"
click node_home "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Home.jsx"
click node_about "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/About.jsx"
click node_navbar "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/Navbar.jsx"
click node_footer "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/Footer.jsx"
click node_backend_app "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/main.py"
click node_duplicate_route "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/routes/duplicate.py"
click node_health_route "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/routes/health.py"
click node_schemas "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/models/schemas.py"
click node_dataset_service "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/services/dataset_service.py"
click node_sample_csv "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/data/sample_questions.csv"
click node_pipeline "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/algorithms/similarity.py"
click node_stopwords "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/utils/stopwords.py"
click node_flow_page "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/HowItWorks.jsx"
click node_flow_diagram "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/FlowDiagram.jsx"
click node_inspection_panel "https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/DataStructureBreakdown.jsx"

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_detector,node_api_client,node_dataset_page,node_home,node_about,node_navbar,node_footer toneBlue
class node_backend_app,node_duplicate_route,node_health_route,node_schemas,node_dataset_service,node_sample_csv toneAmber
class node_pipeline,node_stopwords toneMint
class node_flow_page,node_flow_diagram,node_inspection_panel toneRose
class node_user toneIndigo
```

## Components

### Web application

- [App navigation](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Question detector](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Detector.jsx): `frontend/src/pages/Detector.jsx`
- [API client](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Sample browser](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Dataset.jsx): `frontend/src/pages/Dataset.jsx`
- [Landing page](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Technical overview](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/About.jsx): `frontend/src/pages/About.jsx`
- [Navigation bar](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Footer](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/Footer.jsx): `frontend/src/components/Footer.jsx`

### API and samples

- [FastAPI application](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/main.py): `backend/app/main.py`
- [Duplicate API route](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/routes/duplicate.py): `backend/app/routes/duplicate.py`
- [Health route](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/routes/health.py): `backend/app/routes/health.py`
- [Request and response schemas](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/models/schemas.py): `backend/app/models/schemas.py`
- [Sample dataset reader](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/services/dataset_service.py): `backend/app/services/dataset_service.py`
- [Sample question pairs](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/data/sample_questions.csv): `backend/data/sample_questions.csv`

### Similarity engine

- [Similarity pipeline](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/algorithms/similarity.py): `backend/app/algorithms/similarity.py`
- [Stopword set](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/backend/app/utils/stopwords.py): `backend/app/utils/stopwords.py`

### Learning interface

- [Process explainer](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/pages/HowItWorks.jsx): `frontend/src/pages/HowItWorks.jsx`
- [Pipeline diagram](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/FlowDiagram.jsx): `frontend/src/components/FlowDiagram.jsx`
- [Data-structure inspector](https://github.com/yaseenshaikh2006/quora-duplicate-question-detector/blob/master/frontend/src/components/DataStructureBreakdown.jsx): `frontend/src/components/DataStructureBreakdown.jsx`

### Other components

- **Question author**

## Connections

- Question author → Question detector: enters questions (evidence: `README.md`)
- App navigation → Question detector: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Landing page: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Sample browser: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Technical overview: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- App navigation → Footer: renders (evidence: `frontend/src/App.jsx`)
- App navigation → API client: checks health (evidence: `frontend/src/App.jsx`)
- Question detector → API client: submits questions (evidence: `frontend/src/pages/Detector.jsx`)
- Sample browser → API client: fetches samples (evidence: `frontend/src/services/api.js`)
- API client → Duplicate API route: posts questions (evidence: `frontend/src/services/api.js`)
- API client → Health route: checks health (evidence: `frontend/src/services/api.js`)
- FastAPI application → Duplicate API route: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Health route: registers route (evidence: `backend/app/main.py`)
- Duplicate API route → Request and response schemas: validates and serializes (evidence: `backend/app/routes/duplicate.py`)
- Duplicate API route → Similarity pipeline: calls analysis (evidence: `backend/app/routes/duplicate.py`)
- Duplicate API route → Sample dataset reader: loads samples (evidence: `backend/app/routes/duplicate.py`)
- Sample dataset reader → Request and response schemas: builds sample records (evidence: `backend/app/services/dataset_service.py`)
- Sample dataset reader → Sample question pairs: reads pairs (evidence: `backend/app/services/dataset_service.py`)
- Similarity pipeline → Stopword set: uses stopwords (evidence: `backend/app/algorithms/similarity.py`)
- Process explainer → Pipeline diagram: renders (evidence: `frontend/src/pages/HowItWorks.jsx`)
- Question detector → Data-structure inspector: displays analysis details
