Web dashboard for the Space Jam fantasy basketball league. It is currently hosted at https://space-jammers.com!
This project provides a dashboard for a fantasy basketball league (Space Jammers) that pulls data from ESPN's Fantasy API and displays various statistics and insights. The dashboard includes:
- Team statistics and category rankings
- Player performance metrics across different timeframes (7, 15, 30 days)
- Head-to-head matchup comparisons
- AI-generated witty commentary (using Groq's LLM API)
The application is built using:
- Streamlit for the web frontend
- ESPN API for fetching fantasy basketball data
- Pandas for data manipulation and analysis
- Matplotlib for data visualization
- Jinja2 for HTML template rendering
- Groq API for generating AI content
The project is containerized with Docker and deployed to AWS.
src/backend.py
- Core logic for data fetching and processingsrc/prompts.py
- Prompting for AI-generated content via Groqsrc/frontend/
- Streamlit pages and UI componentsSpacejam_Dashboard.py
- Main dashboard entry pointfigures.py
- Matplotlib visualization functionsstreamlit_utils.py
- Utility functions for Streamlit UIpages/
- Additional views (Team Viewer, Matchup Viewer)components/
- Reusable UI components with HTML templates
- Category Rankings: Visualize team performance across different statistical categories
- Team Viewer: Detailed breakdown of individual team strengths, weaknesses, and trends
- Matchup Viewer: Compare head-to-head matchups with detailed statistics
- AI Commentary: Enjoy witty, sometimes snarky comments about teams and matchups
-
Ensure you have Python 3.13 installed
-
Install dependencies using UV (recommended) or pip:
uv sync # OR pip install -e .
-
Run the application locally:
uv run streamlit run src/frontend/Spacejam_Dashboard.py
The application is containerized using Docker:
docker build -t space-jammers .
docker run -p 5006:5006 space-jammers
Deployment to AWS is automated via GitHub Actions upon completion of a Pull Request to main.
GROQ_API_KEY
- Required for AI-generated content via the Groq API
- Follow the existing code structure and style
- Use appropriate docstrings for new functions
- Test your changes locally before submitting PRs
- Keep the witty spirit of the application in any new features