FanFocusAI is a personalized MLB highlights experience application. It allows fans to select their favorite teams and players and receive personalized audio, video, and text digests of the latest highlights.
- User Authentication: Login and Signup functionality.
- Personalized Dashboard: Users can select their favorite teams and players.
- Highlight Generation: Generate personalized audio, video, and text digests.
- Multi-language Support: Supports English, Spanish, and Japanese languages.
- Google Cloud Integration: Utilizes Google Cloud Services for data storage, AI models, and deployment.
- Python 3.x
- Node.js and npm
- Google Cloud account with enabled APIs for Storage, Video Intelligence, Translation, and AI Platform.
-
Set Up Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Set Google Cloud Credentials: Download the service account key for your project and set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable:export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/service-account-file.json"
-
Run the Flask Application:
python main.py
-
Navigate to the Frontend Directory:
cd frontend -
Install Dependencies:
npm install
-
Start the Development Server:
npm start
- Open Cloud Shell.
- Clone Your Repository:
git clone https://github.com/your-username/your-repo.git cd your-repo - Deploy Cloud Function:
gcloud functions deploy fanfocusai-api \ --runtime python39 \ --trigger-http \ --allow-unauthenticated \ --entry-point app \ --region your-region
-
Access the Application:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:8080
- Frontend:
-
Test Endpoints:
# Get player stats curl "http://localhost:8080/stats?player_id=player_id&season=2022" # Summarize text curl -X POST "http://localhost:8080/summarize" \ -H "Content-Type: application/json" \ -d '{"text": "Your text to summarize here."}' # Analyze video curl -X POST "http://localhost:8080/analyze" \ -H "Content-Type: application/json" \ -d '{"video_uri": "gs://path-to-your-video.mp4"}'
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push your changes to the branch.
- Open a pull request.
This project is licensed under the MIT License.
- Google Cloud for providing various APIs and services.
- MLB Stats API for providing access to historical and present-day data feeds.