feat(markets): /api/markets/movers + /related/{code} + 홈/종목 페이지 연동

backend:
  - 신규 라우터 app/api/markets.py
  - GET /api/markets/movers?market=ALL|KOSPI|KOSDAQ&limit=10
    → gainers / losers / by_volume 3 카테고리. ohlcv_daily 최신 2 거래일 비교.
  - GET /api/markets/related/{code}?limit=8
    → 같은 market 내 거래량 상위 (sector 컬럼은 시드 단계 NULL 다수라 제외).
  - main.py 에 라우터 include.

frontend:
  - lib/api.ts 에 Mover/MoversResponse/RelatedResponse 타입 + .movers/.related 추가.
  - components/MarketsOverview.tsx: 등락 상위 / 등락 하위 / 거래량 상위 3 컬럼.
  - components/RelatedStocks.tsx: 같은 시장 내 관련 종목 8 개.
  - 홈 페이지에 MarketsOverview 배치 (SeedTiles 아래).
  - 종목 페이지 우측 사이드바 컬럼에 RelatedStocks 추가 (SymbolSidebar 아래).

verify: py_compile clean, tsc --noEmit clean, next lint clean.
This commit is contained in:
claude
2026-05-28 01:36:13 +09:00
parent 04358469d1
commit 21db09f65f
7 changed files with 441 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import { NewsList } from "../../components/NewsList";
import { PeriodTabs, periodSpec, type Period } from "../../components/PeriodTabs";
import { PredictionPanel } from "../../components/PredictionPanel";
import { PriceHero } from "../../components/PriceHero";
import { RelatedStocks } from "../../components/RelatedStocks";
import { StockChart } from "../../components/StockChart";
import { SymbolSidebar } from "../../components/SymbolSidebar";
import { api, type ChartPayload, type LatestPredictionResponse } from "../../lib/api";
@@ -119,7 +120,10 @@ export default function CodePage({ params }: { params: { code: string } }) {
<PredictionPanel code={code} initial={prediction} onResult={setPrediction} />
</div>
</div>
<SymbolSidebar code={code} />
<div className="space-y-4">
<SymbolSidebar code={code} />
<RelatedStocks code={code} />
</div>
</div>
<div className="mt-6 grid gap-6 md:grid-cols-2">
<MetricsPanel code={code} />