# internalforces/quant_al architecture

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

- Interactive diagram: https://gitdiagram.com/internalforces/quant_al
- Repository: https://github.com/internalforces/quant_al

## Overview

MB Quant resolves Korean and US stock names or tickers, then serves price snapshots and MB-based signals and return comparisons through a React dashboard and Telegram bot; it also supports scheduled email reports. The graph preserves these separate entry points and domain stages. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled implementation details are not inferred.

Main entry points: [`backend/routers/analysis.py`](https://github.com/internalforces/quant_al/blob/master/backend/routers/analysis.py) (FastAPI routes), [`frontend/src/App.jsx`](https://github.com/internalforces/quant_al/blob/master/frontend/src/App.jsx) (Dashboard), [`frontend/src/components/AnalysisResult.jsx`](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/AnalysisResult.jsx) (Analysis view), [`backend/services/ticker_resolver.py`](https://github.com/internalforces/quant_al/blob/master/backend/services/ticker_resolver.py) (Ticker resolver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_dashboard["Dashboard<br/>[App.jsx]"]
  node_searchbar["Ticker search<br/>[SearchBar.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_analysis_view["Analysis view<br/>[AnalysisResult.jsx]"]
  node_price_view["Price view<br/>[StockPrice.jsx]"]
  node_signal_card["Signal card<br/>[SignalCard.jsx]"]
  node_stats_table["Stats table<br/>[StatsTable.jsx]"]
  node_price_chart["Price chart<br/>[PriceChart.jsx]"]
  node_return_chart["Return chart<br/>[ReturnChart.jsx]"]
end

subgraph group_api["API and analysis"]
  node_api["FastAPI routes<br/>[analysis.py]"]
  node_schemas["Response schemas<br/>[models.py]"]
  node_resolver["Ticker resolver<br/>[ticker_resolver.py]"]
  node_ticker_search["Yahoo search client<br/>[ticker_search.py]"]
  node_price_service["Price lookup<br/>[price.py]"]
  node_analysis_service["Signal analysis<br/>[analysis.py]"]
  node_strategy["MB strategy<br/>[strategy.py]"]
end

subgraph group_bot["Telegram bot"]
  node_bot["Telegram commands<br/>[main.py]"]
  node_alias_store["Chat aliases<br/>[aliases.py]"]
  node_sqlite[("SQLite store")]
end

subgraph group_report["Email reporting"]
  node_report_job["Signal report<br/>[mb_main.py]"]
  node_mail["SMTP sender<br/>[mail.py]"]
end

node_user(("User"))
node_krx[("KRX listings")]
node_yahoo_search["Yahoo search"]
node_yfinance["Yahoo Finance data"]
node_telegram(("Telegram user"))
node_scheduler["Scheduled runner"]
node_smtp["SMTP service"]
node_recipient(("Email recipient"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_searchbar
node_searchbar -->|"searches"| node_api_client
node_dashboard -->|"requests analysis and price"| node_api_client
node_dashboard -->|"renders"| node_analysis_view
node_dashboard -->|"renders"| node_price_view
node_analysis_view -->|"renders"| node_signal_card
node_analysis_view -->|"renders"| node_stats_table
node_analysis_view -->|"renders"| node_price_chart
node_analysis_view -->|"renders"| node_return_chart
node_api_client -->|"calls"| node_api
node_api -->|"validates responses"| node_schemas
node_api -->|"resolves queries"| node_resolver
node_api -->|"loads prices"| node_price_service
node_api -->|"runs analysis"| node_analysis_service
node_resolver -->|"searches candidates"| node_ticker_search
node_resolver -->|"looks up listings"| node_krx
node_ticker_search -->|"queries"| node_yahoo_search
node_price_service -.->|"fetches market data"| node_yfinance
node_analysis_service -->|"builds analysis"| node_strategy
node_telegram -->|"sends commands"| node_bot
node_bot -->|"requests price and signals"| node_api
node_bot -->|"manages aliases"| node_alias_store
node_alias_store -->|"reads and writes"| node_sqlite
node_scheduler -->|"starts"| node_report_job
node_report_job -->|"uses strategy"| node_strategy
node_report_job -->|"sends report"| node_mail
node_mail -->|"delivers email"| node_smtp
node_smtp -->|"delivers"| node_recipient

click node_dashboard "https://github.com/internalforces/quant_al/blob/master/frontend/src/App.jsx"
click node_searchbar "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/SearchBar.jsx"
click node_api_client "https://github.com/internalforces/quant_al/blob/master/frontend/src/api/client.js"
click node_analysis_view "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/AnalysisResult.jsx"
click node_price_view "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/StockPrice.jsx"
click node_signal_card "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/SignalCard.jsx"
click node_stats_table "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/StatsTable.jsx"
click node_price_chart "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/PriceChart.jsx"
click node_return_chart "https://github.com/internalforces/quant_al/blob/master/frontend/src/components/ReturnChart.jsx"
click node_api "https://github.com/internalforces/quant_al/blob/master/backend/routers/analysis.py"
click node_schemas "https://github.com/internalforces/quant_al/blob/master/backend/schemas/models.py"
click node_resolver "https://github.com/internalforces/quant_al/blob/master/backend/services/ticker_resolver.py"
click node_ticker_search "https://github.com/internalforces/quant_al/blob/master/backend/services/ticker_search.py"
click node_price_service "https://github.com/internalforces/quant_al/blob/master/backend/services/price.py"
click node_analysis_service "https://github.com/internalforces/quant_al/blob/master/backend/services/analysis.py"
click node_strategy "https://github.com/internalforces/quant_al/blob/master/backend/services/strategy.py"
click node_bot "https://github.com/internalforces/quant_al/blob/master/telegram_bot/main.py"
click node_alias_store "https://github.com/internalforces/quant_al/blob/master/telegram_bot/aliases.py"
click node_report_job "https://github.com/internalforces/quant_al/blob/master/mb_main.py"
click node_mail "https://github.com/internalforces/quant_al/blob/master/module/mail.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_dashboard,node_searchbar,node_api_client,node_analysis_view,node_price_view,node_signal_card,node_stats_table,node_price_chart,node_return_chart,node_user,node_telegram toneBlue
class node_api,node_schemas,node_resolver,node_ticker_search,node_price_service,node_analysis_service,node_strategy,node_krx toneAmber
class node_bot,node_alias_store,node_sqlite toneMint
class node_report_job,node_mail toneRose
class node_yahoo_search,node_yfinance,node_scheduler,node_smtp,node_recipient toneIndigo
```

## Components

### Web dashboard

- [Dashboard](https://github.com/internalforces/quant_al/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Ticker search](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/SearchBar.jsx): `frontend/src/components/SearchBar.jsx`
- [API client](https://github.com/internalforces/quant_al/blob/master/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Analysis view](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/AnalysisResult.jsx): `frontend/src/components/AnalysisResult.jsx`
- [Price view](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/StockPrice.jsx): `frontend/src/components/StockPrice.jsx`
- [Signal card](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/SignalCard.jsx): `frontend/src/components/SignalCard.jsx`
- [Stats table](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/StatsTable.jsx): `frontend/src/components/StatsTable.jsx`
- [Price chart](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/PriceChart.jsx): `frontend/src/components/PriceChart.jsx`
- [Return chart](https://github.com/internalforces/quant_al/blob/master/frontend/src/components/ReturnChart.jsx): `frontend/src/components/ReturnChart.jsx`

### API and analysis

- [FastAPI routes](https://github.com/internalforces/quant_al/blob/master/backend/routers/analysis.py): `backend/routers/analysis.py`
- [Response schemas](https://github.com/internalforces/quant_al/blob/master/backend/schemas/models.py): `backend/schemas/models.py`
- [Ticker resolver](https://github.com/internalforces/quant_al/blob/master/backend/services/ticker_resolver.py): `backend/services/ticker_resolver.py`
- [Yahoo search client](https://github.com/internalforces/quant_al/blob/master/backend/services/ticker_search.py): `backend/services/ticker_search.py`
- [Price lookup](https://github.com/internalforces/quant_al/blob/master/backend/services/price.py): `backend/services/price.py`
- [Signal analysis](https://github.com/internalforces/quant_al/blob/master/backend/services/analysis.py): `backend/services/analysis.py`
- [MB strategy](https://github.com/internalforces/quant_al/blob/master/backend/services/strategy.py): `backend/services/strategy.py`

### Telegram bot

- [Telegram commands](https://github.com/internalforces/quant_al/blob/master/telegram_bot/main.py): `telegram_bot/main.py`
- [Chat aliases](https://github.com/internalforces/quant_al/blob/master/telegram_bot/aliases.py): `telegram_bot/aliases.py`
- **SQLite store**

### Email reporting

- [Signal report](https://github.com/internalforces/quant_al/blob/master/mb_main.py): `mb_main.py`
- [SMTP sender](https://github.com/internalforces/quant_al/blob/master/module/mail.py): `module/mail.py`

### Other components

- **User**
- **KRX listings**
- **Yahoo search**
- **Yahoo Finance data**
- **Telegram user**
- **Scheduled runner**
- **SMTP service**
- **Email recipient**

## Connections

- User → Dashboard: uses (evidence: `README.md`)
- Dashboard → Ticker search: renders (evidence: `frontend/src/App.jsx`)
- Ticker search → API client: searches (evidence: `frontend/src/components/SearchBar.jsx`)
- Dashboard → API client: requests analysis and price (evidence: `frontend/src/App.jsx`)
- Dashboard → Analysis view: renders (evidence: `frontend/src/App.jsx`)
- Dashboard → Price view: renders (evidence: `frontend/src/App.jsx`)
- Analysis view → Signal card: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Analysis view → Stats table: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Analysis view → Price chart: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Analysis view → Return chart: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- API client → FastAPI routes: calls (evidence: `frontend/src/api/client.js`)
- FastAPI routes → Response schemas: validates responses (evidence: `backend/routers/analysis.py`)
- FastAPI routes → Ticker resolver: resolves queries (evidence: `backend/routers/analysis.py`)
- FastAPI routes → Price lookup: loads prices (evidence: `backend/routers/analysis.py`)
- FastAPI routes → Signal analysis: runs analysis (evidence: `backend/routers/analysis.py`)
- Ticker resolver → Yahoo search client: searches candidates (evidence: `backend/services/ticker_resolver.py`)
- Ticker resolver → KRX listings: looks up listings (evidence: `backend/services/ticker_resolver.py`)
- Yahoo search client → Yahoo search: queries (evidence: `backend/services/ticker_search.py`)
- Price lookup → Yahoo Finance data: fetches market data (evidence: `README.md`)
- Signal analysis → MB strategy: builds analysis (evidence: `backend/services/analysis.py`)
- Telegram user → Telegram commands: sends commands (evidence: `README.md`)
- Telegram commands → FastAPI routes: requests price and signals (evidence: `telegram_bot/main.py`)
- Telegram commands → Chat aliases: manages aliases (evidence: `telegram_bot/main.py`)
- Chat aliases → SQLite store: reads and writes (evidence: `telegram_bot/aliases.py`)
- Scheduled runner → Signal report: starts (evidence: `README.md`)
- Signal report → MB strategy: uses strategy (evidence: `mb_main.py`)
- Signal report → SMTP sender: sends report (evidence: `mb_main.py`)
- SMTP sender → SMTP service: delivers email (evidence: `module/mail.py`)
- SMTP service → Email recipient: delivers (evidence: `README.md`)
