A Cloudflare Workers application that provides NCAA basketball statistics (from the NCAA website--not with scores of games being played, but only once they are finished) and AI-powered analysis for both men's and women's Division I teams.
- Statistics from NCAA.com (using this NCAA API)
- Support for both men's and women's Division I basketball
- AI-powered analysis of team performance
- Interactive web interface
- Data caching for improved performance
- Data visualizations based on conference and team standings from NCAA.com
- Cloudflare Workers
- Cloudflare D1 (SQLite)
- Cloudflare Workers AI
- Cloudflare KV for caching
- NCAA API integration
- Install Wrangler CLI:
npm install -g wrangler
- Clone the repository:
git clone https://github.com/elizabethsiegle/marchmadness-prediction-analysis-worker
cd https://github.com/elizabethsiegle/marchmadness-prediction-analysis-worker
- Create D1 databases:
wrangler d1 create basketball-women
wrangler d1 create basketball-men
- Initialize both databases using the schema:
wrangler d1 execute basketball-women --file=./schema.sql
wrangler d1 execute basketball-men --file=./schema.sql
- Configure environment variables in
wrangler.jsonc
:
"kv_namespaces": [
{
"binding": "BROWSER_KV_MM",
"id": "your-kv-id-here",
"preview_id": "your-preview-id-here"
}
],
"ai": {
"binding": "AI"
},
"d1_databases": [
{
"binding": "DB_MEN",
"database_name": "FOR-EX-MARCH-MADNESS-MEN",
"database_id": "YOUR-DB-ID-HERE"
},
{
"binding": "DB",
"database_name": "FOR-EX-MARCH-MADNESS-WOMEN",
"database_id": "YOUR-DB-ID-HERE"
}
]
- Deploy:
wrangler deploy