Skip to content

About

Weather Betting Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFL Weather Betting Agent

A full-stack application that tracks NFL games with weather data and maintains a historical database of games, scores, weather conditions, and betting information.

Features

  • 🏈 Real-time NFL Games: Display upcoming NFL games with live weather data
  • 📊 Historical Database: Browse historical NFL games from the past seasons
  • 🌤️ Weather Integration: Real-time and historical weather data for game locations
  • 💾 Cloudflare D1 Database: SQLite-based serverless database for historical data
  • 🔄 Agent-to-Agent Communication: Built-in A2A protocol for inter-agent messaging
  • 📱 Modern UI: React + TypeScript frontend with responsive design

Tech Stack

  • Frontend: React 19, TypeScript, Vite
  • Backend: Cloudflare Workers with Express.js
  • Database: Cloudflare D1 (SQLite)
  • APIs:
    • ESPN API (NFL games)
    • TheSportsDB API (historical games)
    • OpenWeatherMap API (weather data)

Quick Start

Prerequisites

  • Node.js and pnpm installed
  • Cloudflare account (for deployment)
  • OpenWeatherMap API key (free tier available)

Installation

# Install dependencies
pnpm install

# Build the project
pnpm run build

Configuration

  1. Set up D1 Database:

    wrangler d1 create nfl-games-db

    Update wrangler.jsonc with the database ID, then run migrations:

    wrangler d1 migrations apply nfl-games-db --remote
  2. Set Weather API Key:

    wrangler secret put WEATHER_API_KEY

Local Development

# Start dev server
pnpm run dev

Deployment

pnpm run deploy

Documentation

Project Structure

weatherbet/
├── worker/           # Cloudflare Worker backend
│   ├── index.ts     # Main worker entry point
│   ├── nfl.ts       # NFL game data fetching
│   ├── weather.ts   # Weather data fetching
│   ├── database.ts  # D1 database utilities
│   └── ...
├── src/             # React frontend
│   ├── components/  # React components
│   └── ...
├── scripts/         # Utility scripts
│   └── populate-all-data.mjs  # Populate weather/location data
└── migrations/      # Database migrations

Database Schema

The nfl_games table stores:

  • Game information (teams, scores, dates, stadiums)
  • Location data (city, state, coordinates)
  • Weather data (temperature, condition, humidity, wind, precipitation)
  • Betting data (spread, over/under)

API Endpoints

  • GET /api/health - Health check
  • GET /api/nfl/games - Get upcoming NFL games
  • GET /api/nfl/weather - Get games with weather data
  • GET /api/db/games - Get historical games from database
  • GET /api/db/stats - Get database statistics

License

MIT

About

Weather Betting Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages