Inspiration

As sports fans, we've always been interested in the betting behind games, but we noticed something concerning about how people bet on sports. Whether it's fantasy leagues or actual betting, most decisions are made on gut feeling rather than real analysis. Traditional betting apps are designed to maximize quick, impulsive wagers, not informed decisions. We wanted to flip that model entirely. What if you had to understand the player, review AI-powered insights, and ask questions before you could even place a bet? That's where Swipe Wiser was born: a betting app that puts analysis before action.

What it does

Swipe Wiser reimagines sports betting with an analyze-first, bet-second approach:

AI-Powered Player Analysis: Each player card displays comprehensive analysis including recent form, matchup context, strengths, concerns, and risk assessment. All of this is visible before you can swipe. Interactive AI Chat: Ask questions about any player before swiping. Questions like "How has this player done recently?", "What are the risks tonight?", or "Is this a high-variance play?" get instant contextual analysis from DigitalOcean's Gradient AI agent.

Tinder-Style Swipe Interface: Analysis is always visible. Swipe left to pass, swipe right to "consider", which unlocks preset betting options for that player. Live NBA Data: Fetches today's games from NBA's public scoreboard API and player rosters from boxscore endpoints.

Smart Bet Slip Management: Add team bets or player prop bets, edit stakes before games start, and track your paper bets with real-time P&L calculations. Visual Wallet System: See your available balance, total bankroll, reserved funds, and profit/loss at a glance with color-coded chips.

The flow is simple: browse today's NBA games, select a matchup, review each player's AI analysis, ask questions if needed, swipe right to unlock betting options, add bets to your slip, and manage your bankroll.

How we built it

Frontend (React + Vite): Backend (Node.js + Express):

DigitalOcean Gradient AI Integration: Built a buildPrompt() function that constructs detailed context about each player including their name, team, opponent, role, recent form, minutes volatility, strengths, concerns, and risk level The /api/agent/chat endpoint receives player data plus user question from frontend, builds a structured prompt, and forwards it to Gradient AI's chat completions endpoint Returns AI analysis back to frontend where it's displayed in the chat panel

Data Integration: Uses native fetch() API to call NBA's CDN endpoints Pulls player headshots from NBA's CDN: cdn.nba.com/headshots/nba/latest/1040x760/{personId}.png Extracts player stats from boxscore JSON (points, rebounds, assists from last game) Filters games by team names to show only our demo matchups

Challenges we ran into

Gradient AI Prompt Engineering: Getting the prompts right took iteration. We needed to include enough player context (stats, matchup, volatility) without overwhelming the model, while also ensuring responses were consistently actionable and betting-focused. We experimented with different prompt structures before landing on our current format that reliably produces analysis covering matchup summary, strengths, concerns, and risk.

NBA API Response Parsing: The NBA boxscore JSON structure is deeply nested and inconsistent. Extracting player data required carefully navigating through data.game.awayTeam.players and data.game.homeTeam.players, handling missing fields, and determining which team each player belongs to for opponent calculation.

Accomplishments that we're proud of

Seamless AI Integration: Our Gradient AI chat feels natural and responsive. The buildPrompt function creates rich context from player data, and the agent returns genuinely useful analysis that helps users understand matchups better.

Clean Swipe UX: The Tinder-style swipe mechanic with rotation and slide-out animations feels polished and intuitive. The visual feedback (X icon for left swipe, heart for right swipe) makes the interaction satisfying.

Ethical Design Philosophy: Every design decision reinforces "analyze before betting". Analysis is always visible, you can't bet without reviewing, chat is available for questions, and risk levels are clearly displayed.

What we learned

Working with DigitalOcean's Gradient AI: How to structure prompts for domain-specific analysis, build backend proxies for AI agents, handle authentication with API keys, parse various response formats, and implement graceful error handling when AI services are unavailable.

Full-Stack Architecture: Connecting React frontend to Node backend to DigitalOcean Gradient AI to NBA APIs with proper error handling at each layer, managing environment variables across services, and handling CORS properly.

Prompt Engineering: The importance of providing structured context to AI models, being specific about desired output format, and iterating on prompts to get consistent, high-quality responses.

What's next for Swipe Wiser

Expand to More Sports: NFL, MLB, NHL with sport-specific analysis factors (passing yards, ERA, penalty minutes) and matchup dynamics tailored to each sport. Personalized AI Recommendations: Use Gradient AI to analyze user betting history and patterns, then provide personalized player recommendations based on their risk tolerance, favorite bet types, and historical win rates.

Real Odds Integration: Partner with legal sportsbooks (FanDuel, DraftKings) to display actual betting lines alongside our AI analysis, helping users identify positive expected value opportunities. Enhanced AI Analysis: Feed the Gradient AI agent more data (injury reports, recent news, lineup changes, weather conditions) to provide even deeper insights. Add features like "Why did this bet lose?" post-game analysis.

Social Features: Share player analysis with friends, compare bet slips, create mini-leagues, and learn from successful bettors' decision-making processes.

Advanced Analytics Dashboard: Track performance over time with metrics like ROI by bet type, win rate by confidence level, average stake size, and AI-generated insights on improving your strategy. Live In-Game Analysis: Real-time updates during games with evolving AI analysis as stats change. For example: "Player X has 8 points in Q1, on pace for 32+ points." Responsible Gambling Tools: Daily/weekly spending limits, cool-down periods when losing streaks are detected, reality checks ("You've been betting for 2 hours"), and educational content about variance and bankroll management.

Custom Prop Builder: Let users create their own prop bets ("Player A over 20 pts + Player B over 10 assists") and get AI analysis on historical probability and value.

Share this project:

Updates