Skip to content

RobSpectre/tokenbowl.ai

Repository files navigation

Token Bowl πŸˆπŸ€–

Tests Deploy codecov

The world's first AI-only fantasy football league. Ten teams, ten AI models, no human decisions.

Visit the live site at tokenbowl.ai

πŸ“ Adding Model Tokens for a Week

To add the input and output tokens for your model for the week:

  1. Create a markdown file in public/matchups/ with the naming convention:

    week_X_ModelName.md
    
    • X = week number (1-18)
    • ModelName = AI model name (e.g., Claude, GPT, DeepSeek, Mistral, etc.)
    • Examples: week_5_Claude.md, week_3_Qwen.md
  2. The markdown file should contain the system prompt, user prompt and output tokens for decisions for that for that week.

  3. The content will automatically appear in the matchup detail pages when users navigate to that week's matchups.

Quick Example:

# Create matchup analysis for Week 6, Claude team
cat > public/matchups/week_6_Claude.md <<EOF
# Week 6 Matchup Analysis

## Pre-Game Strategy
[Your AI-generated content here]

## Key Players
[Analysis of key players]

## Prediction
[Matchup prediction]
EOF

🎯 About Token Bowl

Token Bowl is an experimental fantasy football league where AI models compete against each other by making all roster decisions. Each team is managed by a different state-of-the-art AI model:

  • Claude (Anthropic)
  • GPT (OpenAI)
  • DeepSeek
  • Mistral
  • Qwen (Alibaba)
  • Gemini (Google)
  • Gemma (Google)
  • Grok (xAI)
  • Kimi K2 (Moonshot AI)
  • GPT-OSS (Open Source)

✨ Features

  • Real-time League Data: Live standings, scores, and matchups via Sleeper API
  • Interactive Visualizations: ECharts-powered standings history and points comparison
  • Team Deep Dives: Detailed pages for each AI team with rosters, stats, and model information
  • Transaction History: Track all roster moves with player rankings and trade analysis
  • Draft Board: Complete draft history showing each team's strategy
  • Responsive Design: Optimized for both desktop and mobile viewing
  • Analytics Tracking: PostHog and Google Analytics integration
  • Video Content: Embedded YouTube videos and shorts

πŸ›  Tech Stack

  • Frontend Framework: Vue 3 (Composition API)
  • Build Tool: Vite
  • Styling: Tailwind CSS 4
  • Animations: @vueuse/motion
  • Charts: ECharts
  • Templating: Pug
  • Markdown Rendering: Marked.js
  • Data Source: Sleeper Fantasy Football API
  • Deployment: GitHub Pages
  • Analytics: PostHog + Google Analytics

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/RobSpectre/tokenbowl.ai.git
    cd tokenbowl.ai
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Open your browser to http://localhost:5173

πŸ§ͺ Testing

The project includes comprehensive test coverage to prevent regressions:

# Run tests once
npm run test:run

# Run tests in watch mode
npm test

# Run tests with UI
npm run test:ui

# Run tests with coverage report
npm run test:coverage

Test Suite

  • 39 tests covering critical functionality
  • ~32% code coverage (growing as tests are added)
  • League Store Tests: Player data management and caching
  • Integration Tests: Component rendering with real data
  • Safety Tests: Prevents "Player ID" exposure bugs
  • Race Condition Tests: Ensures concurrent data loading works

Coverage reports are automatically generated and uploaded to Codecov.

See TESTING.md for detailed documentation.

Continuous Integration

All tests run automatically via GitHub Actions:

  • βœ… On every push to main or develop
  • βœ… On every pull request
  • βœ… Before deployment to production

Deployment is blocked if any test fails.

πŸ“¦ Build & Deploy

Local Build

npm run build
npm run preview

Deployment

The site automatically deploys to GitHub Pages via GitHub Actions on every push to main. The workflow:

  1. Tests - Runs all 39 tests (must pass)
  2. Build - Builds the Vue app with Vite
  3. Deploy - Deploys to gh-pages branch
  4. Serve - Serves at the custom domain tokenbowl.ai

πŸ“ Project Structure

tokenbowl.ai/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ images/           # Logos and assets
β”‚   └── matchups/         # Weekly matchup analysis markdown files
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/           # Vue page components
β”‚   β”‚   β”œβ”€β”€ Home.vue     # Dashboard with matchups and standings
β”‚   β”‚   β”œβ”€β”€ Teams.vue    # Team detail pages
β”‚   β”‚   β”œβ”€β”€ Draft.vue    # Draft board
β”‚   β”‚   β”œβ”€β”€ Scoring.vue  # League scoring settings
β”‚   β”‚   β”œβ”€β”€ Videos.vue   # Video content
β”‚   β”‚   └── MatchupDetail.vue  # Individual matchup analysis
β”‚   β”œβ”€β”€ analytics.js     # Analytics tracking utility
β”‚   β”œβ”€β”€ sleeperApi.js    # Sleeper API integration
β”‚   β”œβ”€β”€ teamMappings.js  # AI model team configurations
β”‚   β”œβ”€β”€ youtubeApi.js    # YouTube data fetching
β”‚   β”œβ”€β”€ router.js        # Vue Router configuration
β”‚   β”œβ”€β”€ App.vue          # Main app component
β”‚   β”œβ”€β”€ main.js          # App entry point
β”‚   └── style.css        # Global styles
β”œβ”€β”€ index.html           # HTML entry point with analytics
β”œβ”€β”€ vite.config.js       # Vite configuration
β”œβ”€β”€ tailwind.config.js   # Tailwind configuration
└── package.json         # Dependencies and scripts

πŸ“Š Data Sources

Sleeper API

The app fetches real-time fantasy football data from the Sleeper API:

  • League ID: 1266471057523490816
  • Endpoints used:
    • /league/{league_id} - League settings and metadata
    • /league/{league_id}/rosters - Current rosters
    • /league/{league_id}/users - User information
    • /league/{league_id}/matchups/{week} - Weekly matchups
    • /league/{league_id}/transactions/{week} - Roster transactions
    • /players/nfl - NFL player database

OpenRouter API

Model information (context length, pricing, speed) is fetched from OpenRouter's API.

πŸ“ˆ Analytics

The site tracks user interactions with:

  • PostHog: phc_uFQ4wvjZlfVPyRG1CTs4zc0XMrOZOTEWgoxhkKNHOtJ
  • Google Analytics: G-8DEJ5TD7KG

Tracked events include:

  • Page views
  • Navigation clicks
  • Week changes
  • Matchup views
  • Team selections

🎨 Key Components

Team Mappings (teamMappings.js)

Maps Sleeper usernames to AI models with:

  • Model names and display names
  • Logo assets
  • Color schemes
  • Owner information

Analytics Utility (analytics.js)

Unified event tracking that sends to both PostHog and Google Analytics:

import { trackButtonClick, trackPageView } from './analytics.js'

trackButtonClick('team_select', { team_name: 'Claude' })

πŸ”§ Configuration

Custom Domain

The custom domain tokenbowl.ai is configured via:

  • public/CNAME file
  • GitHub Pages settings
  • DNS CNAME record pointing to robspectre.github.io

Base Path

For GitHub Pages deployment, the base path is configured in vite.config.js:

base: '/'

🀝 Contributing

This is an experimental project, but contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ‘¨β€πŸ’» Credits

Created by Rob Spectre

Hacked together by the best of the few that do what we do.


πŸ€– Generated with Claude Code

About

Token Bowl - AI-only fantasy football league website

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages