# na-vin23/quantedge architecture

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

- Interactive diagram: https://gitdiagram.com/na-vin23/quantedge
- Repository: https://github.com/na-vin23/quantedge

## Overview

QuantEdge is a historical quantitative research platform, not a trading system. Its main workflow ingests and validates stock data, engineers indicators and strategy signals, simulates historical trades, and exposes results through a read-only API and web interface. A separate validation workflow evaluates walk-forward windows, parameter sensitivity, and integrity gates. The README documents these capabilities; sampled source and the SOURCE INDEX support the component relationships shown. Some unsampled page and validation internals are represented at subsystem level where their wiring is not confirmed.

Main entry points: [`quant/data/registry.py`](https://github.com/na-vin23/quantedge/blob/main/quant/data/registry.py) (Symbol registry), [`frontend/src/App.tsx`](https://github.com/na-vin23/quantedge/blob/main/frontend/src/App.tsx) (Web application), [`quant/api/main.py`](https://github.com/na-vin23/quantedge/blob/main/quant/api/main.py) (FastAPI application), [`frontend/src/services/api.ts`](https://github.com/na-vin23/quantedge/blob/main/frontend/src/services/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Research web app"]
  node_app["Web application<br/>[App.tsx]"]
  node_selector["Stock selector<br/>[StockSelector.tsx]"]
  node_analysis["Stock analysis<br/>[index.tsx]"]
  node_backtestlab["Backtest lab<br/>[index.tsx]"]
  node_journal["Trade journal<br/>[index.tsx]"]
  node_datacenter["Data center<br/>[index.tsx]"]
  node_overview["Research overview<br/>[index.tsx]"]
  node_client["API client<br/>[api.ts]"]
end

subgraph group_api["Read-only API"]
  node_apiapp["FastAPI application<br/>[main.py]"]
  node_stocks["Stock endpoints<br/>[stocks.py]"]
  node_backtests["Backtest endpoints<br/>[backtests.py]"]
  node_qualityroute["Quality endpoints<br/>[data_quality.py]"]
  node_overviewroute["Overview endpoint<br/>[overview.py]"]
  node_assistant["Research assistant<br/>[assistant.py]"]
  node_context["Context builder<br/>[context_builder.py]"]
  node_llm["LLM provider<br/>[llm_provider.py]"]
end

subgraph group_research["Research pipelines"]
  node_registry["Symbol registry<br/>[registry.py]"]
  node_datapipeline["Data preparation<br/>[pipeline.py]"]
  node_ingestion["CSV ingestion<br/>[ingestion.py]"]
  node_cleaning["Data cleaning<br/>[cleaning.py]"]
  node_quality["Data validation<br/>[validation.py]"]
  node_features["Feature pipeline<br/>[pipeline.py]"]
  node_indicators["Indicators<br/>[indicators.py]"]
  node_strategy["Trend-momentum strategy<br/>[trend_momentum.py]"]
  node_backtestpipeline["Backtest pipeline<br/>[pipeline.py]"]
  node_engine["Simulation engine<br/>[engine.py]"]
  node_costs["Transaction costs<br/>[costs.py]"]
  node_metrics["Performance metrics<br/>[metrics.py]"]
end

subgraph group_validation["Robustness validation"]
  node_validationcli["Validation workflow<br/>[__main__.py]"]
  node_splitter["Chronological splits<br/>[splitter.py]"]
  node_walkforward["Walk-forward tests<br/>[walk_forward.py]"]
  node_sensitivity["Sensitivity analysis<br/>[sensitivity.py]"]
  node_gates["Integrity gates<br/>[gates.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"uses"| node_app
node_app -->|"routes to"| node_analysis
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_backtestlab
node_app -->|"routes to"| node_journal
node_app -->|"routes to"| node_datacenter
node_selector -->|"loads symbols"| node_client
node_analysis -->|"requests data"| node_client
node_backtestlab -->|"requests results"| node_client
node_journal -->|"requests trades"| node_client
node_datacenter -->|"requests reports"| node_client
node_client -->|"calls API"| node_apiapp
node_apiapp -->|"registers route"| node_stocks
node_apiapp -->|"registers route"| node_backtests
node_apiapp -->|"registers route"| node_qualityroute
node_apiapp -->|"registers route"| node_overviewroute
node_apiapp -->|"registers route"| node_assistant
node_stocks -->|"resolves symbols"| node_registry
node_backtests -->|"resolves outputs"| node_registry
node_qualityroute -.->|"resolves reports"| node_registry
node_overviewroute -->|"resolves dataset"| node_registry
node_assistant -->|"builds context"| node_context
node_assistant -->|"requests response"| node_llm
node_assistant -->|"reads symbols"| node_registry
node_datapipeline -->|"loads CSV"| node_ingestion
node_datapipeline -->|"cleans data"| node_cleaning
node_datapipeline -->|"validates data"| node_quality
node_datapipeline -->|"resolves paths"| node_registry
node_features -->|"computes features"| node_indicators
node_features -->|"generates signals"| node_strategy
node_features -->|"resolves paths"| node_registry
node_backtestpipeline -->|"runs simulation"| node_engine
node_backtestpipeline -->|"computes metrics"| node_metrics
node_backtestpipeline -->|"configures costs"| node_costs
node_backtestpipeline -->|"resolves paths"| node_registry
node_engine -->|"prices trades"| node_costs
node_metrics -->|"reads results"| node_engine
node_validationcli -->|"runs evaluation"| node_walkforward
node_validationcli -->|"runs analysis"| node_sensitivity
node_validationcli -->|"checks integrity"| node_gates
node_walkforward -->|"creates windows"| node_splitter
node_walkforward -->|"simulates windows"| node_engine
node_walkforward -->|"scores windows"| node_metrics
node_sensitivity -->|"tests variants"| node_engine
node_sensitivity -->|"scores variants"| node_metrics

click node_app "https://github.com/na-vin23/quantedge/blob/main/frontend/src/App.tsx"
click node_selector "https://github.com/na-vin23/quantedge/blob/main/frontend/src/components/ui/StockSelector.tsx"
click node_analysis "https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/StockAnalysis/index.tsx"
click node_backtestlab "https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/BacktestLab/index.tsx"
click node_journal "https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/TradeJournal/index.tsx"
click node_datacenter "https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/DataCenter/index.tsx"
click node_overview "https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/Overview/index.tsx"
click node_client "https://github.com/na-vin23/quantedge/blob/main/frontend/src/services/api.ts"
click node_apiapp "https://github.com/na-vin23/quantedge/blob/main/quant/api/main.py"
click node_stocks "https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/stocks.py"
click node_backtests "https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/backtests.py"
click node_qualityroute "https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/data_quality.py"
click node_overviewroute "https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/overview.py"
click node_assistant "https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/assistant.py"
click node_context "https://github.com/na-vin23/quantedge/blob/main/quant/api/context_builder.py"
click node_llm "https://github.com/na-vin23/quantedge/blob/main/quant/api/llm_provider.py"
click node_registry "https://github.com/na-vin23/quantedge/blob/main/quant/data/registry.py"
click node_datapipeline "https://github.com/na-vin23/quantedge/blob/main/quant/data/pipeline.py"
click node_ingestion "https://github.com/na-vin23/quantedge/blob/main/quant/data/ingestion.py"
click node_cleaning "https://github.com/na-vin23/quantedge/blob/main/quant/data/cleaning.py"
click node_quality "https://github.com/na-vin23/quantedge/blob/main/quant/data/validation.py"
click node_features "https://github.com/na-vin23/quantedge/blob/main/quant/features/pipeline.py"
click node_indicators "https://github.com/na-vin23/quantedge/blob/main/quant/features/indicators.py"
click node_strategy "https://github.com/na-vin23/quantedge/blob/main/quant/strategies/trend_momentum.py"
click node_backtestpipeline "https://github.com/na-vin23/quantedge/blob/main/quant/backtest/pipeline.py"
click node_engine "https://github.com/na-vin23/quantedge/blob/main/quant/backtest/engine.py"
click node_costs "https://github.com/na-vin23/quantedge/blob/main/quant/backtest/costs.py"
click node_metrics "https://github.com/na-vin23/quantedge/blob/main/quant/backtest/metrics.py"
click node_validationcli "https://github.com/na-vin23/quantedge/blob/main/quant/validation/__main__.py"
click node_splitter "https://github.com/na-vin23/quantedge/blob/main/quant/validation/splitter.py"
click node_walkforward "https://github.com/na-vin23/quantedge/blob/main/quant/validation/walk_forward.py"
click node_sensitivity "https://github.com/na-vin23/quantedge/blob/main/quant/validation/sensitivity.py"
click node_gates "https://github.com/na-vin23/quantedge/blob/main/quant/validation/gates.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_selector,node_analysis,node_backtestlab,node_journal,node_datacenter,node_overview,node_client toneBlue
class node_apiapp,node_stocks,node_backtests,node_qualityroute,node_overviewroute,node_assistant,node_context,node_llm toneAmber
class node_registry,node_datapipeline,node_ingestion,node_cleaning,node_quality,node_features,node_indicators,node_strategy,node_backtestpipeline,node_engine,node_costs,node_metrics toneMint
class node_validationcli,node_splitter,node_walkforward,node_sensitivity,node_gates toneRose
class node_researcher toneIndigo
```

## Components

### Research web app

- [Web application](https://github.com/na-vin23/quantedge/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Stock selector](https://github.com/na-vin23/quantedge/blob/main/frontend/src/components/ui/StockSelector.tsx): `frontend/src/components/ui/StockSelector.tsx`
- [Stock analysis](https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/StockAnalysis/index.tsx): `frontend/src/pages/StockAnalysis/index.tsx`
- [Backtest lab](https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/BacktestLab/index.tsx): `frontend/src/pages/BacktestLab/index.tsx`
- [Trade journal](https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/TradeJournal/index.tsx): `frontend/src/pages/TradeJournal/index.tsx`
- [Data center](https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/DataCenter/index.tsx): `frontend/src/pages/DataCenter/index.tsx`
- [Research overview](https://github.com/na-vin23/quantedge/blob/main/frontend/src/pages/Overview/index.tsx): `frontend/src/pages/Overview/index.tsx`
- [API client](https://github.com/na-vin23/quantedge/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Read-only API

- [FastAPI application](https://github.com/na-vin23/quantedge/blob/main/quant/api/main.py): `quant/api/main.py`
- [Stock endpoints](https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/stocks.py): `quant/api/routes/stocks.py`
- [Backtest endpoints](https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/backtests.py): `quant/api/routes/backtests.py`
- [Quality endpoints](https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/data_quality.py): `quant/api/routes/data_quality.py`
- [Overview endpoint](https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/overview.py): `quant/api/routes/overview.py`
- [Research assistant](https://github.com/na-vin23/quantedge/blob/main/quant/api/routes/assistant.py): `quant/api/routes/assistant.py`
- [Context builder](https://github.com/na-vin23/quantedge/blob/main/quant/api/context_builder.py): `quant/api/context_builder.py`
- [LLM provider](https://github.com/na-vin23/quantedge/blob/main/quant/api/llm_provider.py): `quant/api/llm_provider.py`

### Research pipelines

- [Symbol registry](https://github.com/na-vin23/quantedge/blob/main/quant/data/registry.py): `quant/data/registry.py`
- [Data preparation](https://github.com/na-vin23/quantedge/blob/main/quant/data/pipeline.py): `quant/data/pipeline.py`
- [CSV ingestion](https://github.com/na-vin23/quantedge/blob/main/quant/data/ingestion.py): `quant/data/ingestion.py`
- [Data cleaning](https://github.com/na-vin23/quantedge/blob/main/quant/data/cleaning.py): `quant/data/cleaning.py`
- [Data validation](https://github.com/na-vin23/quantedge/blob/main/quant/data/validation.py): `quant/data/validation.py`
- [Feature pipeline](https://github.com/na-vin23/quantedge/blob/main/quant/features/pipeline.py): `quant/features/pipeline.py`
- [Indicators](https://github.com/na-vin23/quantedge/blob/main/quant/features/indicators.py): `quant/features/indicators.py`
- [Trend-momentum strategy](https://github.com/na-vin23/quantedge/blob/main/quant/strategies/trend_momentum.py): `quant/strategies/trend_momentum.py`
- [Backtest pipeline](https://github.com/na-vin23/quantedge/blob/main/quant/backtest/pipeline.py): `quant/backtest/pipeline.py`
- [Simulation engine](https://github.com/na-vin23/quantedge/blob/main/quant/backtest/engine.py): `quant/backtest/engine.py`
- [Transaction costs](https://github.com/na-vin23/quantedge/blob/main/quant/backtest/costs.py): `quant/backtest/costs.py`
- [Performance metrics](https://github.com/na-vin23/quantedge/blob/main/quant/backtest/metrics.py): `quant/backtest/metrics.py`

### Robustness validation

- [Validation workflow](https://github.com/na-vin23/quantedge/blob/main/quant/validation/__main__.py): `quant/validation/__main__.py`
- [Chronological splits](https://github.com/na-vin23/quantedge/blob/main/quant/validation/splitter.py): `quant/validation/splitter.py`
- [Walk-forward tests](https://github.com/na-vin23/quantedge/blob/main/quant/validation/walk_forward.py): `quant/validation/walk_forward.py`
- [Sensitivity analysis](https://github.com/na-vin23/quantedge/blob/main/quant/validation/sensitivity.py): `quant/validation/sensitivity.py`
- [Integrity gates](https://github.com/na-vin23/quantedge/blob/main/quant/validation/gates.py): `quant/validation/gates.py`

### Other components

- **Researcher**

## Connections

- Researcher → Web application: uses (evidence: `README.md`)
- Web application → Stock analysis: routes to (evidence: `README.md`)
- Web application → Research overview: routes to (evidence: `README.md`)
- Web application → Backtest lab: routes to (evidence: `README.md`)
- Web application → Trade journal: routes to (evidence: `README.md`)
- Web application → Data center: routes to (evidence: `README.md`)
- Stock selector → API client: loads symbols (evidence: `frontend/src/components/ui/StockSelector.tsx`)
- Stock analysis → API client: requests data (evidence: `frontend/src/pages/StockAnalysis/index.tsx`)
- Backtest lab → API client: requests results (evidence: `frontend/src/pages/BacktestLab/index.tsx`)
- Trade journal → API client: requests trades (evidence: `frontend/src/pages/TradeJournal/index.tsx`)
- Data center → API client: requests reports (evidence: `frontend/src/pages/DataCenter/index.tsx`)
- API client → FastAPI application: calls API (evidence: `README.md`)
- FastAPI application → Stock endpoints: registers route (evidence: `quant/api/main.py`)
- FastAPI application → Backtest endpoints: registers route (evidence: `quant/api/main.py`)
- FastAPI application → Quality endpoints: registers route (evidence: `quant/api/main.py`)
- FastAPI application → Overview endpoint: registers route (evidence: `quant/api/main.py`)
- FastAPI application → Research assistant: registers route (evidence: `quant/api/main.py`)
- Stock endpoints → Symbol registry: resolves symbols (evidence: `quant/api/routes/stocks.py`)
- Backtest endpoints → Symbol registry: resolves outputs (evidence: `quant/api/routes/backtests.py`)
- Quality endpoints → Symbol registry: resolves reports
- Overview endpoint → Symbol registry: resolves dataset (evidence: `quant/api/routes/overview.py`)
- Research assistant → Context builder: builds context (evidence: `quant/api/routes/assistant.py`)
- Research assistant → LLM provider: requests response (evidence: `quant/api/routes/assistant.py`)
- Research assistant → Symbol registry: reads symbols (evidence: `quant/api/routes/assistant.py`)
- Data preparation → CSV ingestion: loads CSV (evidence: `quant/data/pipeline.py`)
- Data preparation → Data cleaning: cleans data (evidence: `README.md`)
- Data preparation → Data validation: validates data (evidence: `README.md`)
- Data preparation → Symbol registry: resolves paths (evidence: `quant/data/pipeline.py`)
- Feature pipeline → Indicators: computes features (evidence: `quant/features/pipeline.py`)
- Feature pipeline → Trend-momentum strategy: generates signals (evidence: `quant/features/pipeline.py`)
- Feature pipeline → Symbol registry: resolves paths (evidence: `quant/features/pipeline.py`)
- Backtest pipeline → Simulation engine: runs simulation (evidence: `quant/backtest/pipeline.py`)
- Backtest pipeline → Performance metrics: computes metrics (evidence: `quant/backtest/pipeline.py`)
- Backtest pipeline → Transaction costs: configures costs (evidence: `quant/backtest/pipeline.py`)
- Backtest pipeline → Symbol registry: resolves paths (evidence: `quant/backtest/pipeline.py`)
- Simulation engine → Transaction costs: prices trades (evidence: `quant/backtest/engine.py`)
- Performance metrics → Simulation engine: reads results (evidence: `quant/backtest/metrics.py`)
- Validation workflow → Walk-forward tests: runs evaluation (evidence: `README.md`)
- Validation workflow → Sensitivity analysis: runs analysis (evidence: `README.md`)
- Validation workflow → Integrity gates: checks integrity (evidence: `README.md`)
- Walk-forward tests → Chronological splits: creates windows (evidence: `quant/validation/walk_forward.py`)
- Walk-forward tests → Simulation engine: simulates windows (evidence: `quant/validation/walk_forward.py`)
- Walk-forward tests → Performance metrics: scores windows (evidence: `quant/validation/walk_forward.py`)
- Sensitivity analysis → Simulation engine: tests variants (evidence: `quant/validation/sensitivity.py`)
- Sensitivity analysis → Performance metrics: scores variants (evidence: `quant/validation/sensitivity.py`)
