ICC Rankings
LiveFeb 2026 – Apr 2026 · 2 months
sports-analyticsICC Rankings tracks cumulative team points across every ICC format — Men's and Women's World Cups, T20s, Test Championship, and age-group events from 1973 to 2025. A Rust/Axum API serves the historical data; a Next.js frontend renders rankings, team breakdowns, and event pages. Authentication is handled via Google OAuth (NextAuth), with JWT claims carrying role and new-user state. The centrepiece is Twelfth Man, an AI chatbot built on LangGraph and Claude that routes natural language queries through a multi-node agent: classifying intent, running read-only SQL, executing sandboxed Pandas analytics, and formatting the response with optional inline charts. In production, both the API and chatbot run as containerised AWS Lambda functions backed by Neon serverless Postgres; DynamoDB replaces MongoDB for chat history and per-user monthly question quotas.
Design Decisions
DynamoDB was chosen over MongoDB for production to eliminate the need for a persistent server in a serverless Lambda deployment — TTL-based auto-expiry handles 90-day chat retention without a cleanup job. Two separate Lambda functions (API + chatbot) are deployed from ECR images managed by Terraform, keeping infrastructure reproducible and idle costs at zero. Primary relational data lives on Neon serverless Postgres, which scales to zero alongside the Lambdas — preserving the zero-idle-cost goal across the entire stack.
Highlights
- ›6-node LangGraph agent: Router classifies intent and branches to SQL Agent, Analytics, Greeting, or Off-topic nodes before Formatter
- ›Rust/Axum API auto-seeds 52 years of ICC tournament data (1973–2025) across 5 formats on first boot
- ›Google OAuth via NextAuth — JWT carries is_admin and is_new_user claims, enabling per-user chat history isolation
- ›DynamoDB replaces MongoDB in production: atomic monthly counters enforce a 30-question-per-user quota with graceful in-chat messaging
- ›Read-only PostgreSQL guardrails + sandboxed Pandas code execution keep the chatbot safe against injection and runaway queries
- ›Full Terraform IaC: two ECR-backed Lambda functions (API + chatbot) on AWS ap-south-1, backed by Neon serverless Postgres — the whole stack scales to zero idle cost
Timeline
Auth
Infrastructure
AI / LLM
Other
Tech Stack
Metrics
160 pytest tests across 11 test files
3-language stack: TypeScript · Rust · Python
52 years of ICC data (1973–2025)