GHT

🏌️‍♂️ Par-Tracker 42 🤖

Release License Open Source Tech GitHub Pages

The Ultimate Answer to Your Golf Score Tracking Needs

A simple, web-based golf handicap calculator that helps golfers track their rounds and calculate their USGA Handicap Index. Built with vanilla HTML, CSS, and JavaScript, designed to be hosted on GitHub Pages with data storage via Google Sheets.

📋 Demo Notice: This live demo uses dummy golf data for demonstration purposes. To track your own golf rounds, fork this repository and follow the setup instructions below to connect your own Google Sheets.

🤖 AI-Powered Development

Par-Tracker 42 was created as a “vibe coding” session using Claude Sonnet 4 AI assistance, with human guidance and golf expertise provided by Carl Storms aka “The BIMsider”. Carl’s unfortunately high golf scores serve as the “dummy data” in the demo - though we assure you, those scores are very real! 🏌️‍♂️⛳

A collaboration between human creativity and AI efficiency - proving that even bad golfers can build good apps. And yes, “42” is indeed the ultimate answer… to golf score tracking! 🤖

✨ Features

🚀 Live Demo

View Live App (Uses dummy data for demonstration)

📱 Screenshot

GHT

🏗️ How It Works

  1. Add Rounds: Enter your golf round details including date, course, tees played, score, par, course rating, and slope
  2. Automatic Calculations: The app calculates score differentials and converts 9-hole rounds to 18-hole equivalents
  3. Dual USGA Handicaps: Uses official USGA method to calculate both “All Courses” and “Regulation Only” handicap indexes
  4. Separate Statistics: Track performance across all course types or focus on regulation courses only
  5. Data Persistence: All data is automatically saved to Google Sheets and synced across devices

Handicap Calculation Method

The app follows official USGA guidelines and provides two separate handicap calculations:

All Courses Handicap:

Regulation Courses Only Handicap:

Calculation Rules for Both:

🛠️ Setup Instructions

  1. Fork this repository to your GitHub account
  2. Set up Google Sheets storage:
    • Go to SheetDB.io and create a free account
    • Create a new Google Sheet with these column headers:
      id | date | course | tees | courseType | includeInHandicap | holes | score | par | adjScore | rating | slope | differential
      
    • Connect your sheet to SheetDB and get your API URL
  3. Update the API URL in script.js (line ~32):
    const SHEETDB_API_URL = 'YOUR_SHEETDB_API_URL_HERE';
    
  4. Enable GitHub Pages:
    • Go to repository Settings → Pages
    • Select “Deploy from a branch” → main branch
    • Your app will be live at https://yourusername.github.io/par-tracker-42

Option 2: Local Development

  1. Clone the repository:
    git clone https://github.com/yourusername/par-tracker-42.git
    cd par-tracker-42
    
  2. Set up SheetDB (same as above)

  3. Update the API URL in script.js

  4. Open index.html in your browser or use a local server:
    # Using Python
    python -m http.server 8000
       
    # Using Node.js
    npx serve .
    

📋 Important Notes

📊 Google Sheets Setup

Your Google Sheet should have these columns in this exact order:

Column Description Example
id Unique identifier 1672531200000
date Date played 2024-01-15
course Course name Pebble Beach
tees Tees played from Blue
courseType Type of course regulation
includeInHandicap Include in handicap true
holes Holes played 18
score Your score 85
par Course par 72
adjScore 18-hole equivalent 85
rating Course rating 73.2
slope Slope rating 131
differential Calculated differential 10.4

⚠️ Important: The “tees” column must be added as column D (after “course”) for the app to work correctly.

🎯 Usage Tips

🔧 Customization

Changing Colors

Edit the CSS variables in styles.css:

:root {
  --primary-green: #2c5530;
  --secondary-green: #4a7c59;
  --light-green: #e8f5e8;
}

Adding New Statistics

Add calculations in the updateStats() function in script.js.

Modifying Handicap Calculation

Edit the calculateHandicap() function to implement different handicap systems.

📁 File Structure

par-tracker-42/
├── index.html          # Main HTML structure with semantic markup
├── styles.css          # All styling, responsive design, and compact table layout
├── script.js           # JavaScript functionality, API calls, and modern error handling
└── README.md          # This file

🐛 Troubleshooting

Data not saving?

Handicap calculation seems wrong?

Table not displaying properly?

App not loading?

Made a data entry mistake?

📋 Version History

Version 2.1 (Current) - Enhanced with Tees Tracking

Version 2.0 - Cloud Storage

Version 1.0 - Browser Storage

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Some ideas for improvements:

📄 License

This project is open source and available under the BSD 3-Clause “New” or “Revised” License.

🏌️‍♀️ Acknowledgments


Happy Golfing! 🏌️‍♂️

Found this helpful? Please give it a ⭐ star on GitHub!