[FEAT] DockerFile 작성 및 임시 배포 - #19
Conversation
전체 관계망(GNB 탭)이 API/TanStack Query 없이 mocks/graph/graph.json을 클라이언트에서 직접 읽어 렌더링하도록 변경. 뉴스별 파급 경로가 쓰는 mocks/graph/data.ts(CONCEPT 노드 포함 데모 데이터)와는 완전히 분리된 데이터셋이라 GraphCanvas가 모드별로 올바른 GraphIndex를 쓰도록 index prop을 추가함. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
GET /news, GET /news/{id}/impact 두 API의 wire 응답을 문서에 명시된 형태로
맞춤. news 리스트는 news/hasNext/lastCursorId(+url) 스키마로, 뉴스 영향
그래프는 graph.json과 동일한 {id,name,ticker,capSize,marketType} 노드
스키마로 통일해 kind/relationType/direction을 wire에서 제거하고 매퍼에서
복원하도록 변경. capSize↔marketCap 변환은 shared/utils/format.ts로 공용화.
개념 노드(HBM 등)는 wire에서 STOCK과 구분되지 않으므로 이제 일반 종목
카드로 렌더링된다(그래프 스키마를 GET /graph?mode=full과 통일하기 위한
의도된 트레이드오프).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- GraphPanel.tsx: RelFlowEdge.data가 옵셔널이라 prev.data 접근 전 null 체크 누락으로 발생하던 TS18048 4건 수정(prev?.data로 가드). - NewsPanel.tsx: useRef<number>()가 초기값 없이 호출돼 TS2554 발생 — useRef<number | undefined>(undefined)로 명시. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
전체 관계망(mode='all')의 gbar에 이름/티커로 필터링되는 검색창을 추가. 결과 선택 시 setHighlightedNode(id)를 그대로 호출해 해당 노드를 클릭한 것과 동일하게 2단계 파급 강조·fitView가 재생되도록 함(GraphSearch가 GraphCanvas가 이미 들고 있는 index prop을 그대로 재사용). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
검색창이 gbar 텍스트·버튼들 사이에 묻혀 눈에 잘 안 띄던 문제 수정. gbar에서 캔버스 우상단 오버레이(legend/tip과 같은 레이어)로 옮기고, 검색 아이콘·지우기 버튼·그림자를 추가해 항상 같은 자리에서 눈에 띄게 함. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
import.meta.env.PROD(빌드 타임에 Vite가 심어주는 값, 환경변수 설정 불필요) 기준으로 MSW 기동을 게이팅해 프로덕션 빌드에서는 MSW를 아예 띄우지 않고 dead-code로 번들에서도 제외되게 함. 개발 서버에서만 MSW가 /api/*를 가로챈다. VITE_API_BASE_URL을 쓰지 않기로 하여 관련 분기·설정을 모두 제거: - http.ts: prefix를 '/api' 고정값으로 단순화 - Dockerfile/ci.yaml: ARG/ENV/--build-arg 제거(어차피 기본값과 동일했음) - .env.production.example 삭제(더 이상 설정할 게 없음) 프로덕션에서는 nginx.conf의 location /api/ 프록시가 같은 오리진 /api 요청을 koslink-backend-app 실 백엔드로 그대로 전달한다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (26)
📝 WalkthroughWalkthrough뉴스 및 영향도 API 와이어 계약이 문서·목·매퍼·호출부에 반영되었습니다. 정적 전체 그래프 데이터와 검색 UI가 추가되었고, 그래프 인덱스 주입 방식 및 API 실행 구성이 변경되었습니다. Changes뉴스 API 계약
영향도 그래프 계약
전체 그래프 UI
API 실행 구성
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Trivy (0.72.0)Trivy execution failed: 2026-07-28T15:15:49Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: helm scan error: fs filter error: fs filter error: walk error range error: stat doctor.config.json: no such file or directory: range error: stat doctor.config.json: no such file or directory Comment |
👥 작업 배경 및 목적
/api/프록시로 실 백엔드를 바라보도록 전환.🛠️ 주요 변경 사항
전체 관계망 — graph.json 기반으로 교체
src/mocks/graph/graph.json: 전체 관계망 실데이터(종목 노드 + 관계 엣지) 정적 파일 추가src/mocks/graph/fullGraph.ts: graph.json →OntologyNode/OntologyEdge매핑 (capSize→marketCap 환산, 영문 relation 상수 한글 라벨링, relationType 추론)src/utils/graph/layout.ts:fullLayout/tierOf를 파라미터화해 전체 관계망 전용 데이터와 기존 뉴스별 데모 데이터를 분리src/components/graph/GraphPanel.tsx:fullGraphIndex추가,GraphCanvas에indexprop 도입해 뉴스별 파급 경로 뷰와 전체 관계망 뷰가 각자의 데이터셋을 참조하도록 리팩터링src/components/graph/NetworkView.tsx:useGraphQuery(API) 제거 — graph.json 데이터를 클라이언트에서 정적으로 바로 사용src/shared/components/Header.tsx: 노드/엣지 카운트 배지를 graph.json 데이터 기준으로 변경전체 관계망 — 종목 검색 추가
src/components/graph/GraphSearch.tsx(신규) : 이름/티커 검색 후 선택 시 노드 클릭과 동일하게 하이라이트되는 검색 컴포넌트src/components/graph/graph.css: 캔버스 우상단 오버레이 형태의 검색 UI 스타일API 명세 정비 (news / news 영향 분석)
docs/KOSLINK_API.md:GET /news,GET /news/{id}/impact실 API 명세 문서 추가src/apis/news/mock.ts,src/apis/news/mappers.ts,src/apis/news/queries.ts: 응답을news/hasNext/lastCursorId(+url) 스키마로 정비, 쿼리 파라미터cursorId/size로 변경src/mocks/news/handlers.ts: MSW 핸들러 쿼리 파라미터 파싱 업데이트src/apis/analysis/mock.ts,src/apis/analysis/mappers.ts: 뉴스 영향 그래프를{id,name,ticker,capSize,marketType}스키마로 통일,kind/relationType/direction은 매퍼에서 복원src/shared/utils/format.ts:capSizeToMarketCap/marketCapToCapSize공용 변환 헬퍼 추가src/types/graph/index.ts:CapSize/MarketType타입 추가src/types/news/index.ts:NewsListItem에url필드 추가src/routes/app.tsx:getNews()응답 필드명 변경분 반영프로덕션 배포 — MSW 비활성화, nginx 프록시로 전환
src/main.tsx:import.meta.env.PROD기준으로 MSW 기동 게이팅(프로덕션 빌드는 MSW 미기동, 번들에서도 제외)src/shared/apis/http.ts: API prefix를/api고정값으로 단순화Dockerfile,.github/workflows/ci.yaml: 더 이상 쓰지 않는VITE_API_BASE_URLARG/ENV/빌드 인자 제거.env.production.example: 삭제(설정할 환경변수 없음)기타
src/components/news/NewsPanel.tsx:useRef초기값 누락 타입 에러 수정tsconfig.json:resolveJsonModule활성화 (graph.json import 지원)🧪 테스트 결과 (선택)
pnpm lint,tsc --noEmit클린pnpm build && pnpm preview로 프로덕션 빌드에서 MSW 미기동·번들 제외 확인Summary by CodeRabbit
새 기능
개선
/api를 통해 안정적으로 연결됩니다.문서