Skip to content

Repository files navigation

PodPix - Fantasy Football AI Assistant

License: MIT

This repository is open source under the MIT License. The hosted product at podpix.ai / app.podpix.ai may have separate terms of use; self-hosting and local development use only the code and license in this repo.

Continuous integration runs a production pnpm build on pushes and pull requests to main (see .github/workflows/ci.yml). After you create the GitHub repository, you can add a status badge from the Actions workflow page if you want one in this README.

Overview

PodPix is an intelligent fantasy football assistant that combines AI technology with expert podcast analysis to help you make better fantasy football decisions. The application processes thousands of hours of expert podcasts and articles to provide personalized, evidence-based recommendations for your fantasy team.

Key Features

  • AI-Powered Chat: Get instant answers to your fantasy football questions about lineup decisions, trades, waiver wire pickups, and more.
  • Podcast Integration: Ask questions about specific fantasy football podcast episodes and get targeted insights from expert analysis.
  • Team Management: Track podcast mentions and analyst opinions about players on your fantasy team.
  • Expert Insights: Access recommendations backed by real expert analysis using advanced RAG (Retrieval Augmented Generation) technology.

Technologies Used

  • Vite
  • TypeScript
  • React
  • shadcn-ui
  • Tailwind CSS
  • Supabase (Backend)

Prerequisites

Before running the application locally, ensure you have the following installed:

  • Node.js (We recommend using nvm for installation)
  • pnpm (We use pnpm as our package manager)
  • Git

Development Setup

Prerequisites

  1. Install ASDF (if not already installed):
# On macOS
brew install asdf
  1. Add ASDF plugins:
asdf plugin add nodejs
asdf plugin add pnpm
  1. Install Node.js and PNPM:
asdf install

Getting Started

  1. Install dependencies:
pnpm install
  1. Start development server:
pnpm dev

Local Development Setup

  1. Clone the Repository

    git clone https://github.com/OWNER/podpix.git
    cd podpix

    Use your fork’s URL if you are contributing.

  2. Install Dependencies

    pnpm install
  3. Environment Setup Copy the example file and edit values (never commit real secrets):

    cp .env.example .env

    Required for the web app: VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY from your Supabase project. Optional: VITE_POSTHOG_KEY and VITE_POSTHOG_HOST for analytics.

    Edge Functions need additional secrets locally; see Testing Edge Functions and supabase/.env.example.

  4. Start Development Server

    pnpm dev

    This will start the development server with auto-reloading enabled.

  5. Build for Production

    pnpm build

Testing Edge Functions

  1. Start Local Supabase

    supabase start
  2. Start Edge Functions

    supabase functions serve --env-file ./supabase/.env

    Omit --env-file only if you do not need extra secrets beyond what the CLI provides.

  3. Test Edge Functions Use curl to test any edge function locally:

    curl -i -X POST 'http://127.0.0.1:54321/functions/v1/FUNCTION_NAME' \
    -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
    -H "Content-Type: application/json" \
    -d '{"key": "value"}'

    Example testing get-user-email function:

    curl -i -X POST 'http://127.0.0.1:54321/functions/v1/get-user-email' \
    -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0' \
    -H "Content-Type: application/json" \
    -d '{"userId": "test@example.com"}'

    Notes:

    • For functions that don't need auth, you can skip the Authorization header
    • For functions that don't need a payload, you can skip the -d parameter
    • The anon key shown above is for local development only
  4. Viewing Edge Function Logs

    When running supabase functions serve, logs will be displayed in real-time in the terminal. You'll see:

    • Function invocations: serving the request with supabase/functions/function-name
    • Errors and stack traces
    • Debug logs from console.log() statements
    • Dependencies being downloaded

    Example log output:

    [Info] Listening on http://localhost:9999/
    serving the request with supabase/functions/get-user-email
    [Error] Error in get-user-email function: SyntaxError: Unexpected end of JSON input

    You can also view logs in Supabase Studio at http://127.0.0.1:54323/project/default/functions

  5. Setting Up Edge Function Secrets

    Copy the template and fill in values (never commit supabase/.env):

    cp supabase/.env.example supabase/.env

    Typical keys include PERPLEXITY_API_KEY, OPENAI_API_KEY, ASSEMBLYAI_API_KEY, plus Supabase URL and keys as documented in supabase/.env.example.

    Then start edge functions with the env file:

    supabase functions serve --env-file ./supabase/.env

    The secrets will be available in your functions via Deno.env.get('SECRET_NAME').

    Root .env and supabase/.env are listed in .gitignore; do not commit real keys.

Available Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm build:dev - Build for development
  • pnpm lint - Run ESLint
  • pnpm preview - Preview production build

Project Structure

src/
├── components/     # Reusable UI components
├── pages/         # Page components
├── providers/     # Context providers
├── lib/          # Utility functions
└── App.tsx       # Main application component

Features in Detail

WebChat Interface

  • Type in any fantasy football question
  • Get AI-powered responses based on expert analysis
  • Real-time processing of your queries

Podcast Integration

  • Access insights from Fantasy Footballers Podcast and other expert sources
  • Ask specific questions about recent episodes
  • Get targeted advice based on expert opinions

Team Management

  • Track your fantasy team's performance
  • Monitor expert opinions about your players
  • Get personalized recommendations for your roster

Trend Analysis

  • Stay updated with latest fantasy football trends
  • Track player performance metrics
  • Make data-driven decisions

Contributing

See CONTRIBUTING.md for setup, Supabase CLI usage, and PR expectations.

License

This project is licensed under the MIT License.

Support

For support, please contact us through the Contact Us page in the application.

Syncing Local Database with Production

To reset your local database and sync it with production data:

  1. Create a snapshot of current production schema:
supabase migration new current_schema_snapshot
supabase db dump -f supabase/migrations/YYYYMMDDHHMMSS_current_schema_snapshot.sql
  1. Reset local database with new schema:
supabase db reset
  1. Dump and import production data:
# Dump only the data (no schema) from production
supabase db dump --data-only > prod_data.sql

# Import the data into local database
PGPASSWORD=postgres psql -h 127.0.0.1 -p 54322 -U postgres -d postgres -f prod_data.sql

Note: Replace YYYYMMDDHHMMSS with the timestamp from step 1.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages