GenAI-powered Smart Stadium Command Platform for FIFA World Cup 2026
Built with React 18, Gemini 2.5 Flash API, and zero-config deployment.
Live URL: https://nexus-ai-omega-ochre.vercel.app/
- Problem Statement
- Solution Overview
- Architecture
- Modules
- Tech Stack
- Getting Started
- API Integration
- Testing
- Accessibility
- Security
- Deployment
- Project Structure
FIFA World Cup 2026 Challenge 4 β Smart Stadiums & Tournament Operations
Build a GenAI-enabled solution that enhances stadium operations and the overall tournament experience for fans, organizers, volunteers, or venue staff. The solution must leverage Generative AI to improve navigation, crowd management, accessibility, transportation, sustainability, multilingual assistance, operational intelligence, or real-time decision support during the FIFA World Cup 2026.
NEXUS AI is a unified command platform that brings all stadium intelligence into a single interface. It uses Google's Gemini 2.5 Flash to power 7 AI-driven modules spanning every aspect of the problem statement:
| Module | Problem Addressed | GenAI Integration |
|---|---|---|
| Stadium Navigator | Navigation | AI-generated step-by-step directions with accessibility routing |
| Crowd Intelligence | Crowd Management | Structured JSON predictions via Gemini True JSON Mode |
| AI Concierge | Multilingual Assistance | 7-language conversational chatbot |
| Transport Hub | Transportation | AI-recommended departure times and route optimization |
| Sustainability | Sustainability | Contextual energy/waste recommendations |
| Accessibility Center | Accessibility | Adaptive routing, sensory zones, companion seating |
| Operations Center | Operational Intelligence | In-Memory RAG executive briefings |
User Request β HybridGeminiClient
ββ API Key Present? β Gemini 2.5 Flash (Live AI)
β ββ Success β Return response
β ββ HTTP 429 β Toast notification β Simulation fallback
ββ No API Key β High-Fidelity Simulation Engine (Zero-config)
Why this matters: Judges can evaluate the platform with zero configuration (simulation mode), or optionally add a Gemini API key to see live AI in action.
nexus-ai/
βββ src/
β βββ App.jsx # Root: Router + Layout + Toast system
β βββ main.jsx # React 18 entry point
β βββ index.css # Tailwind v4 + FIFA 2026 Design System
β β
β βββ components/ # 13 reusable UI components
β β βββ Sidebar.jsx # Navigation with collapse + AI mode indicator
β β βββ Header.jsx # Clock, language selector, notifications
β β βββ GlassCard.jsx # Glassmorphism card with configurable glow
β β βββ MetricCard.jsx # Animated KPI with sparkline chart
β β βββ StadiumMap.jsx # Interactive SVG with keyboard navigation
β β βββ Heatmap.jsx # Canvas-rendered crowd density visualization
β β βββ ChatBubble.jsx # Chat message with typing indicator
β β βββ ... # Badge, Modal, Toast, AlertBanner, etc.
β β
β βββ modules/ # 8 feature pages (lazy-loaded)
β β βββ Dashboard.jsx # Executive overview with AI briefings
β β βββ Navigator.jsx # AI-powered wayfinding
β β βββ CrowdIntel.jsx # Crowd prediction (True JSON Mode)
β β βββ Concierge.jsx # Multilingual AI chatbot
β β βββ Transport.jsx # Multi-modal transit planner
β β βββ Sustainability.jsx # Environmental monitoring
β β βββ Accessibility.jsx # Inclusive experience center
β β βββ Operations.jsx # In-Memory RAG command center
β β
β βββ services/
β β βββ gemini.js # HybridGeminiClient (Live API + Fallback)
β β βββ simulationEngine.js # High-fidelity response simulator
β β
β βββ hooks/ # Custom React hooks
β β βββ useGemini.js # AI client with loading/deduplication
β β βββ useRealTimeData.js # Simulated live data feeds
β β βββ useAccessibility.js # A11y preferences (localStorage-backed)
β β
β βββ lib/ # Core utilities
β β βββ security.js # DOMPurify, input validation, rate limiter
β β βββ i18n.js # 7-language internationalization
β β βββ constants.js # 16 real FIFA 2026 venues + config
β β
β βββ contexts/ # React context providers
β βββ LanguageContext.jsx
β βββ AccessibilityContext.jsx
β
βββ tests/ # Test suite
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β
βββ index.html # Semantic HTML5 + CSP + preconnect
βββ tailwind.config.js # Extended FIFA 2026 theme
βββ vite.config.js # Build optimization + @tailwindcss/vite
βββ vitest.config.js # Test config with 80% coverage thresholds
βββ eslint.config.js # Flat config + React/Hooks rules
βββ vercel.json # SPA routing for Vercel deployment
βββ .env.example # Environment template
Executive overview with 4 animated KPI cards, AI-generated briefings (auto-refresh 60s), live attendance charts, venue status grid, and recent alerts.
Interactive SVG stadium map with clickable zones. AI generates step-by-step directions with accessibility routing options (wheelchair, visual impairment).
Real-time crowd density heatmap with 8-zone monitoring. Uses Gemini True JSON Mode (responseMimeType: 'application/json') for structured 15/30/60-minute predictions with staff deployment recommendations.
Conversational chatbot supporting 7 FIFA languages (English, Spanish, French, German, Arabic, Portuguese, Russian) with RTL support. Quick-action buttons for common queries.
Multi-modal journey planner (Metro, Bus, Ride-Share, Walking, Parking). AI-recommended optimal departure times. Real-time transit status and surge pricing indicators.
Environmental dashboard tracking carbon footprint, energy usage, and waste diversion rates. AI generates contextual recommendations (e.g., "Lower AC in zones 4-6 to save 12% energy").
Wheelchair-accessible route planner, sensory-friendly zone finder, companion seating availability, service animal relief areas, and an accessible feedback form with DOMPurify sanitization.
In-Memory RAG implementation: maintains the last 100 log events in React state, injects the 20 most recent into the Gemini prompt for executive briefings. Resource allocation controls, incident tracking, and emergency protocol buttons.
| Category | Technology | Purpose |
|---|---|---|
| Framework | React 19 + Vite 8 | Component architecture + instant HMR |
| AI | Gemini 2.5 Flash | GenAI insights, chat, JSON predictions |
| AI SDK | @google/genai |
Official Google GenAI SDK |
| Styling | Tailwind CSS v4 | Utility-first responsive design |
| Charts | Recharts | AreaChart, BarChart, PieChart, LineChart |
| Icons | Lucide React | Consistent, accessible iconography |
| Security | DOMPurify | XSS prevention via HTML sanitization |
| Testing | Vitest + RTL | Unit/integration tests with 80% coverage |
| Linting | ESLint 9 + Prettier | Code quality + consistent formatting |
| Deployment | Vercel | Zero-config SPA hosting |
- Node.js β₯ 18
- npm β₯ 9
# Clone the repository
git clone https://github.com/Adityaraj1969/nexus-ai.git
cd nexus-ai
# Install dependencies
npm install
# (Optional) Add your Gemini API key
cp .env.example .env
# Edit .env and add: VITE_GEMINI_API_KEY=your_key_here
# Start development server
npm run devThe app runs at http://localhost:5173 and works immediately without an API key using the high-fidelity simulation engine.
| Script | Description |
|---|---|
npm run dev |
Start development server with HMR |
npm run build |
Production build |
npm run preview |
Preview production build |
npm run test |
Run test suite |
npm run test:coverage |
Run tests with coverage report |
npm run lint |
Run ESLint |
npm run format |
Format code with Prettier |
The HybridGeminiClient (src/services/gemini.js) provides three methods:
import { geminiClient } from './services/gemini';
// 1. Text insights
const briefing = await geminiClient.generateInsight(
'Summarize current stadium operations status',
'dashboard'
);
// 2. Structured JSON (True JSON Mode)
const prediction = await geminiClient.generateJSON(
'Predict crowd density for all zones in 15 minutes',
'crowd'
);
// Returns parsed JSON object β guaranteed parsable via responseMimeType
// 3. Conversational chat
const reply = await geminiClient.chat(
'Where is Gate A?',
'es' // language code
);API 429 Error β Set rateLimited flag
β Dispatch 'nexus-toast' event (UI notification)
β Fallback to simulationEngine
β Auto-recover after 60 seconds
# Run all tests
npm run test
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watch| Suite | Tests | Coverage Area |
|---|---|---|
gemini.test.js |
8 | HybridGeminiClient, 429 handling, simulation fallback |
simulationEngine.test.js |
12 | All 8 context types, data shape validation |
security.test.js |
9 | DOMPurify sanitization, input validation, rate limiter |
components.test.jsx |
11 | Badge, GlassCard, Modal rendering + a11y |
app.test.jsx |
8 | Routing, layout, navigation, 404 |
- Semantic HTML5:
<main>,<nav>,<header>,<aside>landmarks - ARIA Attributes:
role,aria-label,aria-live,aria-modal,aria-expanded - Keyboard Navigation: Full Tab/Escape/Enter support, focus-visible styles
- Focus Trap: Modal dialog traps focus when open
- Skip-to-Content: First focusable element in
<body> - RTL Support: Arabic layout with
dir="rtl" - Reduced Motion: Respects
prefers-reduced-motion: reduce - High Contrast: Respects
prefers-contrast: high - Color Contrast: All text β₯ 4.5:1 ratio against backgrounds
- Screen Reader: Dynamic content uses
aria-liveregions
- Content Security Policy:
<meta>CSP inindex.html - HTML Sanitization: DOMPurify with strict allow-list (no
<script>,<iframe>, event handlers) - Input Validation: Allow-list patterns for all user inputs (venue IDs, coordinates, language codes, search queries)
- Rate Limiting: Token-bucket algorithm prevents API abuse
- No Secrets in Code: API key via environment variable only
- Audit Logging: Structured security event logging
# Install Vercel CLI
npm i -g vercel
# Deploy
vercelThe vercel.json config handles SPA routing automatically.
npm run build
# Serve the dist/ folder with any static file serverMIT License β see LICENSE
- Google Gemini β Generative AI powering all intelligent features
- FIFA World Cup 2026 β Inspiration for the platform design
- Hack2Skill & Google for Developers β PromptWar Virtual Event
Built with β€οΈ for FIFA World Cup 2026 by NEXUS AI Team