Commit Graph

14 Commits (4e1ebc898978cff03cb4316873758bfcf72e7b7d)

Author SHA1 Message Date
jwkim 4e1ebc8989 feat: KBO/MLB 운영 안정화 — 순위 탭·라이브 개선·취소/더블헤더 지원·야구 점수제
AI 예측
- 생성 시점을 킥오프 22시간 전으로 변경(선발투수 예고 이후), 잡 매시간 실행
- 경기 시작 후 생성 금지(사후 예측 방지), 경기 단위 커밋으로 중단 시 진행분 보존

일정·라이브 UI
- 야구 일정에 순위 탭 추가 (KBO 단일 순위표 · MLB 6개 디비전, /api/standings 신설)
- 경기중 카드에 현재 이닝·실시간 스코어 표시 (30s 폴링, 서버 15s 캐시)
- MLB 선발 누락 수정: statsapi 날짜 파라미터 미국 날짜 기준 보정(-1일)
- 라이브 대기타석 스크롤바 다크 테마 처리

운영 견고성
- 우천취소: 경기 삭제 → cancelled 상태 보존 (투표·예측 기록 유지, 정산/투표/AI 제외)
- 더블헤더: 시작시각순 seq로 1·2차전 분리 등록 (match_id _2, 정산·라이브·프리뷰 매핑)
- 축구 데이터 수집을 wc 리그로 한정 (야구 팀을 축구 API에 검색하던 쿼터 낭비 수정)

점수제
- 야구 판정 완화: 근접=득실차 ±1, 부분=한 팀 득점 ±1 (등급·배점은 리그 공통 유지)
- 채점 판정을 _grade_of() 단일 함수로 통합, 종료된 야구 경기 재채점
- 배점 안내 모달 야구 문구 분리, docs/SCORING.md 갱신

기타
- 야구 전용 댓글 닉네임 풀 (종목별 세션 캐시 분리)
- 리더보드 리그별 조회 연동 (?league=)
2026-07-22 11:01:10 +09:00
jwkim 6815540ae6 토너먼트 대진 추가 2026-06-29 09:11:58 +09:00
jwkim 7625db36a0 API-Football 데이터 수집 로직 변경 2026-06-16 09:31:29 +09:00
jwkim dc262009f9 Speed up football refresh (batch 24) + skip caching on API errors 2026-06-15 16:08:30 +09:00
jwkim 4246ad6936 Add data-driven AI predictions via API-Football
- football_data.py: 수집·캐싱·데이터블록 조립 (48팀 ID/FIFA랭킹)
- FootballCache 테이블: 폼·H2H·스쿼드 캐시 (외부 DB)
- 프롬프트에 랭킹·폼·H2H·스쿼드·WC실제결과 주입
- 키 없으면 기존(이름만) 동작 폴백, 무료 한도 점진 수집
2026-06-15 15:49:34 +09:00
hbyang c77d014a01 Fix auto-settle for non-Group-A: map results by TLA, not full name
_results_football_data resolved team codes via code_for(full name), which
only covered Group A teams, so FINISHED matches in other groups (e.g.
Canada vs Bosnia-Herzegovina) were silently dropped and never settled.
Use tla -> code_for_tla (same as schedule ingestion; covers all 48), with
full-name fallback. Verified: source FINISHED 2 -> 3, CAN-BIH settles 1-1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 10:58:33 +09:00
hbyang 1d406f6a4e Diversify AI predictions via per-model analyst personas
GPT (data-driven), Claude (tactical/upset-aware), Gemini (attacking-minded)
each get a distinct perspective so the 3 picks genuinely diverge instead of
producing identical scorelines. Honest: still each model's own judgment.
Finished matches are untouched (generation filters result_outcome IS NULL).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 17:33:59 +09:00
hbyang deb1332440 Load all 12 groups' schedule (72 matches) + Naver-style schedule UI
Backend
- teams_data.py: 48-team data (ko/short/en), TLA→FIFA code remap
- config: schedule_all_groups, featured_group("A") — only featured group is votable/AI-predicted
- schedule_fetch: fetch all GROUP_STAGE matches from football-data, KST serialize
- schedule_sync: ingest all groups, unordered-pair match to avoid Group A dup, derive votable from group
- worker: AI generation limited to featured group; settle still covers all
- domain/predictions: is_votable() + MatchOut.votable; reject non-votable submits with 403 MATCH_NOT_VOTABLE

Frontend
- types: Match.votable
- ScheduleBoard: Naver-style date/group tabs + chips; votable(A) cards link to detail with AI split + 참여수, others display-only

Verified: 72 matches (12×6), Group A not duplicated, votable A=6/others=66; A submit 200, B submit 403

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 14:56:24 +09:00
hbyang 54ed8bf10d feat(settle): 결과 소스를 일정 소스와 분리(RESULT_SOURCE) + 순서 무관 매칭
- RESULT_SOURCE(비우면 SCHEDULE_SOURCE) 추가 — 일정=openfootball, 결과=football-data 가능
- fetch_results 가 result_source 사용
- 자동 정산 매칭을 홈/원정 순서 무관하게 보강(소스 순서 달라도 스코어 정합)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 09:41:36 +09:00
hbyang 4244518ffd feat(worker): 경기 결과 자동 정산 + '맞춘 사람만' 결과 메일
- 킥오프+result_settle_hours 경과 경기를 외부 스코어로 자동 채점(settle_matches)
- schedule_fetch.fetch_results: openfootball/football-data 확정 스코어 수집
- 결과 메일을 승패 적중자에게만 발송하는 옵션(result_email_correct_only)
- 스케줄러에 settle 잡 추가 + 기동 시 1회 밀린 경기 정산

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 14:25:23 +09:00
hbyang 5f8858c978 fix(ai): 월드컵 중립 경기장 명시 — 잘못된 '홈 이점' 예측 근거 수정
AI 프롬프트가 Team A를 home으로 단정해 "홈 경기 이점" 같은 오류 근거가
생성됨. 조별리그는 중립 경기장(개최국 멕시코/미국/캐나다만 홈)임을 명시.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 11:50:36 +09:00
hbyang 7185cfbb72 mail config 적용 . 2026-06-11 09:21:10 +09:00
jwkim 1a803b7fa0 포인트 시스템 추가, 프론트 국기 반영 2026-06-10 15:11:56 +09:00
hbyang 6ffe0dfca3 Refactor: Next.js+Firebase → React(Vite) + FastAPI + PostgreSQL
- 백엔드: FastAPI + SQLAlchemy(async) + PostgreSQL, 별도 워커(APScheduler)
- 프론트: React 19 + Vite + TS + Tailwind v4 (기존 UI 이식, API 연동)
- docker-compose: db · api · worker · frontend 일괄 실행
- 경기 일정: openfootball 매일 09:00 크롤링 → DB upsert (신규 경기 자동 삽입+예측 생성)
- AI 예측: GPT·Claude·Gemini 실 API 매일 생성 → DB 저장 → 조회 (목데이터 제거)
- 투표창: 오픈 킥오프 D-2 / 마감 킥오프 1시간 전, lockAt 백엔드 전달→프론트 카운트다운
- 채점/리더보드: docs/SCORING.md 기준 누적 포인트
- crowd: 0 시작, 실제 제출로만 증분
- 구 Next.js/Firebase 파일 제거, README/AGENTS 갱신

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 13:04:35 +09:00