Skip to content

Instantly share code, notes, and snippets.

@arilivigni
Last active October 30, 2025 12:39
Show Gist options
  • Save arilivigni/ec5131407337a4b89866c474776ee53d to your computer and use it in GitHub Desktop.
Save arilivigni/ec5131407337a4b89866c474776ee53d to your computer and use it in GitHub Desktop.
Prompt files

American Football Game Stats Tracker & Report Generator

Build a comprehensive web application for tracking statistics during an American football game and generating detailed reports at the end.

Football Rules Reference

Basic Game Structure

  • Field: 100 yards long with 10-yard end zones at each end
  • Teams: 11 players per side on the field
  • Quarters: Four 15-minute quarters
  • Downs: Offense gets 4 attempts (downs) to advance 10 yards. Success grants a new set of 4 downs
  • Play clock: 40 seconds between plays (25 seconds after certain stoppages)

Scoring

  • Touchdown (6 points): Player carries ball into or catches ball in opponent's end zone
  • Extra Point (1 point): Kick through uprights after touchdown
  • Two-Point Conversion (2 points): Run or pass into end zone after touchdown
  • Field Goal (3 points): Kick through uprights during normal play
  • Safety (2 points): Defensive team tackles ball carrier in their own end zone

Key Rules

  • Possession: Team retains possession until they score, fail to gain 10 yards in 4 downs, turn the ball over (fumble/interception), or punt
  • Turnover: Change of possession via interception or fumble recovery
  • Penalties: Rule violations result in yardage penalties (5, 10, or 15 yards typically)
  • Clock Management: Clock stops for incomplete passes, out of bounds, timeouts, scores, and penalties
  • First Down: Achieved by advancing 10+ yards from line of scrimmage
  • Kickoff: Used to start each half and after scoring plays

Player Positions

Offensive Positions

  • QB (Quarterback): Throws passes, leads the offense, calls plays
  • RB (Running Back): Carries the ball on rushing plays, catches passes out of backfield
  • FB (Fullback): Blocks for running back, occasional ball carrier
  • WR (Wide Receiver): Catches passes, runs routes downfield
  • TE (Tight End): Blocks like offensive lineman, catches passes like receiver
  • OT (Offensive Tackle): Protects quarterback's blind side, blocks on running plays (Left/Right)
  • OG (Offensive Guard): Interior lineman, blocks for runs and passes (Left/Right)
  • C (Center): Snaps ball to quarterback, anchors offensive line

Defensive Positions

  • DE (Defensive End): Rushes passer from edge, sets edge against runs (Left/Right)
  • DT (Defensive Tackle): Interior lineman, stops runs up middle, rushes passer
  • NT (Nose Tackle): Lines up over center in 3-4 defense, occupies blockers
  • OLB (Outside Linebacker): Defends edge, covers backs/tight ends, rushes passer (Left/Right)
  • MLB/ILB (Middle/Inside Linebacker): Quarterback of defense, stops runs, covers middle
  • CB (Cornerback): Covers wide receivers, defends passes (Left/Right)
  • S (Safety): Last line of defense, covers deep passes, supports run defense
    • FS (Free Safety): Provides deep coverage, reads quarterback
    • SS (Strong Safety): Plays closer to line, hybrid coverage/run support

Special Teams Positions

  • K (Kicker/Placekicker): Kicks field goals, extra points, kickoffs
  • P (Punter): Punts ball on fourth down
  • LS (Long Snapper): Snaps ball for punts and field goals
  • H (Holder): Holds ball for field goal and extra point attempts
  • KR/PR (Kick/Punt Returner): Returns kickoffs and punts

Application Requirements

Core Features

1. Pre-Game Setup

  • Enter team names (Home/Away)
  • Set up rosters with:
    • Player names
    • Jersey numbers
    • Positions (from list above)
    • Option to designate captains
  • Configure game settings:
    • Date and time
    • Location/field
    • Weather conditions (optional)
    • Officials (optional)

2. Live Game Tracking

  • Track current quarter, time remaining, score
  • Record down and distance (e.g., "2nd & 7")
  • Track field position (yard line)
  • Display possession indicator
  • Timeout tracking (3 per half per team)
  • Log each play with:
    • Play type (run, pass, punt, field goal, kickoff, penalty, sack)
    • Players involved (by position and number)
    • Yards gained/lost
    • Result (completion, incompletion, touchdown, first down, etc.)
    • Starting and ending yard line

3. Offensive Statistics

Passing Stats (by QB)

  • Attempts
  • Completions
  • Completion percentage
  • Yards
  • Touchdowns
  • Interceptions
  • Sacks taken
  • QB Rating/Passer rating
  • Longest completion

Rushing Stats (by RB, QB, WR, etc.)

  • Carries
  • Yards
  • Average yards per carry
  • Touchdowns
  • Fumbles (lost/recovered)
  • Longest run

