Skip to content

peres84/RuneSight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

RuneSight ๐ŸŽฎโš”๏ธ

AI-powered League of Legends analytics platform using Strands agents and Amazon Bedrock

Live Demo AWS Python React FastAPI

Originally developed to run with Claude Sonnet 4.5 (Anthropic) via Amazon Bedrock. Due to issues with Sonnet credits on my AWS account, the deployed backend was switched to an Amazon Nova Pro fallback โ€” so the live deployment is a fallback configuration and not fully optimized. In particular, prompt/tool-calling integration is not yet finalized and may not route calls to the intended agents correctly.

For the best experience, download the repository and run the project locally configured to use Claude Sonnet 4.5 (the video demo was recorded with Claude Sonnet 4.5). Local use will reflect the intended agent behaviour and model responses โ€” see the Getting Started section in this README to run the backend locally and point it at your preferred Sonnet 4.5 model.

๐Ÿš€ Try it live โ€ข Built for the AWS Rift Rewind Hackathon

Legal Disclaimer: RuneSight is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games and all associated properties are trademarks or registered trademarks of Riot Games, Inc.


๐Ÿ“ธ Application Screenshots

๐Ÿ  Landing Page

Homepage Gaming-inspired hero section with video background and smooth animations

๐Ÿ“Š Dashboard Overview

Dashboard Real-time match analytics with queue-specific filtering and performance metrics

๐ŸŽฏ Match Analysis

Match Scores Detailed match breakdown with KDA, CS, damage statistics, and champion performance

๐Ÿค– AI-Powered Insights

Weakness Analysis Personalized improvement recommendations from specialized AI agents

๐Ÿ’ฌ Interactive Chat

Chatbot Natural language interface for asking questions about your gameplay

๐Ÿ‘ฅ Friend Comparison

Comparing with Friend Side-by-side performance analysis and duo synergy evaluation


โœจ Key Features

๐Ÿค– Five Specialized AI Agents

Powered by Amazon Bedrock (Claude Sonnet) and Strands framework:

  1. Performance Analyst - Analyzes individual match performance, identifies improvement areas, and tracks KDA, damage patterns, and objective control
  2. Champion Expert - Provides champion-specific advice, optimal builds, matchup analysis, and meta insights
  3. Team Synergy Specialist - Evaluates team compositions, draft analysis, and role synergy
  4. Comparison Analyst - Compares performance with friends, benchmarking, and duo synergy evaluation
  5. Match Summarizer - Creates comprehensive match summaries, season reviews, and achievement tracking

๐Ÿ“Š Comprehensive Analytics Dashboard

  • Multi-Queue Support - Separate analytics for Ranked Solo/Duo, Ranked Flex, Normal Games, and ARAM
  • Real-time Statistics - Win rate, KDA, CS, damage, and performance metrics
  • Match History - Detailed breakdown of recent games with champion performance
  • Progressive Loading - Dashboard loads in 1-2 seconds with background data fetching
  • Smart Caching - 80%+ cache hit rate reduces API calls by 50%

๐Ÿ’ฌ Interactive AI Chat Interface

  • Natural Language Queries - Ask questions about your gameplay in plain English
  • Context-Aware Responses - AI agents understand your match history and performance
  • Rich Visualizations - Charts and graphs embedded in chat responses
  • Multi-Agent Orchestration - Automatically routes queries to the right specialist

๐ŸŽจ Modern Gaming UI/UX

  • Dark/Light Mode - Full theme support with WCAG AA contrast compliance
  • Responsive Design - Seamless experience on desktop, tablet, and mobile
  • League of Legends Aesthetic - Gaming-inspired color schemes and animations
  • Smooth Transitions - Framer Motion animations for enhanced user experience
  • Video Hero Section - Engaging landing page with background video

โšก Performance & Reliability

  • Instant Tab Switching - Pre-fetched data for all queue types
  • Error Boundaries - Graceful error handling and recovery
  • Retry Logic - Automatic retry with exponential backoff
  • Rate Limiting - Intelligent Riot API call management (1.2s delay between requests)
  • Loading States - Clear feedback for all operations

๐Ÿ”’ Privacy & Security

  • No Account Required - Uses publicly available Riot Games data only
  • Privacy First - Your data stays local, no personal information stored
  • CORS Configuration - Proper cross-origin resource sharing
  • IAM Role Authentication - Secure AWS service integration

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    AWS Amplify (Frontend Hosting)                 โ”‚
โ”‚                  https://main.d2nnbamo017p3o.amplifyapp.com      โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  React 18 + TypeScript + Vite                              โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Tailwind CSS + shadcn/ui components                     โ”‚ โ”‚
โ”‚  โ”‚  โ€ข React Query for data fetching & caching                 โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Framer Motion for animations                            โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Recharts for data visualizations                        โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ”‚ HTTPS/REST API
                             โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              AWS Lambda Function (Backend API)                    โ”‚
