惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
量子位
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a Real-Time World Cup 2026 Bracket Predictor wit...
Ryo Kurita · 2026-06-25 · via DEV Community

Ryo Kurita

Introduction
With the World Cup 2026 group stage reaching its climax, football fans worldwide are speculating about who will make it to the finals. To make this experience interactive, I built a fully dynamic World Cup 2026 Bracket Simulator.

Instead of just letting users click and choose winners, this app dynamically calculates ELO win probabilities and probabilistically generates realistic match scores (including extra time and penalties) based on team ratings. It also syncs with live match data in real-time.

Live URL: https://worldcup-predict2026.github.io/champion/
Tech Stack: Vanilla JS, CSS3 (3D parallax), GitHub Actions, Python, football-data.org API
Core Features & Technical Implementation

  1. ELO-Based Win Probability & Score Simulation Each team in the database is assigned an ELO-based strength rating. When a user runs the AI auto-prediction, the script calculates win probability and generates a realistic scoreline.

Here is the goal roll algorithm (Poisson-like simulation) implemented in Vanilla JS:

javascript

function generateMatchScore(team1, team2, winner) {
if (team1 === "TBD" || team2 === "TBD" || !winner) return null;

const s1 = teamStrengths[team1] || 70;
const s2 = teamStrengths[team2] || 70;
const winnerIsTeam1 = (winner === team1);

const strengthDiff = Math.abs(s1 - s2);
const baseGoalExpected = 1.1;
const bonusGoal = Math.min(1.8, strengthDiff / 12.0); // Goal weight based on ELO difference

const rollGoals = (lambda) => {
let L = Math.exp(-lambda);
let k = 0;
let p = 1.0;
do {
k++;
p *= Math.random();
} while (p > L && k < 10);
return k - 1;
};

let gWin = 0;
let gLose = 0;
const r = Math.random();
if (r < 0.75) {
// Regular time win (90 mins)
gLose = rollGoals(baseGoalExpected);
gWin = gLose + 1 + rollGoals(0.7 + bonusGoal);
return winnerIsTeam1 ? ${gWin} - ${gLose} : ${gLose} - ${gWin};
} else if (r < 0.92) {
// Extra time win (AET)
const normalGoals = rollGoals(baseGoalExpected);
gLose = normalGoals;
gWin = normalGoals + 1;
return winnerIsTeam1 ? ${gWin} - ${gLose} (AET) : ${gLose} - ${gWin} (AET);
} else {
// Penalty shootout win (PK)
const finalGoals = rollGoals(baseGoalExpected + 0.3);
const pkWin = 3 + Math.floor(Math.random() * 3);
const pkLose = pkWin - 1 - (Math.random() < 0.25 ? 1 : 0);
return winnerIsTeam1
? ${finalGoals} - ${finalGoals} (${pkWin}-${pkLose} PK)
: ${finalGoals} - ${finalGoals} (${pkLose}-${pkWin} PK);
}
}
This logic yields realistic outcomes, ranging from intense 3 - 2 battles to stressful 1 - 1 (4-3 PK) penalty shootouts.

  1. Bypassing API Rate Limits via GitHub Actions (Serverless Sync) We integrate with the football-data.org API to fetch live standings and scores. However, the free tier limits us to 10 requests per minute. To keep client-side updates real-time without hitting rate limits, I built a hybrid synchronization pipeline:

Backend (GitHub Actions): A Python script runs every 30 minutes on a cron job, fetches the latest standings and matches, and pushes updated static JSON files (live_standings.json & live_matches.json) back to the repository.
Client (Vanilla JS): While a user is on the site, the browser fetches these local JSON files every 15 seconds (the maximum safe frequency). This client-side reloading syncs live states without hitting the external API servers directly.

  1. Mathematical Elimination Filtering As the group stages progress, some teams become mathematically unable to qualify for the round of 32.

The client-side script calculates the maximum possible points each team can achieve (current points + remaining games * 3) and compares it to the cutoff points for 2nd place in their group. Once a team falls below the cutoff, they are dynamically removed from the qualification slot's candidate list.

  1. Simulating the Complex FIFA Annex C (3rd Place Logic) In the World Cup 2026, the 8 best 3rd-place teams qualify for the Round of 32. The tournament layout for these 3rd-place teams depends on which combination of groups they qualify from.

I mapped out all 15 possible qualification combinations (defined by FIFA Annex C) into a lookup dictionary. The engine dynamically rewrites the bracket nodes on the fly as 3rd-place standings fluctuate.

Performance & UX Design
Instead of relying on heavy frameworks like React or Next.js, this app was built entirely with Vanilla JS and CSS3.

This allowed me to implement a 60fps cinematic stadium parallax scroll effect and hologram laser-scanning animations without any performance overhead. The initial load time is practically instantaneous.

Conclusion
This project demonstrates how serverless utilities like GitHub Actions and Pages can be leveraged to build dynamic, real-time, data-driven web applications for free.

Check out the predictor and run your simulations! Let me know in the comments who wins the World Cup in your bracket!