About the Project
What Inspired Us
As League of Legends players, we wanted more than basic stats from sites like op.gg. The Rift Rewind Hackathon let us use AWS AI to turn raw gameplay data into actionable insights, helping players understand why they perform the way they do and how to improve.
What We Learned
AWS Amplify Gen 2: Type-safe, code-first backend development. Defining data models, GraphQL API, and authorization in TypeScript sped up development.
AWS Bedrock AI: Integrated Claude 3.5 Haiku through Amplify’s AI generation routes. Focused on effective system prompts to produce structured, actionable insights.
Riot Games API: Built a client handling regional routing, rate limits, and errors. Created TypeScript types for type safety.
Data Architecture: Designed DynamoDB schemas with composite indexes for efficient queries like "get all matches for a player sorted by date."
How We Built It
Frontend: Next.js 14 with Amplify UI components. Real-time AI insight generation with React hooks.
Backend:
- Data Layer: DynamoDB tables (
MatchCache,MatchParticipantIndex,PlayerStat) with GraphQL API - AI Layer: AWS Bedrock generation routes for player and match insights
- Lambda Functions: Riot API integration and data processing
Key Features:
- Player search by Riot ID
- Statistics dashboard (win rate, KDA, CS, vision score)
- Match history with AI-generated insights
- Real-time processing and caching
Performance Metrics: Calculate KDA ratio $\text{KDA} = \frac{K + A}{D}$ (when $D > 0$), win rate, CS per minute, and damage per minute.
Challenges We Faced
Riot API Rate Limiting: Strict limits (100 requests/2 minutes). Implemented DynamoDB caching and batch processing with retry logic.
Data Processing Performance: Processing hundreds of matches was slow. Stored pre-calculated stats, used DynamoDB indexes, and processed matches in parallel.
AI Prompt Engineering: Initial responses were inconsistent. Refined prompts to specify output format, provide League context, and focus on actionable insights.
Type Safety: Maintained types from Riot API to frontend. Created TypeScript definitions and used Amplify Gen 2 code generation for end-to-end type safety.
Real-time AI Generation: Balanced response time and cost. Generated insights on-demand, cached in DynamoDB, and used Claude 3.5 Haiku for speed and quality.
Regional API Routing: Different endpoints per region. Built routing that maps game regions (AMERICAS, ASIA, EUROPE, SEA) to API routing groups.
Conclusion
AWS Amplify Gen 2 and AWS Bedrock enabled a serverless app with AI-powered insights. The project demonstrates how generative AI can turn raw gameplay data into personalized, actionable coaching advice for players at all skill levels.
Built With
- amazon-web-services
- nextjs
Log in or sign up for Devpost to join the conversation.