โ”‚                  Lambda Function URL Endpoint                     โ”‚
โ”‚                                                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  FastAPI + Mangum (ASGI adapter)                           โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Python 3.11 runtime                                     โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Strands Agents framework                                โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Smart caching layer (80%+ hit rate)                     โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Rate limiting & retry logic                             โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                                  โ”‚
         โ”‚ Riot API                         โ”‚ Bedrock API
         โ”‚ (Rate Limited)                   โ”‚ (IAM Role Auth)
         โ”‚                                  โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Riot Games API     โ”‚          โ”‚    Amazon Bedrock              โ”‚
โ”‚  โ€ข Match History    โ”‚          โ”‚    โ€ข Claude 3 Sonnet           โ”‚
โ”‚  โ€ข Player Stats     โ”‚          โ”‚    โ€ข Nova Lite (fallback)      โ”‚
โ”‚  โ€ข Champion Data    โ”‚          โ”‚    โ€ข Strands orchestration     โ”‚
โ”‚  โ€ข Data Dragon      โ”‚          โ”‚    โ€ข Knowledge base (S3)       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

Frontend

Technology Purpose Version
React UI framework 18.3+
TypeScript Type safety 5.9+
Vite Build tool & dev server 7.1+
Tailwind CSS Utility-first styling 3.3+
shadcn/ui Component library Latest
React Query Server state management 5.0+
Framer Motion Animation library 11.0+
Recharts Data visualization 2.8+
Axios HTTP client 1.6+
Lucide React Icon library 0.294+

Backend

Technology Purpose Version
FastAPI Web framework 0.115+
Mangum Lambda ASGI adapter 0.17+
Strands Agents AI orchestration 1.15+
Boto3 AWS SDK 1.35+
Python Runtime 3.11+
Uvicorn ASGI server (local dev) 0.34+
Pydantic Data validation 2.12+

AWS Services

Service Purpose
AWS Amplify Frontend hosting, CI/CD, SSL certificates
AWS Lambda Serverless backend compute
Lambda Function URL Public HTTPS endpoint for API
Amazon Bedrock AI model inference (Claude Sonnet)
CloudWatch Logs Application logging & monitoring
IAM Roles Secure service-to-service authentication
S3 Knowledge base storage (strategy guides)

External APIs

API Purpose
Riot Games API Match history, player stats, ranked info
Data Dragon Champion data, items, runes, images

๐Ÿ“ Project Structure

RuneSight/
โ”œโ”€โ”€ frontend/                           # React + TypeScript application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/                # UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ui/                   # shadcn/ui base components (Button, Card, etc.)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/            # Dashboard-specific components
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DashboardLayout.tsx
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MatchHistoryCard.tsx
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ PerformanceMetrics.tsx
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ QueueTabs.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat/                 # AI chat interface
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ChatInterface.tsx
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MessageList.tsx
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ChatInput.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ analytics/            # Analytics visualizations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ onboarding/           # User onboarding flow
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ layout/               # Layout components (Header, Footer)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ErrorBoundary.tsx     # Error handling
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ LoadingState.tsx      # Loading indicators
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/                    # Custom React hooks
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useMatchData.ts       # Match data fetching
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useMatchHistory.ts    # Match history management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useProgressiveMatchHistory.ts  # Progressive loading
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useRankedInfo.ts      # Ranked stats
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useChat.ts            # Chat functionality
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ useAnalysis.ts        # AI analysis
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ useTheme.ts           # Theme management
โ”‚   โ”‚   โ”œโ”€โ”€ lib/                      # Utilities & configurations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api.ts                # API client (Axios)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ddragon.ts            # Data Dragon integration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ storage.ts            # LocalStorage utilities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ validation.ts         # Input validation
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ errors.ts             # Error handling
โ”‚   โ”‚   โ”œโ”€โ”€ types/                    # TypeScript type definitions
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.ts              # Shared types
โ”‚   โ”‚   โ”œโ”€โ”€ styles/                   # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx                   # Main app component
โ”‚   โ”‚   โ””โ”€โ”€ main.tsx                  # Entry point
โ”‚   โ”œโ”€โ”€ public/                       # Static assets
โ”‚   โ”‚   โ””โ”€โ”€ Video-Hero.webm          # Hero section video
โ”‚   โ”œโ”€โ”€ package.json                  # Dependencies
โ”‚   โ”œโ”€โ”€ vite.config.ts               # Vite configuration
โ”‚   โ”œโ”€โ”€ tailwind.config.js           # Tailwind CSS config
โ”‚   โ””โ”€โ”€ tsconfig.json                # TypeScript config
โ”‚
โ”œโ”€โ”€ backend/                          # FastAPI + Lambda application
โ”‚   โ”œโ”€โ”€ agents/                      # Strands AI agents
โ”‚   โ”‚   โ”œโ”€โ”€ base_agent.py           # Base agent with Bedrock config
โ”‚   โ”‚   โ”œโ”€โ”€ orchestrator.py         # Multi-agent orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ performance_agent.py    # Performance analysis
โ”‚   โ”‚   โ”œโ”€โ”€ champion_agent.py       # Champion expertise
โ”‚   โ”‚   โ”œโ”€โ”€ comparison_agent.py     # Player comparison
โ”‚   โ”‚   โ”œโ”€โ”€ team_synergy_agent.py   # Team composition analysis
โ”‚   โ”‚   โ”œโ”€โ”€ match_summarizer_agent.py  # Match summaries
โ”‚   โ”‚   โ””โ”€โ”€ README.md               # Agent documentation
โ”‚   โ”œโ”€โ”€ api/                        # FastAPI route handlers
โ”‚   โ”‚   โ”œโ”€โ”€ riot.py                 # Riot API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ analysis.py             # AI analysis endpoints
โ”‚   โ”‚   โ””โ”€โ”€ chat.py                 # Chat endpoints
โ”‚   โ”œโ”€โ”€ services/                   # Business logic layer
โ”‚   โ”‚   โ”œโ”€โ”€ riot_api_client.py     # Riot API client with rate limiting
โ”‚   โ”‚   โ”œโ”€โ”€ cache_service.py       # Smart caching (80%+ hit rate)
โ”‚   โ”‚   โ”œโ”€โ”€ data_processor.py      # Match data processing
โ”‚   โ”‚   โ”œโ”€โ”€ guides_service.py      # Knowledge base service
โ”‚   โ”‚   โ””โ”€โ”€ kb_service.py          # S3 knowledge base integration
โ”‚   โ”œโ”€โ”€ tools/                      # Strands agent tools
โ”‚   โ”‚   โ”œโ”€โ”€ guides_tool.py         # Strategy guides tool
โ”‚   โ”‚   โ”œโ”€โ”€ kb_tool.py             # Knowledge base tool
โ”‚   โ”‚   โ””โ”€โ”€ user_profile_tool.py   # User profile tool
โ”‚   โ”œโ”€โ”€ models/                     # Pydantic data models
โ”‚   โ”‚   โ””โ”€โ”€ riot_models.py         # Riot API response models
โ”‚   โ”œโ”€โ”€ utils/                      # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ match_analyzer.py      # Match analysis utilities
โ”‚   โ”‚   โ””โ”€โ”€ tool_logger.py         # Tool execution logging
โ”‚   โ”œโ”€โ”€ knowledge_base/             # LoL strategy guides (markdown)
โ”‚   โ”‚   โ”œโ”€โ”€ 01_LoL_Master_Guide.md
โ”‚   โ”‚   โ”œโ”€โ”€ 02_Game_Fundamentals.md
โ”‚   โ”‚   โ”œโ”€โ”€ 03_Farming_and_Economy.md
โ”‚   โ”‚   โ”œโ”€โ”€ 04_Micro_vs_Macro.md
โ”‚   โ”‚   โ”œโ”€โ”€ 05_Team_Composition.md
โ”‚   โ”‚   โ””โ”€โ”€ 06_Professional_Drafting.md
โ”‚   โ”œโ”€โ”€ scripts_tests/              # Testing & verification scripts
โ”‚   โ”‚   โ”œโ”€โ”€ test_agents.py
โ”‚   โ”‚   โ”œโ”€โ”€ test_riot_api.py
โ”‚   โ”‚   โ”œโ”€โ”€ test_cache.py
โ”‚   โ”‚   โ””โ”€โ”€ verify_bedrock.py
โ”‚   โ”œโ”€โ”€ config/                     # Configuration files
โ”‚   โ”‚   โ””โ”€โ”€ guides_storage.json    # S3 guides configuration
โ”‚   โ”œโ”€โ”€ main.py                     # FastAPI application
โ”‚   โ”œโ”€โ”€ lambda_handler.py           # Lambda entry point (Mangum)
โ”‚   โ”œโ”€โ”€ requirements.txt            # Python dependencies
โ”‚   โ”œโ”€โ”€ .env.example               # Environment variables template
โ”‚   โ””โ”€โ”€ trust-policy.json          # IAM trust policy
โ”‚
โ”œโ”€โ”€ deployment/                     # Deployment automation
โ”‚   โ”œโ”€โ”€ deploy-backend.ps1         # Backend deployment script (Docker + Lambda)
โ”‚   โ”œโ”€โ”€ deploy-frontend.ps1        # Frontend deployment script (Amplify)
โ”‚   โ”œโ”€โ”€ create_kb_simple.ps1       # Knowledge base setup
โ”‚   โ”œโ”€โ”€ setup_kb_with_docs.ps1     # S3 guides deployment
โ”‚   โ”œโ”€โ”€ backend.config.json        # Backend config (gitignored)
โ”‚   โ”œโ”€โ”€ frontend.config.json       # Frontend config (gitignored)
โ”‚   โ”œโ”€โ”€ backend.config.example.json  # Config template
โ”‚   โ”œโ”€โ”€ frontend.config.example.json # Config template
โ”‚   โ”œโ”€โ”€ SETUP-README.md            # Complete deployment guide
โ”‚   โ”œโ”€โ”€ SIMPLE_KB_GUIDE.md         # Knowledge base guide
โ”‚   โ””โ”€โ”€ README.md                  # Quick deployment overview
โ”‚
โ”œโ”€โ”€ images/                         # Screenshots & assets
โ”‚   โ”œโ”€โ”€ homepage.png
โ”‚   โ”œโ”€โ”€ dashboard.png
โ”‚   โ”œโ”€โ”€ chatbot.png
โ”‚   โ”œโ”€โ”€ comparing-with-friend.png
โ”‚   โ”œโ”€โ”€ scores_match.png
โ”‚   โ””โ”€โ”€ weakness_analyse.png
โ”‚
โ”œโ”€โ”€ amplify.yml                     # AWS Amplify build configuration
โ”œโ”€โ”€ .gitignore                      # Git ignore rules
โ””โ”€โ”€ README.md                       # This file

