scanNBA 多聯盟盤口系統

scanNBA 多聯盟盤口系統 An architecture diagram generated by Archify. LINE Platform · Webhook + Messaging API · Architecture component LINE Platform Webhook + Messaging API Dashboard SPA · React + Vite · Architecture component · /{league}/dashboard Dashboard SPA React + Vite /{league}/dashboard Telegram · KBO 得分監控 · Architecture component Telegram KBO 得分監控 Cloudflare + nginx · sports.relexes.com · GCP VM line-bot (asia-east1-b) · TLS Full (strict) Cloudflare + nginx sports.relexes.com TLS Full (strict) League Registry · LeagueProfile · nba / mlb / kbo · GCP VM line-bot (asia-east1-b) League Registry LeagueProfile · nba / mlb / kbo Gin Router + Handler · /{league}/api/v1/* · GCP VM line-bot (asia-east1-b) Gin Router + Handler /{league}/api/v1/* Cron Scheduler · 每聯盟一組 · 台灣時間 · GCP VM line-bot (asia-east1-b) Cron Scheduler 每聯盟一組 · 台灣時間 claude-agent · 共用 AI 服務 · GCP VM line-bot (asia-east1-b) · lexnet claude-agent 共用 AI 服務 lexnet Service 層 · odds / game / ai / bet / stats · GCP VM line-bot (asia-east1-b) Service 層 odds / game / ai / bet / stats 賽事 / 盤口資料源 · ESPN · MLB statsapi · Naver · Architecture component 賽事 / 盤口資料源 ESPN · MLB statsapi · Naver Redis · {league}: prefix · 全 key 帶 TTL · GCP VM line-bot (asia-east1-b) Redis {league}: prefix · 全 key 帶 TTL PostgreSQL · scannba · GORM · GCP VM line-bot (asia-east1-b) PostgreSQL scannba · GORM HTTPS Webhook 反向代理 Repository / GORM 快取讀寫 HTTP · AI 分析 HTTP 爬取 定時觸發 註冊 enabled 聯盟 盤口異動推播 得分事件 GCP VM line-bot (asia-east1-b) Legend Frontend Backend Database Security External

對外入口

  • • Cloudflare 橘雲代理,SSL 模式 Full (strict)
  • • nginx 把 sports.relexes.com 整個 / 轉給服務
  • • Dashboard 與 LINE webhook 共用同一入口

多聯盟抽象

  • • LeagueProfile 統一日期換算:NBA 落庫日期 = 台灣日期 −1
  • • 帶 league 欄位的表,唯一鍵皆為 (league, ...) 複合鍵
  • • Redis key 由 profile 給 prefix,全部必須有 TTL

排程與 AI

  • • AI 分析走共用 claude-agent,併發上限 5 場
  • • KBO 得分監控每分鐘掃進行中比賽,去重靠 Redis 旗標
  • • 資料保留天數由 retention config 控制,每日 06:00 清理