Go to file
Haewon Kam 535daa3625 chore: initial scaffolding — Vite + React 19 + Tailwind 4
- 5 pages: Landing, AnalysisStart (MVP 핵심 — 채널 핸들 직접 입력 폼),
  AnalysisLoading (상태 폴링), Report, MarketingPlan
- useAnalysis (POST + 2초 폴링) + useReport (API-only, DEMO_REPORTS 제거)
- 23 report components + types + transform utils (프로토타입에서 이식)
- Tailwind 4 @theme: Pretendard + brand palette (primary-900, accent)
- axios apiClient with X-API-Key interceptor
- Vite proxy /api → localhost:8000 (백엔드 연동)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 10:38:42 +09:00
docs chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
src chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
.env.example chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
.gitignore chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
README.md chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
index.html chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
package.json chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
tsconfig.json chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00
vite.config.ts chore: initial scaffolding — Vite + React 19 + Tailwind 4 2026-04-17 10:38:42 +09:00

README.md

infinith-web

INFINITH 실서비스 프런트엔드. React 19 + Vite 6 + TypeScript + Tailwind 4.

Quick start

# 1. 의존성
npm install

# 2. 환경변수
cp .env.example .env.development
# 기본값으로도 동작 (Vite proxy + API_KEY=change-me-dev-only)

# 3. 백엔드 기동 확인 (별도 터미널)
#    cd ../infinith-api && docker compose up -d
#    curl http://localhost:8000/health

# 4. 프런트 dev 서버
npm run dev
# → http://localhost:5173

Scripts

명령 설명
npm run dev Vite 개발 서버 (port 5173, /api/* 프록시 → :8000)
npm run build 프로덕션 번들 (dist/)
npm run preview 빌드 결과 로컬 확인
npm run lint tsc --noEmit (타입 체크)
npm run gen-types 백엔드 OpenAPI → src/api-types/schema.d.ts 재생성

구조

src/
├─ main.tsx              # React entry + BrowserRouter
├─ App.tsx               # 라우트 정의
├─ index.css             # Tailwind 4 @theme — brand 색상 토큰
├─ pages/                # Landing / AnalysisStart / AnalysisLoading / Report / Plan
├─ components/report/    # 23개 리포트 컴포넌트 (프로토타입에서 복사)
├─ hooks/
│  ├─ useAnalysis.ts     # POST /analyses + 상태 폴링
│  └─ useReport.ts       # GET /reports/{id} — DEMO_REPORTS 하드코딩 제거
├─ lib/
│  ├─ apiClient.ts       # axios + X-API-Key 헤더
│  ├─ transformReport.ts # 프로토타입 이식
│  └─ transformPlan.ts
├─ types/                # report.ts, plan.ts, studio.ts (프로토타입 이식)
└─ api-types/            # openapi-typescript 자동 생성 (gitignored)

타입 동기화 (백엔드 ↔ 프런트)

계약 변경 시:

  1. 백엔드: app/schemas/*.py 수정 + poetry run uvicorn app.main:app 실행
  2. 프런트: npm run gen-typessrc/api-types/schema.d.ts 재생성
  3. 컴포넌트에서 import type { components } from '@/api-types/schema' 로 사용

MVP 기간에는 useAnalysis.ts 등에 로컬 인터페이스도 유지 (참조용). 계약 안정화 시 제거.

관련 문서

프로토타입과 분리 원칙

  • 프로토타입 INFINITH/ 레포는 읽기 전용 참조. 수정 금지 (영업 데모/광고 촬영용 유지)
  • 공유하는 것: types/*.ts, lib/transform*.ts, components/report/* — 파일 복사로 이식
  • useReport.tsDEMO_REPORTS 매핑은 MVP 에서 제거 — API-only

배포 (Vercel)

# 최초 1회
vercel link
vercel env add VITE_API_BASE_URL      # production URL
vercel env add VITE_API_KEY

# 배포
npm run build
vercel --prod