๐Ÿš€ Getting Started

๐ŸŒ Try the Live Demo

Visit https://main.d2nnbamo017p3o.amplifyapp.com/ to try RuneSight without any setup!

  1. Click "Get Started" on the homepage
  2. Complete the 3-step onboarding flow
  3. Enter your Riot ID (e.g., Faker#T1)
  4. Select your region (Europe, Americas, or Asia)
  5. Start analyzing your matches!

๐Ÿ’ป Local Development Setup

Prerequisites

  • Python 3.11+ with pip
  • Node.js 18+ with npm
  • AWS CLI 2.4+ configured with credentials
  • Docker Desktop (for Lambda deployment)
  • PowerShell (required for deployment scripts)
  • Riot Games API key - Get one here
  • AWS account with access to:
    • Lambda
    • Bedrock (Claude Sonnet model)
    • S3 (for knowledge base)
    • IAM (for role creation)

1. Clone the Repository

git clone <your-repo-url>
cd RuneSight

2. Backend Setup

# Navigate to backend directory
cd backend

# Create and activate virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1  # Windows PowerShell
# source venv/bin/activate    # Linux/Mac

# Install Python dependencies
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env

# Edit .env with your credentials:
# - RIOT_API_KEY=your_riot_api_key
# - AWS_ACCESS_KEY_ID=your_access_key (local dev only)
# - AWS_SECRET_ACCESS_KEY=your_secret_key (local dev only)
# - BEDROCK_REGION=eu-central-1
# - BEDROCK_MODEL_ID=your_bedrock_model_arn
# - ALLOWED_ORIGINS=http://localhost:5173

# Run local development server
python main.py

Backend will be available at http://localhost:8000

  • API docs: http://localhost:8000/docs
  • Health check: http://localhost:8000/api/health

Note: Local development requires AWS credentials in .env. In production (Lambda), IAM roles handle authentication automatically.

3. Frontend Setup

# Navigate to frontend directory (from project root)
cd frontend

# Install Node.js dependencies
npm install

# Configure environment variables
# Create .env file with:
echo "VITE_API_URL=http://localhost:8000" > .env

# Run development server
npm run dev

Frontend will be available at http://localhost:5173

4. Verify Setup

  1. Open http://localhost:5173 in your browser
  2. Complete the onboarding flow
  3. Enter a valid Riot ID
  4. Check that match data loads correctly
  5. Try asking the AI chat a question

๐ŸŒ Deployment to AWS

Prerequisites for Deployment

  • AWS CLI configured with appropriate credentials
  • Docker Desktop running (for Lambda deployment)
  • PowerShell (required - deployment scripts won't work with cmd)
  • AWS account with permissions for:
    • Lambda function creation and updates
    • IAM role creation
    • S3 bucket creation (for knowledge base)
    • Amplify app creation

Step-by-Step Deployment

1. Configure Backend

# Navigate to deployment directory
cd deployment

# Copy example configuration
Copy-Item backend.config.example.json backend.config.json

# Edit backend.config.json with your values:
# - AWS account ID
# - AWS region
# - Riot API key
# - Bedrock model ID
# - Lambda function name
# - IAM role name

2. Deploy Backend to Lambda

# Activate virtual environment first
cd ..\backend
.\venv\Scripts\Activate.ps1

# Return to deployment directory
cd ..\deployment

# Deploy with Docker for Linux-compatible dependencies
.\deploy-backend.ps1 -UseDocker -SkipLayer -CleanBuild

# The script will:
# โœ… Build Lambda package with Docker
# โœ… Create/update Lambda function
# โœ… Configure IAM role with Bedrock permissions
# โœ… Set up Function URL
# โœ… Configure environment variables
# โœ… Deploy knowledge base to S3

# Copy the Lambda Function URL from the output

3. Configure Frontend

# Copy example configuration
Copy-Item frontend.config.example.json frontend.config.json

# Edit frontend.config.json with:
# - Lambda Function URL (from step 2)
# - Amplify app name
# - AWS region

4. Deploy Frontend to Amplify

# Deploy frontend
.\deploy-frontend.ps1

# The script will:
# โœ… Build React application
# โœ… Create/update Amplify app
# โœ… Deploy to Amplify hosting
# โœ… Configure environment variables
# โœ… Set up SSL certificate

# Copy the Amplify URL from the output

5. Update CORS Configuration

# Edit backend.config.json
# Add your Amplify URL to ALLOWED_ORIGINS:
# "ALLOWED_ORIGINS": "https://your-app.amplifyapp.com"

# Update Lambda environment variables only
.\deploy-backend.ps1 -UpdateEnvOnly

Deployment Options

Command Use Case
.\deploy-backend.ps1 -UseDocker Full backend deployment with Docker
.\deploy-backend.ps1 -UpdateEnvOnly Update environment variables only
.\deploy-backend.ps1 -UpdateOnly Update Lambda configuration only
.\deploy-frontend.ps1 Deploy frontend to Amplify
.\create_kb_simple.ps1 Setup knowledge base separately

Deployment Features

  • โœ… Docker-based builds - Ensures Linux-compatible dependencies for Lambda
  • โœ… No Lambda layers needed - All dependencies packaged in function
  • โœ… IAM role authentication - Automatic Bedrock access in production
  • โœ… Fast updates - Update only what changed
  • โœ… CORS configuration - Automatic setup for Amplify integration
  • โœ… Knowledge base deployment - S3-based strategy guides for AI agents
  • โœ… Environment variable management - Secure configuration handling

Verify Deployment

# Test Lambda Function URL
curl https://your-lambda-url.lambda-url.region.on.aws/api/health

# Test Amplify deployment
# Visit your Amplify URL in browser

# Check CloudWatch Logs
aws logs tail /aws/lambda/RuneSight-Backend --follow

Detailed Documentation

For complete deployment instructions, troubleshooting, and advanced configuration:


โš™๏ธ Configuration

Backend Environment Variables

Local Development (.env file)

# Riot Games API
RIOT_API_KEY=RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# AWS Credentials (local development only - NOT needed in Lambda)
AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# AWS Bedrock Configuration
BEDROCK_REGION=eu-central-1
BEDROCK_MODEL_ID=eu.amazon.nova-lite-v1:0
# Alternative: anthropic.claude-3-sonnet-20240229-v1:0

# CORS Configuration (comma-separated for multiple origins)
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174

# Application Settings
ENVIRONMENT=development
PORT=8000
LOG_LEVEL=INFO

# Optional: Knowledge Base
KB_BUCKET_NAME=your-kb-bucket-name
KB_REGION=eu-central-1

Production (Lambda - backend.config.json)

{
  "aws": {
    "region": "eu-central-1",
    "accountId": "123456789012"
  },
  "lambda": {
    "functionName": "RuneSight-Backend",
    "runtime": "python3.11",
    "timeout": 30,
    "memorySize": 1024
  },
  "iam": {
    "roleName": "RuneSight-Lambda-Role"
  },
  "environment": {
    "RIOT_API_KEY": "RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "BEDROCK_REGION": "eu-central-1",
    "BEDROCK_MODEL_ID": "eu.amazon.nova-lite-v1:0",
    "ALLOWED_ORIGINS": "https://main.d2nnbamo017p3o.amplifyapp.com",
    "ENVIRONMENT": "production",
    "LOG_LEVEL": "INFO",
    "KB_BUCKET_NAME": "runesight-knowledge-base",
    "KB_REGION": "eu-central-1"
  }
}

Important: AWS credentials are NOT needed in Lambda - IAM roles handle authentication automatically.

Frontend Environment Variables

Local Development (.env)

# Backend API endpoint
VITE_API_URL=http://localhost:8000

# Optional: Enable debug logging
VITE_DEBUG=true

Production (frontend.config.json)

{
  "amplify": {
    "appName": "RuneSight",
    "region": "eu-central-1",
    "branch": "main"
  },
  "environment": {
    "VITE_API_URL": "https://your-lambda-url.lambda-url.eu-central-1.on.aws"
  }
}

AWS IAM Permissions

The Lambda function requires the following IAM permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock:InvokeModel",
        "bedrock:InvokeModelWithResponseStream"
      ],
      "Resource": "arn:aws:bedrock:*:*:model/*"
    },
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:ListBucket"],
      "Resource": [
        "arn:aws:s3:::runesight-knowledge-base",
        "arn:aws:s3:::runesight-knowledge-base/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*"
    }
  ]
}

