{"id":50798727,"url":"https://github.com/lordbuffcloud/bowlytics-app","last_synced_at":"2026-06-12T17:05:35.354Z","repository":{"id":328419740,"uuid":"918149163","full_name":"lordbuffcloud/bowlytics-app","owner":"lordbuffcloud","description":"Bowlytics is an advanced bowling analytics platform that helps bowlers track their performance, get AI-powered coaching advice, and improve their game through data-driven insights.","archived":false,"fork":false,"pushed_at":"2025-12-13T00:57:33.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T15:51:14.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lordbuffcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-17T10:48:24.000Z","updated_at":"2025-12-13T01:16:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d10c38f-f0f5-409e-b296-2a65b9bee018","html_url":"https://github.com/lordbuffcloud/bowlytics-app","commit_stats":null,"previous_names":["lordbuffcloud/bowlytics"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lordbuffcloud/bowlytics-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordbuffcloud%2Fbowlytics-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordbuffcloud%2Fbowlytics-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordbuffcloud%2Fbowlytics-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordbuffcloud%2Fbowlytics-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lordbuffcloud","download_url":"https://codeload.github.com/lordbuffcloud/bowlytics-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordbuffcloud%2Fbowlytics-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34253957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-12T17:05:34.791Z","updated_at":"2026-06-12T17:05:35.335Z","avatar_url":"https://github.com/lordbuffcloud.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bowlytics - Bowling Analytics Platform\n\nBowlytics is an advanced bowling analytics platform that helps bowlers track their performance, get AI-powered coaching advice, and improve their game through data-driven insights.\n\n## Features\n\n### Core Features\n- **Shot Tracking**: Record detailed information about each bowling shot\n  - Ball selection and characteristics\n  - Lane positioning and targeting\n  - Pin impact and results\n  - Oil pattern and lane conditions\n  \n- **AI Coach Bernie**: Get real-time coaching advice powered by GPT-4o\n  - Shot-by-shot analysis with ML-enhanced insights\n  - Pattern recognition and lane transition detection\n  - Targeted adjustments based on historical performance\n  - Performance insights with confidence scoring\n  \n### Advanced Machine Learning Features\n- **Enhanced ML Insights**:\n  - Advanced strike probability prediction using logistic regression\n  - Optimal positioning recommendations (board, arrow, impact point)\n  - Lane transition analysis with trend detection\n  - Ball recommendation engine with success rate analysis\n  - Speed optimization with confidence intervals\n  - Pattern-specific performance analysis\n  - Burn level impact assessment\n  \n- **Predictive Analytics**:\n  - Next shot recommendations based on current conditions\n  - Real-time strike probability predictions\n  - Optimal setup suggestions before each shot\n  - Lane condition predictions\n  \n### Advanced Analytics Dashboard\n- **Performance Dashboard**:\n  - Strike and spare percentages with trends\n  - Daily performance trends with visualizations\n  - Ball performance comparison\n  - Pattern-specific statistics\n  - Hot/cold streak tracking\n  - Optimal conditions identification\n  \n- **Advanced Analytics View**:\n  - Interactive performance charts (Chart.js)\n  - Ball-by-ball performance breakdown\n  - Pattern performance analysis\n  - Optimal conditions display\n  - Historical trend visualization\n  \n### Spare Analysis\n- **Intelligent Spare System**:\n  - Spare conversion probability prediction\n  - Historical spare attempt analysis\n  - Recommended approach for each pin configuration\n  - Success rate tracking by spare type\n\n## Project Structure\n\n```\nbowlytics_api/\n├── app.py              # Main Flask application\n├── db.py              # Database configuration\n├── models.py          # SQLAlchemy models\n├── ml_insights.py     # Machine learning analysis\n├── fix_data.py        # Data cleanup utilities\n├── frontend/          # Frontend files\n│   ├── index.html     # Main web interface\n│   └── server.py      # Frontend server\n├── data/              # Data storage\n│   ├── bowling_data.csv    # Shot history\n│   └── spare_stats.csv     # Spare attempt stats\n└── requirements.txt    # Python dependencies\n```\n\n## File Descriptions\n\n- `app.py`: Core backend application with API endpoints for shot tracking, analysis, and AI coaching\n- `db.py`: Database configuration and connection management\n- `models.py`: SQLAlchemy models defining data structures for shots and spare attempts\n- `ml_insights.py`: Machine learning algorithms for performance analysis and predictions\n- `fix_data.py`: Utility script for cleaning and maintaining data integrity\n- `frontend/index.html`: Main web interface with interactive dashboard and data entry forms\n- `frontend/server.py`: Simple Flask server for serving the frontend\n\n## Setup Instructions\n\n1. **Clone the Repository**\n   ```bash\n   git clone https://github.com/yourusername/bowlytics.git\n   cd bowlytics\n   ```\n\n2. **Create Virtual Environment**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install Dependencies**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Environment Setup**\n   Create a `.env` file in the root directory:\n   ```\n   OPENAI_API_KEY=your_api_key_here\n   DATABASE_URL=sqlite:///bowlytics.db\n   ```\n\n5. **Initialize Database**\n   ```bash\n   python -c \"from db import Base, engine; Base.metadata.create_all(bind=engine)\"\n   ```\n\n6. **Start the Backend**\n   ```bash\n   python app.py\n   ```\n\n7. **Start the Frontend**\n   ```bash\n   cd frontend\n   python server.py\n   ```\n\n8. **Access the Application**\n   Open your browser and navigate to:\n   - Frontend: http://localhost:5111\n   - API: http://localhost:8765\n\n## API Endpoints\n\n### Core Endpoints\n- `GET /bowling-shots`: Retrieve shot history\n- `POST /bowling-shot`: Record a new shot\n- `GET /ai-coach`: Get AI coaching advice (enhanced with ML insights)\n- `GET /dashboard-stats`: Get performance statistics with ML insights\n- `GET /last-shot`: Get the most recent shot data\n\n### Advanced Analytics Endpoints\n- `GET /advanced-analytics`: Get comprehensive analytics including:\n  - Daily performance trends\n  - Ball performance breakdown\n  - Pattern performance analysis\n  - Burn level impact\n  - Hot/cold streaks\n  - Optimal conditions\n  \n- `POST /predict-next-shot`: Get ML-powered next shot recommendation\n  - Requires current shot conditions in request body\n  - Returns optimal ball, position, speed, and strike probability\n\n### Spare Endpoints\n- `POST /spare-attempt`: Record a spare attempt\n- `POST /spare-analysis`: Analyze spare conversion probability and get recommendations\n\n## Dependencies\n\n- Flask: Web framework\n- SQLAlchemy: Database ORM\n- Pandas: Data analysis\n- OpenAI: AI coaching (GPT-4)\n- scikit-learn: Machine learning insights\n- python-dotenv: Environment management\n\n## Development\n\n1. **Database Migrations**\n   - The application uses SQLite by default\n   - Models are defined in `models.py`\n   - Run `fix_data.py` to clean data if needed\n\n2. **Adding Features**\n   - Backend: Add routes to `app.py`\n   - Frontend: Modify `index.html`\n   - ML: Enhance `ml_insights.py`\n\n3. **Testing**\n   ```bash\n   python test_endpoint.py\n   ```\n\n## Production Deployment\n\n1. **Server Requirements**\n   - Python 3.8+\n   - OpenAI API access\n   - Adequate storage for CSV files\n\n2. **Deployment Steps**\n   ```bash\n   # Install production dependencies\n   pip install gunicorn\n\n   # Start with gunicorn\n   gunicorn -w 4 -b 0.0.0.0:8765 app:app\n   ```\n\n3. **Using the Service File**\n   ```bash\n   # Copy service file\n   sudo cp bowlytics.service /etc/systemd/system/\n\n   # Start service\n   sudo systemctl start bowlytics\n   sudo systemctl enable bowlytics\n   ```\n\n## Security Notes\n\n1. **API Key Protection**\n   - Store OpenAI API key in `.env`\n   - Never commit API keys to version control\n\n2. **Data Privacy**\n   - Shot data is stored locally\n   - No personal information is collected\n   - Optional: Implement user authentication\n\n## Troubleshooting\n\n1. **Data Issues**\n   - Run `fix_data.py` to repair CSV files\n   - Check file permissions in data directory\n   - Verify CSV column headers\n\n2. **API Errors**\n   - Verify OpenAI API key\n   - Check network connectivity\n   - Review app.log for details\n\n3. **Frontend Issues**\n   - Clear browser cache\n   - Check browser console\n   - Verify API endpoint URLs\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- OpenAI for GPT-4 integration\n- scikit-learn for ML capabilities\n- Flask community for web framework\n- All contributors and users\n\n## Contact\n\nFor support or queries, please open an issue on GitHub.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordbuffcloud%2Fbowlytics-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordbuffcloud%2Fbowlytics-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordbuffcloud%2Fbowlytics-app/lists"}