Skip to content

sports module

docisit edited this page Jul 27, 2026 · 2 revisions

🏅 Sports Module

Athlete profiles, stats tracking, drills, leaderboards, and scouting tools — all optional via feature flag.


Overview

The Sports Module is an optional feature set designed for sports shows, recruiting platforms, and athletic programs. It transforms ITG Media App into a complete athlete management and scouting platform.

⚠️ Feature Flag: The Sports Module is controlled by SPORTS_MODULE_ENABLED in your .env. Set it to True to enable. See the Configuration page for details.


🔧 Enabling the Sports Module

# .env
SPORTS_MODULE_ENABLED=True

After enabling, restart your Django server. These features immediately become available:

  • Sports API endpoints
  • Athlete profile fields
  • Drills library
  • Leaderboards
  • Admin models

📊 Models are always in the database (no migration needed). The flag controls API/UI visibility.


🏈 Sports Management

Administrators can create and manage sports with recruiter-specific attributes.

API Endpoints

Endpoint Method Purpose
/api/sports/ GET List all available sports
/api/sports/ POST Create a new sport (admin)
/api/sports/attributes/ GET List recruiter attributes per sport

Sport Attributes

Each sport can define custom recruiter attributes, for example:

Sport Example Attributes
Football 40-yard dash, bench press, vertical jump, shuttle, position rank
Basketball Vertical leap, wingspan, 3-point %, assists per game
Baseball Exit velocity, pop time, fastball speed, ERA
Track & Field 100m, 200m, 400m, long jump, high jump times/marks

📊 Athlete Stats

Athletes can record stats with full history tracking and trend visualization.

Recording Stats

POST /api/stats/update/
{
  "sport": "football",
  "stat_type": "forty_yard_dash",
  "value": 4.52,
  "unit": "seconds",
  "notes": "Lasered at regional combine"
}

Stat History

Endpoint Purpose
/api/stats/history/<type>/ View trend data over time
/api/stats/history/<type>/?athlete=<id> Filter by specific athlete

Stat Types

Stats are flexible — you define the types. Common examples:

Category Example Stats
Speed 40-yard dash, 60-yard dash, 100m
Strength Bench press, squat, power clean, deadlift
Agility Shuttle run, 3-cone drill, L-drill
Vertical Standing vertical, max vertical, approach vertical
Academic GPA, SAT, ACT
Sport-Specific Any custom stat your sport requires

🏆 Leaderboards

Leaderboards rank athletes by stat, with filtering options.

Access

GET /api/leaderboard/<stat-type>/
GET /api/leaderboard/<stat-type>/?sport=football
GET /api/leaderboard/<stat-type>/?state=TX
GET /api/leaderboard/<stat-type>/?graduation_year=2026

Leaderboard Features

Feature Description
Per-Stat Rankings Leaderboard for each stat type
Sport Filtering Filter by specific sport
Location Filter Filter by state/region
Class Filter Filter by graduation year
Trend Arrows See if an athlete is trending up or down
Verified Badge Stats backed by video verification get a checkmark

🎯 Drills

A full drill library — coaches can create, athletes can practice and track results.

Drill Management

Endpoint Method Purpose
/api/drills/ GET List all drills
/api/drills/ POST Create a new drill (coach/admin)
/api/drills/<id>/ PUT Update drill details
/api/drills/<id>/ DELETE Remove a drill

Drill Structure

{
  "title": "Ladder Footwork - Ickey Shuffle",
  "sport": "football",
  "category": "agility",
  "difficulty": "intermediate",
  "description": "Step-by-step instructions...",
  "equipment": ["agility ladder", "cones"],
  "video_url": "https://example.com/drill-demo.mp4",
  "duration_minutes": 10
}

Drill Categories

Category Examples
Speed Sprints, resisted runs, overspeed training
Agility Ladder drills, cone drills, shuttle variations
Strength Weight room programs, bodyweight circuits
Conditioning Gassers, interval runs, sled pushes
Skill Position-specific technique drills
Recovery Stretching routines, mobility work

✅ Stat Verification

Stats can be verified with video proof, adding credibility for recruiters.

Verification Flow

Athlete Records Stat ──▶ Uploads Video Proof ──▶ Coach/Admin Reviews
                                                         │
                                                    ┌────┴────┐
                                                    ▼         ▼
                                               Verified    Rejected
                                                    │
                                                    ▼
                                        Badge appears on profile
                                        & leaderboard

Verification Endpoints

Endpoint Purpose
/api/stats/verifications/ List pending verifications (coach/admin)
/api/stats/verifications/<id>/approve/ Approve a stat verification
/api/stats/verifications/<id>/reject/ Reject with reason

Live Verification Requests

Athletes can request live verification — a coach watches them perform the stat via WebRTC and verifies it in real time. This uses the same LiveKit infrastructure as broadcasting.


🏅 Coach Verification

Coaches can earn a verified coach badge when their credentials are confirmed by an admin.

Coach Profile Fields

Field Description
is_verified_coach Badge shown on profile
years_of_experience Years coaching
certifications List of certifications (CSCS, USAW, etc.)

📱 Media Management

Athletes can upload media (photos, videos) with tagging for organization.

Endpoint Purpose
/api/media/<id>/tags/ Add key-value tags to media assets
/api/media/<id>/likes/ Like/unlike media assets

🗺️ Frontend Pages (Sports Module)

When enabled, these frontend pages become available:

Page URL Purpose
Leaderboard /leaderboard View stat rankings
Rankings /rankings Composite athlete rankings
Drills /drills Browse and filter the drill library
Profiles /profiles Enhanced athlete profiles with stats

🏗️ Architecture

The Sports Module is built as a set of conditional Django apps:

members/
├── models.py         # Core Profile (always loaded, sports fields conditional)
├── serializers.py    # Sports fields conditionally included
├── views.py          # Sports endpoints conditionally registered
├── admin.py          # Sports admin models conditionally registered
└── urls.py (backend) # Sports routes conditionally added

⏭️ Next Steps


← Back to Wiki Home

Clone this wiki locally