UI: - web/lib/api.ts: 백엔드 모든 엔드포인트의 클라이언트 + 타입 (Symbol, ChartPayload, PredictResponse, LatestPredictionResponse, MetricsResponse, NewsResponse). NEXT_PUBLIC_API_BASE 자동 정규화. - web/components/SearchBox: 디바운스 검색, seed_only 토글, trigram + prefix. - web/components/StockChart: lightweight-charts 캔들 + 예측 overlay (median dashed + q10/q90 점선). base_date 에서 target_date 까지 이어 붙임. - web/components/PredictionPanel: "예상차트 보기" 버튼 → POST /api/predict → user_triggered=TRUE 저장 → onResult 콜백으로 StockChart 에 반영. 표로 +1/+3/+5거래일 direction, prob_up/flat/down, expected_return, ci_low~ci_high 표시. - web/components/MetricsPanel: 최근 30일 hit_rate / mae. - web/components/NewsList: 최근 뉴스 + 감성 라벨/점수. - web/app/page.tsx: 검색 페이지. - web/app/[code]/page.tsx: 종목 상세 (차트 + 패널 + 메트릭 + 뉴스). TypeScript 보강 (사용자 요청 "typescript도 추가해서 나중에 수정하기 쉽게"): - tsconfig.json: strict 외에 forceConsistentCasingInFileNames, noFallthroughCasesInSwitch, noImplicitOverride 추가. - package.json: typecheck (tsc --noEmit), check (typecheck + lint) 스크립트, eslint + eslint-config-next 14.2.3. - .eslintrc.json: next/core-web-vitals. - package-lock.json 커밋 (재현 가능한 dep). 백엔드: - pyproject.toml: [tool.mypy] 추가. strict_optional, no_implicit_optional, check_untyped_defs. 3rd-party stub 없는 pykrx/chronos 등은 ignore. 검증: `npx tsc --noEmit` 통과 (exit=0). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
85 lines
1.8 KiB
TOML
85 lines
1.8 KiB
TOML
[project]
|
|
name = "stock_chart_site_backend"
|
|
version = "0.0.1"
|
|
description = "Stock chart + prediction backend (FastAPI + Chronos + LightGBM + KR-FinBERT)"
|
|
requires-python = ">=3.11,<3.13"
|
|
|
|
dependencies = [
|
|
# web
|
|
"fastapi==0.111.0",
|
|
"uvicorn[standard]==0.30.0",
|
|
"pydantic==2.7.1",
|
|
"pydantic-settings==2.3.0",
|
|
|
|
# db
|
|
"sqlalchemy==2.0.30",
|
|
"psycopg[binary]==3.1.19",
|
|
"alembic==1.13.1",
|
|
|
|
# data
|
|
"pandas==2.2.2",
|
|
"numpy==1.26.4",
|
|
"pykrx==1.0.45",
|
|
"yfinance==0.2.40",
|
|
"feedparser==6.0.11",
|
|
"requests==2.32.3",
|
|
"httpx==0.27.0",
|
|
"beautifulsoup4==4.12.3",
|
|
"lxml==5.2.2",
|
|
|
|
# ml
|
|
"transformers==4.41.2",
|
|
"tokenizers==0.19.1",
|
|
"sentencepiece==0.2.0",
|
|
"accelerate==0.30.1",
|
|
"chronos-forecasting==1.4.1",
|
|
"scikit-learn==1.5.0",
|
|
"lightgbm==4.3.0",
|
|
"ta==0.11.0",
|
|
"joblib==1.4.2",
|
|
|
|
# scheduler
|
|
"apscheduler==3.10.4",
|
|
"pytz==2024.1",
|
|
|
|
# utils
|
|
"python-dotenv==1.0.1",
|
|
"loguru==0.7.2",
|
|
"tenacity==8.3.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest==8.2.1",
|
|
"ruff==0.4.7",
|
|
"mypy==1.10.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["app*"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
strict_optional = true
|
|
warn_unused_ignores = true
|
|
warn_redundant_casts = true
|
|
warn_unreachable = true
|
|
ignore_missing_imports = true # 3rd-party stub 부족 무시 (pykrx, chronos, ta, feedparser ...)
|
|
no_implicit_optional = true
|
|
show_error_codes = true
|
|
exclude = ["build", "dist", ".venv"]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["app.*"]
|
|
disallow_untyped_defs = false # 점진적 도입. 핵심 모듈만 strict 로 올릴 예정.
|
|
check_untyped_defs = true
|