Receiving Stats (by WR, TE, RB)

  • Receptions
  • Targets
  • Yards
  • Average yards per catch
  • Touchdowns
  • Longest reception

Offensive Line

  • Sacks allowed
  • Pancake blocks (optional)

4. Defensive Statistics

Individual Defensive Stats

  • Tackles (solo)
  • Assists
  • Total tackles
  • Tackles for loss (TFL)
  • Sacks
  • Quarterback hits
  • Interceptions
  • Interception return yards
  • Pass deflections/breakups
  • Forced fumbles
  • Fumble recoveries
  • Fumble return yards
  • Defensive touchdowns

5. Special Teams Statistics

Kicking (K)

  • Field goal attempts/makes
  • Field goal percentage
  • Longest field goal
  • Field goals by distance (0-29, 30-39, 40-49, 50+)
  • Extra point attempts/makes
  • Kickoffs
  • Touchbacks

Punting (P)

  • Number of punts
  • Total yards
  • Average yards per punt
  • Longest punt
  • Punts inside 20
  • Touchbacks

Returns (KR/PR)

  • Kick returns / yards / average / longest / TDs
  • Punt returns / yards / average / longest / TDs
  • Fair catches

6. Game Flow Tracking

  • Drive summaries:
    • Number of plays
    • Total yards
    • Time of possession
    • Drive result (TD, FG, punt, turnover, downs)
  • Scoring plays chronology with time and description
  • Possession time per team
  • Turnover tracking with details
  • Red zone efficiency (scores/attempts when inside 20-yard line)

Team Statistics Summary

Track aggregate team stats:

  • Total Offense: Passing yards + rushing yards
  • First Downs: By rush, pass, penalty
  • Third Down Conversions: Attempts and conversions
  • Fourth Down Conversions: Attempts and conversions
  • Turnovers: Total giveaways
  • Penalties: Number and total yards
  • Time of Possession: Minutes and seconds
  • Sacks: Number and yards lost
  • Red Zone Efficiency: Touchdowns/total trips

End-of-Game Report

Generate a comprehensive report including:

1. Game Header

  • Final score
  • Date, time, location
  • Weather conditions
  • Quarter-by-quarter scoring summary

2. Team Statistics Comparison

Side-by-side comparison showing:

  • Total yards (passing + rushing)
  • Passing yards
  • Rushing yards
  • First downs
  • Third down efficiency (conversions/attempts)
  • Fourth down efficiency
  • Turnovers
  • Penalties/yards
  • Time of possession
  • Sacks allowed/yards

3. Individual Leaders

Passing Leaders

  • Player name, position, number
  • Completions/attempts, yards, TDs, INTs, rating

Rushing Leaders

  • Player name, position, number
  • Carries, yards, average, longest, TDs

Receiving Leaders

  • Player name, position, number
  • Receptions, yards, average, longest, TDs

Defensive Leaders

  • Tackles (solo + assists)
  • Sacks
  • Interceptions
  • Forced fumbles

Special Teams Leaders

  • Kicking stats
  • Punting stats
  • Return stats

4. Drive Chart

Table showing each possession:

  • Quarter
  • Starting field position
  • Plays
  • Yards
  • Time of possession
  • Result

5. Scoring Summary

Chronological list of all scoring plays:

  • Time
  • Team
  • Score type
  • Description
  • Score after play

6. Play-by-Play Log

Optional detailed log of every play in the game

7. Key Stats & Highlights

  • Game MVP consideration
  • Notable milestones
  • Longest plays
  • Key turnovers
  • Game-changing moments

User Interface Requirements

Design Principles

  • Speed: Quick-tap buttons for common plays during live action
  • Clarity: Large, readable text for outdoor viewing
  • Simplicity: Minimize taps needed to log plays
  • Forgiveness: Easy undo/edit for mistakes

Key UI Elements

  • Scoreboard always visible at top
  • Quick-access buttons for:
    • Common play types (run left, run middle, run right, short pass, long pass)
    • Player selection by position group
    • Outcomes (TD, first down, incomplete, turnover)
  • Down and distance calculator
  • Field position visualizer
  • Color-coded teams
  • Real-time stat updates visible during game
  • Confirmation prompts for critical actions (scoring, turnovers)

Technical Requirements

  • Responsive design for tablets and phones
  • Portrait and landscape orientation support
  • Works offline (sync when connection available)
  • Touch-optimized controls
  • High contrast for outdoor visibility
  • Auto-save every action

Data Management

Persistence

  • Automatic save after every play logged
  • Cloud backup (optional)
  • Export options:
    • PDF report
    • CSV data
    • JSON format
    • Share via email/text

Game Management

  • Save multiple games
  • Game library with search/filter
  • Season statistics aggregation
  • Team season records
  • Player career statistics across games
  • Comparison tools between games

Data Integrity

  • Validation to prevent impossible stats
  • Warnings for unusual entries
  • Play-by-play audit trail
  • Ability to edit historical plays
  • Backup before major edits

Advanced Features (Optional)

  • Video Integration: Link plays to video timestamps
  • Real-time Sharing: Live stats feed for fans/coaches
  • Charts & Graphs: Visual representation of stats
  • Tendencies: Track play-calling patterns
  • Opponent Scouting: Historical data on upcoming opponents
  • Multi-user Input: Multiple stat keepers for accuracy
  • Voice Commands: Hands-free stat entry
  • Automated Alerts: Milestones, records, unusual stats

Technical Implementation Notes

Recommended Approach

Build as a single-page application (React, Vue, or similar) with:

  • Local storage for offline capability
  • State management for complex game data
  • Component-based UI for modularity
  • Form validation for data accuracy
  • Progressive Web App (PWA) for mobile installation

Data Structure Considerations

  • Normalize player data (one source of truth)
  • Structure plays as discrete events
  • Link plays to drives
  • Link drives to quarters
  • Calculate aggregate stats from play data
  • Use timestamps for all events

Performance Requirements

  • Instant response to user input (<100ms)
  • Handle 150+ plays per game efficiently
  • Quick report generation (<2 seconds)
  • Smooth scrolling through play history
  • Minimal battery drain during 3-hour games

Success Criteria

The application should enable a user to:

  1. Set up a game in under 2 minutes
  2. Log a play in 3-5 seconds during live action
  3. Generate a complete statistical report instantly at game end
  4. Make corrections easily without disrupting flow
  5. Access historical game data weeks or months later
  6. Share professional-looking reports with coaches and players

Build this as a tool that makes football stat tracking efficient, accurate, and accessible for high school teams, youth leagues, recreational leagues, and serious football enthusiasts.

Lacrosse Statistics App

Make an application for tracking statistics for the players of a lacrosse team. This will be used to help coaches optimize team performance.

App Name: Lacrosse Stats Tracker Team Name: The Cherry Pickers

Application Requirements

There are 3 tabs for different modes, and a side panel for settings.

  • Setup - Features to manage the team.
  • Track Stats - Primary entry screen entering stats.
  • Reports - High level overview of the entire team.
  • Config Panel - Quickly access to various settings.

Setup

The Setup page is mainly used for organizing members of the team.

  • It should be easy to edit multiple names.

  • Provide an option to upload via CSV.

  • Provide an option to download via CSV.

  • Provide a "Download Sample CSV" file that provides the required format for uploading.

  • Ensure support for multiple player positions.

  • Provide a button to clear the stats but not the team.

  • Provide a button to clear everything.

  • If importing multiple times, update existing entries without deleting them or associated stats.

Track Stats

This page is the primary entry screen that allows the coach to enter scores live during the game.

  • Add a tab bar at the top to select the current quarter. Stats are stored associated to it.
  • Each player has 2 sets of buttons: offensive stats and defensive stats.
  • It should be easy to find a player and choose a statistic.
  • It should be easy to increase/decrease a statistic. Example: a + button and - button
  • Add a search field to quickly find a player.

Reports

  • Basic game info like: Game Name, Opponent, Date, Location
  • List top three players for every statistic.
  • Tables to select report view: Full Game, Q1, Q2, Q3, Q4.
  • Table showing all statistics.
  • Include totals for each player and overall for the game.
  • Button to export as CSV. All reports are included.
  • Button to save as PDF. All reports are included.

Config Panel

  • It should always be visible for easy access to change settings.
  • Add a dropdown toggle for display (Light, Dark, System). Default to the current phone's mode.
  • Readability - Provide 3 settings for easier viewing. (Compact, Spacious, Large Font)

Other considerations

  • Make it work best on phones. This will be used live during games.
  • The page should never need refreshed to view a change.
  • A player can have multiple positions. example: SSDM / LSM
  • Use the exact names for the player details and statistics.
  • All math for the statistics needs to be 100% accurate. This cannot ever be wrong.
  • Include sample data for 20 players for easily testing the app.
  • The Readability setting adjusts the layout for accessibility.

Background on lacrosse

There are 10 players on the field per team.

Positions

  • There are offensive and defensive players.
  • Attack and midfield are offense.
  • Long stick midfielder (LSM) is a cross between offensive and defensive.
  • Short stick defensive midfielders (SSDM) mostly play defense.
  • Close defense long poles mostly play defense.
  • Faceoff players are also called FOGOs.
  • Goalie

Player Details

  • First Name
  • Last Name
  • Number
  • Position
  • School Year (Freshman, Sophomore, Junior, Senior)
  • Hometown

Offensive statistics

  • Goals
  • Assists
  • Shots
  • Faceoff Win
  • Faceoff Loss

Defensive statistics

  • Ground balls (GBs)
  • Caused turnover (CTO)

Goalie statistics

These stats are only visible and trackable for people with the "Goalie" position.

  • Goals saved
  • Goals allowed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment