AI-powered basketball scouting reports. Generate professional, coach-ready scouting reports on demand with smart caching, credit-based usage, and a personal report library.
Live: easyscout.xyz
- AI-Generated Reports β Professional scouting reports powered by OpenAI
- Smart Caching β Cached reports cost 0 credits (first request costs 1 credit)
- Personal Library β User-isolated report storage with PostgreSQL
- Credit System β Credit-based usage with transaction ledger
- Secure Auth β Supabase authentication with JWT tokens
- Dev Mode β Local testing with credit grants (no payment setup required)
- Backend: Flask (Python 3.10+)
- AI: OpenAI API (GPT-5.x)
- Database: PostgreSQL 17+ (Supabase or self-hosted)
- Auth: Supabase Auth
- Payments: Stripe (production only, not required for local dev)
- Frontend: HTML, Tailwind CSS, Vanilla JS
- Hosting: Render
easyscout/
βββ app.py # Flask application & API routes
βββ auth.py # Authentication helpers
βββ db.py # PostgreSQL data layer
βββ db_schema.sql # Complete database schema
βββ run_server.py # Development server entry point
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ tailwind.config.js # Tailwind CSS configuration
βββ services/
β βββ scout.py # Scouting report generation
β βββ reports.py # Report API endpoints
β βββ analytics.py # Analytics HTTP routes
β βββ ... # Other services
βββ utils/
β βββ analytics.py # PostHog SDK wrapper
β βββ name_matching.py # Name comparison primitives
β βββ similarity_matching.py # Report fuzzy search
β βββ embeddings.py # Vector math & similarity
β βββ cost_pricing.py # Model pricing lookup
β βββ payload_handler.py # Report data enrichment
β βββ prompts.py # Prompt loading
β βββ metrics.py # Instrumentation
β βββ ... # Other utilities
βββ templates/ # Jinja2 HTML templates
βββ static/ # CSS, JS, assets
βββ prompts/
βββ scout_instructions.example.txt
- Python 3.10+
- PostgreSQL 17+ (local or Supabase)
- OpenAI API key
- Supabase project (for auth and user management)
- Stripe account (optional, production only)
Note: Email features (Mailjet SMTP) are not required for local development. Supabase auth works out of the box with your project credentials.
-
Clone the repository
git clone https://github.com/yourusername/easyscout.git cd easyscout -
Create virtual environment
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env with your actual credentials -
Create the prompt file
# Copy example and customize cp prompts/scout_instructions.example.txt prompts/scout_instructions.txt # Edit prompts/scout_instructions.txt with your actual prompt
-
Run the application
python run_server.py
App runs at: http://127.0.0.1:5000
Requires PostgreSQL 17+. Run the schema file to create all tables (reports, credits, cost tracking, embeddings, metrics):
# Using psql
psql -h <host> -U <user> -d <db> -f db_schema.sql
# Or with DATABASE_URL
export DATABASE_URL="postgresql://user:pass@host:5432/dbname" # PowerShell: $env:DATABASE_URL="..."
python migrations/apply_migration.py ../db_schema.sqlNote: For local development, use DEV_TOOLS=1 mode to grant yourself credits for testing without Stripe setup.
See .env.example for full list.
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key from platform.openai.com |
OPENAI_MODEL |
Model name (e.g., gpt-5.2) |
DATABASE_URL |
PostgreSQL connection string |
SUPABASE_URL |
Supabase project URL |
SUPABASE_ANON_KEY |
Supabase anonymous key |
APP_BASE_URL |
Local: http://localhost:5000 |
DEV_TOOLS |
Set to 1 for development mode |
| Variable | Description |
|---|---|
ENABLE_OPENAI |
Enable OpenAI integration (1 or 0) |
SENTRY_DSN |
Sentry error tracking DSN |
SENTRY_ENV |
Sentry environment (e.g., development) |
SENTRY_TRACES_SAMPLE_RATE |
Sentry traces sample rate (0-1) |
| Variable | Description |
|---|---|
STRIPE_SECRET_KEY |
Stripe secret key |
STRIPE_PUBLISHABLE_KEY |
Stripe publishable key |
STRIPE_WEBHOOK_SECRET |
Stripe webhook signing secret |
GET /β Landing pageGET /appβ Main application (requires auth)GET /privacyβ Privacy policy
POST /api/scoutβ Generate or retrieve scouting reportGET /api/reportsβ List user's saved reportsGET /api/creditsβ Get current credit balancePOST /api/render_mdβ Render markdown to HTML
POST /api/dev/grant_creditsβ Grant credits (requiresDEV_TOOLS=1)
Instead of using Stripe, contributors can grant themselves credits for testing:
const token = (await window.sb.auth.getSession()).data.session.access_token;
fetch('/api/dev/grant_credits', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json'
},
body: JSON.stringify({ amount: 10 })
}).then(r => r.json()).then(console.log);export DEV_TOOLS=1 # Windows: set DEV_TOOLS=1
python run_server.pyMIT License - feel free to use for your own projects.
Contributions are welcome! Here's how to get started:
- Follow the Getting Started section above
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and test locally with
DEV_TOOLS=1
- Test the scouting flow end-to-end
- Use
DEV_TOOLS=1to grant credits for testing - Check the browser console and server logs for errors
- Frontend: Improve UI/UX (templates, static/)
- Backend: Add new API features or optimize existing ones (app.py, services/)
- Database: Improve schema or add new tables (db.py, db_schema.sql)
- Utilities: Add new helper functions or improve existing ones (utils/)
- Docs: Improve documentation and examples
- Commit with clear messages:
git commit -m 'Add feature: description' - Push to your branch:
git push origin feature/your-feature - Open a Pull Request with a description of your changes
- Use clear, descriptive variable names
- Follow PEP 8 for Python
- Add comments for complex logic
- Keep functions focused and testable
Questions? Open an issue or reach out!