Feature/ai predictions#9
Merged
Merged
Conversation
- Gemini AI SDK 의존성 추가 (@google/generative-ai) - Gemini API 클라이언트 구현 (src/lib/gemini.ts) - 예측 데이터 타입 정의 (src/types/prediction.ts) - opponent_predictions 테이블 스키마 추가 - 환경 변수 문서화 (GEMINI_API_KEY)
- FightMatrix 랭킹 크롤러 (src/lib/crawl/fightmatrix-crawler.ts) - UFC 선수 이미지 스크레이퍼 (src/lib/crawl/ufc-image-scraper.ts) - Gemini 기반 예측 생성기 (src/lib/crawl/prediction-generator.ts) - 수동 예측 생성 스크립트 (scripts/generate-predictions.ts) - 초기 캐시 데이터 (cached-predictions.json)
- 예측 상세 페이지 (/[locale]/predictions) - PredictionPreview 홈 미리보기 컴포넌트 - FighterComparison 선수 비교 컴포넌트 - PredictionDetail 상세 분석 카드 - WinProbabilityBar 승률 시각화 - 다국어 번역 추가 (ko.json, en.json) - 선수 플레이스홀더 이미지 추가
- 메인 페이지에 PredictionPreview 섹션 추가 - 헤더 내비게이션에 AI 예측 메뉴 추가 - Cron에 예측 생성 작업 추가 (매일 자동 갱신) - ISR 캐시 무효화 경로 추가 (/predictions)
- description에 '고석현 다음상대' 키워드 추가 - keywords에 '고석현 다음상대', 'AI 고석현 다음 상대 예측' 추가 - Open Graph, Twitter 카드 메타태그 추가 - README 주요 기능/기술 스택/프로젝트 구조 업데이트
- description에 '고석현 다음상대' 키워드 추가 - keywords에 '고석현 다음상대', 'AI 고석현 다음 상대 예측' 추가 - Open Graph, Twitter 카드 메타태그 추가 - README 주요 기능/기술 스택/프로젝트 구조 업데이트
…/lets-ko into feature/ai-predictions
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (21)
📝 WalkthroughWalkthroughGoogle Gemini API를 활용한 다음 상대 예측 기능이 추가됩니다. FightMatrix 순위권 선수들을 크롤링하고 AI 분석을 통해 최상의 대전 상대를 선정하며, 예측 결과를 데이터베이스와 캐시에 저장하고 새로운 예측 페이지와 홈페이지 위젯에서 표시합니다. Changes
Sequence DiagramsequenceDiagram
participant Cron as Cron Job
participant PredGen as Prediction<br/>Generator
participant FM as FightMatrix<br/>Crawler
participant Gemini as Gemini<br/>API
participant UFC as UFC<br/>Image Scraper
participant DB as Supabase<br/>DB
participant Cache as Cached<br/>JSON
Cron->>PredGen: generatePredictions()
PredGen->>DB: fetch latest fighter_stats
alt Stats available
DB-->>PredGen: stats data
else Stats unavailable
PredGen->>Cache: load cached-stats.json
Cache-->>PredGen: stats data
end
PredGen->>FM: crawlFightMatrixCandidates(rank)
FM->>FM: fetch & parse FightMatrix pages
FM-->>PredGen: candidate list
PredGen->>Gemini: selectOpponents(stats, candidates)
Gemini-->>PredGen: top 3 opponent selections
loop For each selected opponent
PredGen->>UFC: scrapeUfcFighterImage(name)
UFC->>UFC: fetch UFC athlete page
UFC-->>PredGen: image URL
PredGen->>Gemini: analyzeOpponent(stats, opp)
Gemini-->>PredGen: win probability + analysis
end
PredGen->>DB: insert into opponent_predictions
PredGen->>Cache: write cached-predictions.json
Cron->>DB: revalidate /predictions routes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit