# IR Deck 평가 프론트엔드 초기 설정 **날짜**: 2025-11-28 **작성자**: Claude (AI) **관련 파일**: - `frontend-ir-valuation/src/pages/ir-valuation.tsx` - `nginx-infra/server-nginx-default` - `https://git.ro-being.com/ivada_Ro-being/frontend-ir-valuation.git` --- ## 목적 Sequoia Capital IR 기준으로 IR Deck을 평가하는 프론트엔드 페이지 구축 (ChatGPT 스타일 UI). ## 구현 요약 - **스택**: Vite + React + TypeScript, TailwindCSS, wouter, @tanstack/react-query. - **주요 기능**: PDF 업로드, 진행률·분석 상태 표시, 페이지별 강점·약점, 종합 점수·등급 (S/A/B/C). - **SPA 라우팅** (`src/App.tsx`): base‑path `/ir-valuation` 제거 후 라우팅 처리. ```tsx function Router() { const [location] = useLocation(); const base = "/ir-valuation"; const normalized = (location.startsWith(base) ? location.slice(base.length) : location) || "/"; return (
404 Not Found
} />
); } ``` ## Nginx 설정 (`nginx-infra/server-nginx-default`) ```nginx location /ir-valuation { alias /home/admin/frontend-ir-valuation/dist/; try_files $uri /ir-valuation/index.html; } location ^~ /rb8001/ { proxy_pass http://192.168.219.52:8001/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 300s; proxy_connect_timeout 75s; proxy_send_timeout 300s; } ``` ## API 사용 예시 ```bash curl -X POST http://localhost/rb8001/api/ir-deck/evaluate \ -H "Content-Type: application/json" \ -H "X-Team-Id: " \ -H "X-User-Id: " \ -d '{"document_id":"","team_id":""}' ``` ## 교훈 - **핵심만**: 중복·불필요한 설명 제거, 링크로 대체. - **헤더 필수**: `X-Team-Id`, `X-User-Id` 없으면 API 동작 안 함. - **SPA 라우팅**: Nginx base‑path와 React 라우터 일치 필요. ## 다음 작업 - 피드백 UI 구현 (`src/pages/ir-valuation.tsx`). - 백엔드 피드백 API 연동 (`/rb8001/api/ir-deck/feedback`). - Sequoia 10가지 기준 실제 평가 로직 구현. ## ChatGPT 스타일 디자인 개선 항목 (2025-11-29) ### Critical 수정 필요 1. **헤더 제거** - `ir-valuation.tsx:380-405`: ChatGPT는 헤더 없음 2. **본문 텍스트 크기** - `index.css:52`: 14px → 16px 3. **입력 박스** - `ir-valuation.tsx:571-584`: 높이 52px → 56-60px, border-radius 증가 4. **메시지 버블** - `ir-valuation.tsx:459-465`: `rounded-lg` → `rounded-xl/2xl`, 패딩 증가 5. **사용자 메시지 색상** - `ir-valuation.tsx:463`: `bg-blue-500` → `bg-gray-700/800` ### High 개선 6. **행간 설정** - `index.css`: `line-height: 1.6-1.8` 7. **컨텐츠 최대 너비** - `ir-valuation.tsx:410`: `max-w-2xl` (672px) → `max-w-3xl` (768px) 8. **색상 팔레트** - 배경색: `bg-gray-50` → `#F7F7F8` 유사 색상 --- ## React 구조 원칙 리팩토링 (2025-11-29) ### 변경 사항 - **API 통신 분리**: `services/irDeckService.ts` - 모든 API 호출 중앙화 - **비즈니스 로직 분리**: `hooks/useFileUpload.ts`, `hooks/useEvaluation.ts` - 커스텀 훅으로 로직 추출 - **UI 컴포넌트 분리**: `components/features/FileMessage.tsx` - 파일 메시지 전용 컴포넌트 - **타입 정의**: `types/message.ts` - Message 인터페이스 확장 (파일 정보 포함) ### UX 개선 - 파일 업로드를 채팅 메시지 버블로 표시 (진행률 포함) - 파일 업로드 후 자동 평가 시작 제거, 사용자 입력 대기 - 사용자 메시지 전송 시 파일과 함께 평가 시작 ### 교훈 - React 구조 원칙 준수: 계층 분리 (UI → Hooks → Services) - 컴포넌트 단일 책임: 897줄 파일을 기능별로 분리 - 사용자 제어권: 파일 업로드 후 즉시 평가가 아닌 사용자 확인 후 진행