Building a Football Intelligence Dashboard with Next.js, TypeScript and Real-Time Match Data
Football data is easy to display. Making it reliable, meaningful and useful throughout an entire match is a much harder engineering problem. I've been building BetLogic, a football intelligence platform that combines st
Football data is easy to display. Making it reliable, meaningful and useful throughout an entire match is a much harder engineering problem.
I've been building BetLogic, a football intelligence platform that combines structured match data, historical analysis and statistical models.
Today, I'm introducing a redesigned Match Intelligence Dashboard that brings these capabilities together in a single workspace.
This article explores the engineering decisions behind the dashboard, from incomplete time-series data to responsive visualisations and efficient API usage.
The technology stack
- Next.js App Router β server rendering, routing and API endpoints.
- TypeScript β typed data contracts and validation.
- Tailwind CSS β responsive interface design.
- Neon PostgreSQL β persistent match observations and historical data.
- Vercel β deployment and scheduled workloads.
- API-Football β football data infrastructure.
1. Designing around the match lifecycle
A football match has three fundamentally different analytical phases.
| Phase | Available intelligence |
|---|---|
| Pre-match | Historical form, trends, team comparisons and context |
| Live | Recorded statistics, events and player performance |
| Post-match | Final statistics, historical game flow and outcome analysis |
Instead of treating these as separate products, I built a workspace that adapts to the current match state.
The dashboard is organised into six core views:
- Briefing β consolidated match overview.
- Probability β available stored model outputs.
- Game Flow β recorded statistical developments over time.
- Performance β team and player comparisons.
- Shape β interactive published formations.
- Context β historical form, head-to-head records and standings.
A chronological Signals view provides additional context throughout the match.
2. Missing data is not zero
One of the biggest challenges when working with sports APIs is incomplete data.
A missing shot count does not mean zero shots. An unavailable red-card count does not mean that no red cards have been issued.
Treating these values as equivalent can introduce errors throughout an analytical system.
The dashboard preserves the distinction between:
- A measured zero.
- An unavailable metric.
- An unobserved interval.
- A reported correction.
Consider this simplified TypeScript example:
type Observation = {
minute: number;
shots: number | null;
};
const observations: Observation[] = [
{ minute: 10, shots: 0 },
{ minute: 15, shots: 2 },
{ minute: 20, shots: null },
{ minute: 25, shots: 4 },
];
The observation at minute 20 must not be interpreted as zero shots.
When observations are missing, charts display gaps rather than inventing continuity.
Missing evidence should remain missing evidence.
3. Reconstructing Game Flow from recorded observations
Another interesting engineering challenge was associating statistical observations with the correct match minute.
Provider responses do not always contain usable period timestamps. However, separately recorded fixture observations can contain valid match-clock information.
The dashboard correlates these observations using:
- Capture timestamps.
- Fixture identity.
- Team identity.
- Compatible match phases.
- Reported match-clock information.
If the evidence cannot establish a reliable clock position, that observation is excluded from the chart.
The result is a descriptive view of recorded football activity rather than an artificial momentum model.
It also means that historical gaps remain visible. Final statistics cannot tell us exactly when every unrecorded event occurred.
4. Separating observations from predictions
An architectural decision I consider particularly important is keeping these layers separate:
- Observed football data.
- Historical statistical analysis.
- Model-generated probabilities.
- Published predictions.
- Settled outcomes.
A frontend chart should never silently become a prediction engine.
Similarly, historical win frequencies should not be presented as the probability of winning the next match.
The dashboard displays existing model outputs when eligible, without generating unsupported probabilities in the browser.
If a complete probability distribution is unavailable, the interface does not manufacture one.
5. Managing API costs and scalability
Live sports data can become expensive surprisingly quickly, especially when dozens of fixtures are running simultaneously.
Some of the approaches used in BetLogic include:
- Batched data collection.
- Shared server-side caching.
- On-demand analytical modules.
- Lazy-loaded dashboard views.
- Database-backed historical observations.
- Visibility-aware polling.
- Stopping live polling after full time.
- Avoiding unnecessary per-player API requests.
The architecture separates data collection from data presentation.
Football Data Provider
|
v
Scheduled Data Collection
|
v
Neon PostgreSQL / Server Cache
|
v
Validated Analytical Services
|
v
Next.js Match Intelligence Dashboard
This is a simplified representation of the architecture. Some dashboard sections also use controlled, cached server-side provider requests when necessary.
The goal is to maximise the usefulness of collected data without allowing every page visit to trigger unnecessary upstream requests.
6. Mobile-first football analytics
Complex dashboards often work well on a desktop but become difficult to use on smaller screens.
For this release, mobile usability was treated as an architectural requirement rather than a final styling task.
The dashboard includes:
- Responsive analytical charts.
- Interactive player details.
- Accessible chart controls.
- Home and away formation views on mobile.
- Side-by-side team comparisons where space permits.
- Adaptive layouts based on available data.
The interface also adapts when a particular dataset is unavailable, rather than filling the screen with large empty panels.
7. Protecting account-only data
The complete interactive dashboard is available through a free BetLogic account.
However, access control is enforced on the server, not simply through a blurred frontend component.
Unauthenticated requests to protected analytical endpoints are rejected before protected data is returned.
This allows public match pages to remain accessible while keeping account-only functionality behind the appropriate authentication boundary.
8. Testing beyond the happy path
Building a dashboard that looks good with complete data is relatively straightforward.
The more interesting cases are:
- Missing statistics.
- Incomplete player information.
- Contradictory match observations.
- Delayed provider updates.
- Match-state transitions.
- Completed fixtures.
- Small historical samples.
- Expired authentication sessions.
- Different viewport sizes.
These scenarios were part of the development and testing process.
The objective was not simply to make every component render, but to ensure that the interface remains meaningful when its underlying data is imperfect.
9. What I'm building towards
BetLogic is gradually evolving beyond conventional football predictions into a more comprehensive football intelligence platform.
The longer-term direction is to improve:
- Historical data coverage.
- Match observation density.
- Statistical transparency.
- Football analytics infrastructure.
- Evidence-driven decision-support tools.
There is still work to do, particularly around incomplete provider coverage and consistent live observation density across simultaneous matches.
But I believe that building systems which acknowledge uncertainty is more valuable than building systems that simply appear confident.
Try it out
The new Match Intelligence Dashboard is available on BetLogic's match pages with a free account.
- Explore today's football matches
- Explore a completed match dashboard
- Read the full Match Intelligence Dashboard announcement
I'm interested in hearing how other developers approach incomplete time-series data, real-time analytics and API cost optimisation.
How do you handle missing observations in your analytical systems: interpolation, explicit gaps, or another approach?
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.