๐Ÿ“Š API Documentation

Base URL

  • Local: http://localhost:8000
  • Production: https://your-lambda-url.lambda-url.region.on.aws

Interactive API Docs

When running locally, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Endpoints

Health & Status

Method Endpoint Description Response
GET / Root health check {"status": "healthy"}
GET /api/health Detailed health status Health metrics + cache stats
GET /api/riot/cache/stats Cache performance statistics Hit rate, size, entries

Riot API Integration

Method Endpoint Description Parameters
POST /api/riot/validate Validate Riot ID format {"riotId": "username#tag", "region": "europe"}
GET /api/riot/matches/{riotId} Get match history Query: region, queue, count
GET /api/riot/match/{matchId} Get detailed match data Path: matchId
GET /api/riot/ranked/{riotId} Get ranked statistics Query: region
GET /api/riot/summoner/{riotId} Get summoner profile Query: region

AI Analysis

Method Endpoint Description Request Body
POST /api/analysis/performance Analyze match performance {"matchId": "...", "riotId": "..."}
POST /api/analysis/champion Get champion advice {"championName": "...", "role": "..."}
POST /api/analysis/compare Compare two players {"riotId1": "...", "riotId2": "..."}
POST /api/chat AI chat interface {"message": "...", "context": {...}}

Example Requests

Validate Riot ID

curl -X POST "http://localhost:8000/api/riot/validate" \
  -H "Content-Type: application/json" \
  -d '{"riotId": "Faker#T1", "region": "asia"}'

Get Match History

curl "http://localhost:8000/api/riot/matches/Faker%23T1?region=asia&queue=ranked&count=20"

AI Performance Analysis

curl -X POST "http://localhost:8000/api/analysis/performance" \
  -H "Content-Type: application/json" \
  -d '{
    "matchId": "EUW1_1234567890",
    "riotId": "Faker#T1",
    "region": "asia"
  }'

Response Formats

Success Response

{
  "success": true,
  "data": {
    // Response data
  },
  "cached": true,
  "timestamp": "2025-01-10T12:00:00Z"
}

Error Response

{
  "success": false,
  "error": {
    "code": "RIOT_API_ERROR",
    "message": "Player not found",
    "details": "..."
  }
}

Rate Limiting

  • Riot API: 1.2s delay between requests (automatic)
  • Cache: 5-minute TTL for match data
  • Retry Logic: Exponential backoff on failures

๐Ÿงช Testing & Quality Assurance

Backend Testing

# Navigate to backend directory
cd backend

# Activate virtual environment
.\venv\Scripts\Activate.ps1

# Run all tests
pytest

# Run specific test files
python scripts_tests/test_riot_api.py
python scripts_tests/test_cache.py
python scripts_tests/test_agents.py

# Verify Bedrock connection
python scripts_tests/verify_bedrock.py

# Verify installation
python scripts_tests/verify_installation.py

Frontend Testing

# Navigate to frontend directory
cd frontend

# Run linter
npm run lint

# Type checking
npx tsc --noEmit

# Build test
npm run build

Manual Testing Checklist

  • Homepage loads with video background
  • Onboarding flow completes successfully
  • Riot ID validation works correctly
  • Dashboard loads match history
  • Queue tabs switch instantly
  • Match details display correctly
  • AI chat responds to queries
  • Dark/light mode toggle works
  • Responsive design on mobile
  • Error boundaries catch errors gracefully

๐Ÿ“ˆ Performance Metrics

Backend Performance

Metric Target Actual
Cache Hit Rate > 70% 80%+ โœ…
API Call Reduction > 40% 50%+ โœ…
Response Time (cached) < 50ms < 10ms โœ…
Response Time (uncached) < 1s 200-500ms โœ…
Lambda Cold Start < 3s ~2s โœ…
Lambda Warm Response < 500ms ~200ms โœ…

Frontend Performance

Metric Target Actual
Time to First Content < 3s 1-2s โœ…
Tab Switch Time < 100ms Instant (0ms) โœ…
Dashboard Load < 2s 1-2s โœ…
Bundle Size < 500KB ~400KB โœ…
Lighthouse Score > 90 92 โœ…

Optimization Strategies

  • Smart Caching: 5-minute TTL with localStorage for frontend, in-memory cache for backend
  • Progressive Loading: Dashboard loads immediately, match details fetch in background
  • Pre-fetching: All queue types pre-fetched for instant tab switching
  • Rate Limiting: 1.2s delay between Riot API calls prevents rate limit errors
  • Retry Logic: Exponential backoff on failures ensures reliability
  • Code Splitting: Vite automatically splits code for optimal loading

๐Ÿ› ๏ธ Development Workflow

Code Quality Tools

Backend (Python)

# Navigate to backend
cd backend

# Format code with Black
black .

# Lint with Flake8
flake8 .

# Type checking with MyPy
mypy .

# Sort imports
isort .

Frontend (TypeScript/React)

# Navigate to frontend
cd frontend

# Lint with ESLint
npm run lint

# Type checking
npx tsc --noEmit

# Build check
npm run build

Git Workflow

# Create feature branch
git checkout -b feature/your-feature-name

# Make changes and commit with conventional commits
git add .
git commit -m "feat: add new feature description"
# Other types: fix, docs, style, refactor, test, chore

# Push and create pull request
git push origin feature/your-feature-name

Commit Message Convention

Follow Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks

Development Best Practices

  1. Always test locally before deploying
  2. Use type hints in Python code
  3. Add JSDoc comments for complex functions
  4. Write meaningful commit messages
  5. Keep functions small and focused
  6. Handle errors gracefully
  7. Add loading states for async operations
  8. Test in both light and dark modes
  9. Verify responsive design on mobile
  10. Check CloudWatch logs after deployment

๐Ÿ› Troubleshooting

Common Issues

CORS Errors

Symptoms: Frontend can't connect to backend, browser console shows CORS errors

Solutions:

  1. Verify Lambda Function URL CORS is disabled (we handle CORS in FastAPI)
  2. Check ALLOWED_ORIGINS environment variable includes your frontend URL
  3. Ensure no trailing slashes in URLs
  4. Redeploy backend with updated config:
    .\deploy-backend.ps1 -UpdateEnvOnly

Lambda Import Errors

Symptoms: Lambda function fails with ModuleNotFoundError

Solutions:

  1. Use Docker deployment for Linux-compatible dependencies:
    .\deploy-backend.ps1 -UseDocker -CleanBuild
  2. Verify all dependencies are in requirements.txt
  3. Check CloudWatch logs for specific missing modules

Riot API Rate Limiting

Symptoms: 429 errors, "Rate limit exceeded" messages

Solutions:

  • Backend automatically handles rate limiting with 1.2s delays
  • Check cache is working: GET /api/riot/cache/stats
  • Verify cache hit rate is > 70%
  • Increase delay in riot_api_client.py if needed

Bedrock Access Denied

Symptoms: 403 errors when calling AI agents

Solutions:

  1. Verify IAM role has Bedrock permissions
  2. Check model ID is correct for your region
  3. Ensure Bedrock model access is enabled in AWS console
  4. Verify region supports your chosen model

Frontend Build Errors

Symptoms: npm run build fails with TypeScript errors

Solutions:

  1. Clear node_modules and reinstall:
    Remove-Item -Recurse -Force node_modules
    npm install
  2. Check TypeScript version compatibility
  3. Fix type errors shown in output

Dashboard Not Loading Data

Symptoms: Dashboard shows loading state indefinitely

Solutions:

  1. Check browser console for errors
  2. Verify API endpoint is correct in .env
  3. Test backend health: curl YOUR_API_URL/api/health
  4. Check Riot ID format: username#tag
  5. Verify region is correct

Debugging Tips

Backend Debugging

# Check Lambda logs
aws logs tail /aws/lambda/RuneSight-Backend --follow

# Test API endpoint
curl https://your-lambda-url.lambda-url.region.on.aws/api/health

# Check environment variables
aws lambda get-function-configuration --function-name RuneSight-Backend

# Test locally with verbose logging
LOG_LEVEL=DEBUG python main.py

Frontend Debugging

// Enable debug mode in browser console
localStorage.setItem("debug", "true");

// Check API calls
// Open Network tab in DevTools

// Check stored data
console.log(localStorage.getItem("userProfile"));
console.log(localStorage.getItem("matchHistory"));

Getting Help

  1. Check CloudWatch Logs - Most errors are logged here
  2. Review deployment documentation - deployment/SETUP-README.md
  3. Test with curl - Isolate frontend vs backend issues
  4. Check AWS service quotas - Ensure you haven't hit limits
  5. Verify credentials - AWS CLI should work: aws sts get-caller-identity

๐Ÿ’ฐ Cost Estimation

AWS Services Monthly Cost (Light Usage)

Service Usage Estimated Cost
AWS Lambda ~100K requests/month ~$0.20
AWS Amplify Hosting + 10GB bandwidth ~$1.00
Amazon Bedrock ~50K tokens/month ~$0.15
S3 Knowledge base storage ~$0.50
CloudWatch Logs 1GB logs/month ~$0.50
Data Transfer Minimal ~$0.50
Total ~$2.85/month

Cost Optimization Tips

  • Lambda free tier: 1M requests/month
  • Amplify free tier: 1000 build minutes/month
  • Smart caching reduces API calls by 50%
  • S3 lifecycle policies for old logs
  • CloudWatch log retention policies

๐Ÿ“š Documentation & Resources

Project Documentation

External Resources


๐Ÿค Contributing

This project was built for the AWS Rift Rewind Hackathon. Contributions are welcome!

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test thoroughly
  4. Commit with conventional commits: git commit -m "feat: add amazing feature"
  5. Push to your fork: git push origin feature/amazing-feature
  6. Open a Pull Request with a clear description

Contribution Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass
  • Test in both light and dark modes
  • Verify responsive design

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

Technologies & Services

  • Riot Games - League of Legends API and Data Dragon
  • AWS - Amplify, Lambda, Bedrock, and cloud infrastructure
  • Strands AI - AI agents framework
  • Anthropic - Claude AI models via Bedrock
  • shadcn/ui - Beautiful and accessible UI components
  • Tailwind CSS - Utility-first CSS framework
  • Vite - Lightning-fast build tool
  • FastAPI - Modern Python web framework

Special Thanks

  • AWS Rift Rewind Hackathon organizers
  • League of Legends community for inspiration
  • Open source contributors

๐ŸŽฏ Future Roadmap

Planned Features

  • Real-time Match Tracking - WebSocket support for live game updates
  • Advanced Analytics - Win rate predictions, champion mastery tracking
  • Team Composition Analyzer - Pre-game draft analysis and recommendations
  • Match Prediction System - AI-powered win probability calculator
  • Social Features - Friend leaderboards, shared match analysis
  • Mobile App - React Native mobile application
  • Discord Bot - Discord integration for quick stats
  • Multi-language Support - Internationalization (i18n)
  • Voice Analysis - Voice-based queries and responses
  • Tournament Mode - Clash and tournament analytics

Technical Improvements

  • WebSocket API for real-time updates
  • GraphQL API for flexible queries
  • Redis caching for improved performance
  • DynamoDB for user preferences
  • Cognito authentication for user accounts
  • CloudFront CDN for global distribution
  • Automated testing with GitHub Actions
  • Performance monitoring with X-Ray

๐Ÿ“ž Contact & Support

Getting Help

  1. Check the documentation - Most questions are answered in deployment/SETUP-README.md
  2. Review CloudWatch Logs - Detailed error information
  3. Search existing issues - Someone may have had the same problem
  4. Open a new issue - Provide detailed information and logs

Project Links


๐Ÿ† Hackathon Information

Project: RuneSight - AI-Powered League of Legends Analytics
Hackathon: AWS Rift Rewind
Category: Gaming Analytics & AI
Built with: AWS Amplify, Lambda, Bedrock, Strands Agents

Key Achievements

โœ… Fully functional web application deployed on AWS
โœ… Five specialized AI agents using Amazon Bedrock
โœ… Real-time match analytics with smart caching
โœ… Beautiful, responsive UI with dark/light mode
โœ… 80%+ cache hit rate for optimal performance
โœ… Comprehensive documentation and deployment guides


Built with โค๏ธ for the League of Legends community

RuneSight - See beyond the Rift

๐ŸŽฎ Try it now ๐ŸŽฎ


Legal Disclaimer: RuneSight is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games and all associated properties are trademarks or registered trademarks of Riot Games, Inc.

About

RuneSight is a simplified, production-ready League of Legends analytics platform that provides personalized gameplay insights through specialized AI agents. Built with FastAPI backend and React frontend, deployed on AWS Amplify.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors