Skip to content

NathanEmb/space-jam-dashboard

Repository files navigation

Space Jammers Dashboard

Web dashboard for the Space Jam fantasy basketball league. It is currently hosted at https://space-jammers.com!

About

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)

Architecture

The application is built using:

The project is containerized with Docker and deployed to AWS.

Project Structure

  • src/backend.py - Core logic for data fetching and processing
  • src/prompts.py - Prompting for AI-generated content via Groq
  • src/frontend/ - Streamlit pages and UI components
    • Spacejam_Dashboard.py - Main dashboard entry point
    • figures.py - Matplotlib visualization functions
    • streamlit_utils.py - Utility functions for Streamlit UI
    • pages/ - Additional views (Team Viewer, Matchup Viewer)
    • components/ - Reusable UI components with HTML templates

Features

  • 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

Development Setup

  1. Ensure you have Python 3.13 installed

  2. Install dependencies using UV (recommended) or pip:

    uv sync
    # OR
    pip install -e .
  3. Run the application locally:

    uv run streamlit run src/frontend/Spacejam_Dashboard.py

Deployment

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.

Environment Variables

  • GROQ_API_KEY - Required for AI-generated content via the Groq API

Contributing

  1. Follow the existing code structure and style
  2. Use appropriate docstrings for new functions
  3. Test your changes locally before submitting PRs
  4. Keep the witty spirit of the application in any new features

About

Web dashboard for Space Jam fantasy basketball.

Resources

Stars

Watchers

Forks

Packages

No packages published