Skip to content

Sports technology and social gaming · Case study

Score Hub: A social sports prediction platform with real-time scores and gamification

Sports prediction app case study: a greenfield NestJS, GraphQL and Next.js platform with 8 prediction types, a personalised social feed, badges, leaderboards and live scores for 10 leagues.

Score Hub product interface
Client
Score Hub is a football prediction platform that combines fantasy mechanics with a social feed.
Team
4 to 6: lead, two full-stack engineers, QA and a designer
Timeline
Ongoing engagement with active development
Services
Web development, Enterprise software, Cloud and DevOps, UI/UX design
8
Prediction types across 10 leagues
23
Prisma models with 50+ relationships
5
Languages with locale-aware routing
22
Pages across auth, core features and content

In short

Score Hub wanted a platform where users predict football matches across ten leagues, earn points, compete on leaderboards and share predictions socially. A team of four to six built it from scratch: a NestJS GraphQL API on PostgreSQL and Redis, a Next.js 15 frontend in five languages, live scores from SportMonks, Pusher real-time updates and a badge system with percentile ranks. It is live in production on AWS App Runner and Vercel.

The challenge

Where they started.

  • A greenfield product needed predictions, scoring, live data, social features and gamification working together from launch
  • Match data, scores and statistics for ten leagues had to stay current and resolve predictions automatically
  • Feeds and leaderboards had to feel instant despite heavy read traffic
  • The audience spans several languages, so routing and content had to be locale-aware from day one
What we did

The approach.

  • A modular NestJS 11 monolith exposing a GraphQL API through Apollo Server, with Prisma on Neon serverless PostgreSQL and Redis caching
  • A prediction engine with eight types, stacking bonuses, video analysis uploads to S3 and auto-resolution from the SportMonks API
  • A personalised feed with a custom scoring algorithm, comments, reactions, sharing to ten platforms, following and Redis caching with pattern-based invalidation
  • A badge system with percentile ranks (Legend to Apprentice), streak badges and scheduled recalculation, plus points and accuracy leaderboards with filters
  • Pusher WebSockets for live match updates and notifications, with optimistic UI updates
  • Next.js 15 with eleven feature-scoped Zustand stores, shadcn/ui components and next-intl across English, Turkish, German, Spanish and French
Deliverables

What shipped.

  • GraphQL API with auth, prediction, feed, leaderboard, match, league, profile, follow, search and account modules
  • Hybrid authentication: email with six-digit verification codes and Google OAuth via Firebase, seven-day JWTs in HttpOnly cookies
  • Live scores with eleven statistic types and match status tracking
  • User and predictor profiles, avatar upload with cropping, prediction history and personal analytics
  • Dashboard with accuracy, points, streaks and an earnings overview ready for Stripe
  • Search across predictors and predictions with server-backed filters
  • Background jobs for match sync, statistics sync and badge calculation
  • Deployment on AWS App Runner and Vercel with CloudFront, S3, Redis Cloud and Mailgun
In detail

How the engagement ran.

Context

Score Hub combines fantasy sports mechanics with social networking. Users predict match outcomes across ten major football leagues, earn points for accuracy, compete on leaderboards and share their reasoning with a community of fellow predictors. The product was a greenfield build: database schema, GraphQL API, responsive frontend, real-time layer, five languages and a gamification system, all designed and delivered by one team of four to six people.

What we built

  • A prediction engine with match result, over and under goals, correct score, double chance, both teams to score, half-time and full-time, yellow cards and corners, each with its own points value and a stacking bonus for combining types
  • Video analysis uploads alongside predictions, stored on S3 with presigned URLs and delivered through CloudFront
  • A social feed with a personalised scoring algorithm weighing views, likes, shares and saves, threaded comments, reporting, sharing to ten platforms and following
  • Badges across global, league, team and prediction-type scopes with percentile tiers, streak achievements and progress tracking
  • Points-based and accuracy-based leaderboards filtered by league, team, season, week and month
  • Live scores for ten leagues with eleven statistic types, status tracking and league and date filters
  • Profiles, dashboard analytics, search and 22 pages including static content

Architecture and stack

LayerTechnologyWhy
FrontendNext.js 15 App Router, React 19, TypeScript, Tailwind 4, 30+ shadcn/ui components, 11 Zustand stores, Apollo ClientServer components for initial render, isolated per-feature state on the client
APIGraphQL on Apollo Server, NestJS 11, Passport JWT, Firebase AdminType-safe, self-documenting schema generated from decorators
DataPostgreSQL on Neon with Prisma 6 and 23 models, Redis Cloud with 30-minute TTLServerless Postgres with pooling; cache-first reads for feeds and leaderboards
Real timePusher WebSocketsLive match updates and engagement notifications pushed to connected clients
IntegrationsSportMonks v3, Firebase Auth, AWS S3 and CloudFront, Mailgun EULive sports data, social login, media delivery and transactional email
HostingAWS App Runner for the API, Vercel for the frontend, GitHub-based deploysAuto-scaling containers and edge delivery with preview deployments per pull request

The backend is a modular monolith with feature-based modules and clear boundaries, ready for microservice extraction if growth demands it. Type safety runs end to end: TypeScript on both sides, Prisma-generated types, Zod validation of environment configuration that fails fast on startup, and a GraphQL schema that keeps the API contract current.

How predictions score

Prediction typeOptionsPoints
Match resultHome, draw or away10
Over or under goalsOver or under 2.58
Correct scoreExact final score50
Double chance1X, X2 or 123
Both teams scoreYes or no5
Half-time and full-timeNine possible outcomes18
Yellow cardsOver or under 4.57
CornersOver or under 10.57

Stacking several prediction types on one match earns a bonus multiplier on the total, which rewards conviction rather than volume. Predictions resolve automatically when results arrive from SportMonks, and the same sync triggers cache invalidation for the feeds and leaderboards affected. Rank badges are recalculated on a schedule from percentile position: the top 1 percent are Legend, then Elite at 5 percent, Veteran at 10, Challenger at 25 and Apprentice at 40, with streak badges such as On Fire and Daily Devotee for consistent activity.

How we worked

Two-week sprints with feature prioritisation and effort estimation, pull-request reviews with linting and type-checking gates, Husky pre-commit hooks, Jest unit tests for services and resolvers and Supertest for end-to-end API tests. Database changes ship as versioned Prisma migrations with the generate step in the build pipeline. Backend deploys build on App Runner from a clean install; the frontend deploys to Vercel with a preview URL for every pull request.

Scale and complexity

MeasureFigure
Prediction types / leagues8 / 10
Data models / relationships23 / 50+
GraphQL modules10, including 7 auth mutations and 9 feed operations
Zustand stores / UI components11 / 30+
Languages5
Pages22
Backend files under strict TypeScript143
Logout propagates across every open browser tab through the BroadcastChannel API, verification codes expire in two minutes, reset tokens in sixty, and no stack trace ever reaches a client.

What this means for your project

Social and gaming products need three things to feel alive: real-time updates, a feed that ranks well and pages that stay fast when everyone checks the scores at once. The pattern here, WebSockets for pushes, Redis for reads and background jobs for ranking, is the one we reuse.

If you are planning a consumer product with live data and community features, we can scope it in a discovery sprint and build it with a team of this shape.

Outcome

What changed.

  • Live in production with the full platform delivered end to end
  • Feed and leaderboard data served from Redis with a 30-minute TTL and surgical invalidation on match updates
  • Type safety end to end with TypeScript strict mode across 143 backend files, Prisma-generated types, Zod and an auto-generated GraphQL schema
FAQ

Questions about this project.

Can you build a fantasy or prediction product for another sport?

Yes. The engine, scoring, leaderboards and feed are sport-agnostic; the data provider and prediction types change. SportMonks covers football here, and other providers cover other sports.

How do you keep feeds fast under load?

Feed and leaderboard data are cached in Redis with a 30-minute TTL and invalidated by pattern when match data changes. If Redis is unavailable the system degrades to database queries and reconnects automatically.

What does a greenfield social product like this involve?

A team of four to six over an ongoing engagement, two-week sprints with demos, and a modular monolith that can be split into services later. Discovery produces the scope and estimate first.