# pshkarsngh/wikitech_project architecture

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

- Interactive diagram: https://gitdiagram.com/pshkarsngh/wikitech_project
- Repository: https://github.com/pshkarsngh/wikitech_project

## Overview

This is a Wikipedia relationship-analysis application: users search for an article, select it, and request an analysis that identifies linked articles, missing people or places, and one-way links; results can also be explored as a connection map. The frontend exposes separate search, analysis, entity, missing-link, one-way-link, and map views. The FastAPI backend gathers MediaWiki data, classifies entities, computes graph results, and optionally caches analyses. Source excerpts are partial, so uncertain internal wiring is omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/App.jsx) (App routes), [`backend/app/routers/analysis.py`](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/routers/analysis.py) (Analysis routes), [`backend/app/services/mediawiki.py`](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/mediawiki.py) (MediaWiki client), [`frontend/src/api/client.js`](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App routes<br/>[App.jsx]"]
  node_searchbar["Article search<br/>[SearchBar.jsx]"]
  node_searchpage["Search view<br/>[SearchPage.jsx]"]
  node_analysispage["Analysis view<br/>[AnalysisPage.jsx]"]
  node_resultviews["Result views<br/>[EntitiesPage.jsx]"]
  node_missingview["Missing links view"]
  node_onewayview["One-way links view"]
  node_mapview["Connection map view"]
  node_context["Analysis state"]
  node_client["API client<br/>[client.js]"]
end

subgraph group_api["API and routes"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_articles["Article routes<br/>[articles.py]"]
  node_analysisroutes["Analysis routes<br/>[analysis.py]"]
end

subgraph group_analysis["Analysis services"]
  node_analysissvc["Graph analysis<br/>[analysis.py]"]
  node_classifier["Entity classifier<br/>[classifier.py]"]
  node_budget["Request budgets<br/>[budget.py]"]
end

subgraph group_data["Data and integrations"]
  node_mediawiki["MediaWiki client<br/>[mediawiki.py]"]
  node_repository["Analysis cache<br/>[repository.py]"]
  node_database[("Database<br/>[models.py]")]
end

node_visitor(("Visitor"))
node_wikimedia{{"Wikipedia API"}}
node_wikidata{{"Wikidata API"}}

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_searchpage
node_app -->|"routes to"| node_analysispage
node_app -->|"routes to"| node_resultviews
node_app -->|"routes to"| node_missingview
node_app -->|"routes to"| node_onewayview
node_app -->|"routes to"| node_mapview
node_searchpage -->|"renders"| node_searchbar
node_searchbar -->|"searches articles"| node_client
node_searchpage -->|"finds article"| node_client
node_analysispage -->|"reads analysis"| node_context
node_context -->|"requests analysis"| node_client
node_client -->|"sends API requests"| node_fastapi
node_fastapi -->|"dispatches article routes"| node_articles
node_fastapi -->|"dispatches analysis routes"| node_analysisroutes
node_articles -->|"requests article data"| node_mediawiki
node_analysisroutes -->|"runs graph analysis"| node_analysissvc
node_analysisroutes -->|"classifies missing entities"| node_classifier
node_analysisroutes -->|"reads and stores results"| node_repository
node_analysisroutes -->|"applies request budget"| node_budget
node_analysissvc -->|"fetches links and pages"| node_mediawiki
node_classifier -->|"gets descriptions"| node_mediawiki
node_mediawiki -->|"queries"| node_wikimedia
node_mediawiki -.->|"searches descriptions"| node_wikidata
node_repository -->|"reads and writes"| node_database

click node_app "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/App.jsx"
click node_searchbar "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/components/SearchBar.jsx"
click node_searchpage "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/SearchPage.jsx"
click node_analysispage "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/AnalysisPage.jsx"
click node_resultviews "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/EntitiesPage.jsx"
click node_missingview "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/MissingConnectionsPage.jsx"
click node_onewayview "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/OneWayConnectionsPage.jsx"
click node_mapview "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/ConnectionMapPage.jsx"
click node_context "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/context/AnalysisContext.jsx"
click node_client "https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/api/client.js"
click node_fastapi "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/main.py"
click node_articles "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/routers/articles.py"
click node_analysisroutes "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/routers/analysis.py"
click node_analysissvc "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/analysis.py"
click node_classifier "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/classifier.py"
click node_budget "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/budget.py"
click node_mediawiki "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/mediawiki.py"
click node_repository "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/repository.py"
click node_database "https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/models.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_searchbar,node_searchpage,node_analysispage,node_resultviews,node_missingview,node_onewayview,node_mapview,node_context,node_client toneBlue
class node_fastapi,node_articles,node_analysisroutes toneAmber
class node_analysissvc,node_classifier,node_budget,node_wikimedia,node_wikidata toneMint
class node_mediawiki,node_repository,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Article search](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/components/SearchBar.jsx): `frontend/src/components/SearchBar.jsx`
- [Search view](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/SearchPage.jsx): `frontend/src/pages/SearchPage.jsx`
- [Analysis view](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/AnalysisPage.jsx): `frontend/src/pages/AnalysisPage.jsx`
- [Result views](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/EntitiesPage.jsx): `frontend/src/pages/EntitiesPage.jsx`
- [Missing links view](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/MissingConnectionsPage.jsx): `frontend/src/pages/MissingConnectionsPage.jsx`
- [One-way links view](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/OneWayConnectionsPage.jsx): `frontend/src/pages/OneWayConnectionsPage.jsx`
- [Connection map view](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/pages/ConnectionMapPage.jsx): `frontend/src/pages/ConnectionMapPage.jsx`
- [Analysis state](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/context/AnalysisContext.jsx): `frontend/src/context/AnalysisContext.jsx`
- [API client](https://github.com/pshkarsngh/wikitech_project/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### API and routes

- [FastAPI app](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/main.py): `backend/app/main.py`
- [Article routes](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/routers/articles.py): `backend/app/routers/articles.py`
- [Analysis routes](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/routers/analysis.py): `backend/app/routers/analysis.py`

### Analysis services

- [Graph analysis](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/analysis.py): `backend/app/services/analysis.py`
- [Entity classifier](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/classifier.py): `backend/app/services/classifier.py`
- [Request budgets](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/budget.py): `backend/app/services/budget.py`

### Data and integrations

- [MediaWiki client](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/services/mediawiki.py): `backend/app/services/mediawiki.py`
- [Analysis cache](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/repository.py): `backend/app/repository.py`
- [Database](https://github.com/pshkarsngh/wikitech_project/blob/main/backend/app/models.py): `backend/app/models.py`

### Other components

- **Visitor**
- **Wikipedia API**
- **Wikidata API**

## Connections

- Visitor → App routes: opens
- App routes → Search view: routes to
- App routes → Analysis view: routes to
- App routes → Result views: routes to
- App routes → Missing links view: routes to
- App routes → One-way links view: routes to
- App routes → Connection map view: routes to
- Search view → Article search: renders
- Article search → API client: searches articles
- Search view → API client: finds article
- Analysis view → Analysis state: reads analysis
- Analysis state → API client: requests analysis
- API client → FastAPI app: sends API requests
- FastAPI app → Article routes: dispatches article routes
- FastAPI app → Analysis routes: dispatches analysis routes
- Article routes → MediaWiki client: requests article data
- Analysis routes → Graph analysis: runs graph analysis
- Analysis routes → Entity classifier: classifies missing entities
- Analysis routes → Analysis cache: reads and stores results
- Analysis routes → Request budgets: applies request budget
- Graph analysis → MediaWiki client: fetches links and pages
- Entity classifier → MediaWiki client: gets descriptions
- MediaWiki client → Wikipedia API: queries
- MediaWiki client → Wikidata API: searches descriptions
- Analysis cache → Database: reads and writes
