GolfRivals is a simple web application for tracking golf match results and maintaining player rankings. Players can record match results, and the application automatically updates a leaderboard based on wins.
- Record results of golf matches with 2-4 players
- Automatically update player rankings
- View real-time leaderboard
- Responsive design for mobile and desktop
- Frontend: Next.js, React, TypeScript, Tailwind CSS, Shadcn UI
- API: Next.js API Routes
- Database: Google Sheets (as a simple data store)
- Deployment: Cloudflare Pages
- Node.js 18+ and npm
- A Google account with access to Google Sheets
- A Google Cloud Platform account to create service account credentials
Create a .env.local file in the root directory with the following variables:
GOOGLE_SERVICE_ACCOUNT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYour private key here\n-----END PRIVATE KEY-----\n"
GOOGLE_SPREADSHEET_ID=your-spreadsheet-id-from-url
- Create a new Google Spreadsheet
- Create two sheets named "MatchResults" and "Rankings"
- In the "MatchResults" sheet, add headers: Timestamp, Winner, Player2, Player3, Player4, PlayerCount
- In the "Rankings" sheet, add headers: Player, Score
- Create a new project in Google Cloud Platform
- Enable the Google Sheets API
- Create a service account with "Editor" access to Google Sheets
- Download the JSON key file and extract the
client_emailandprivate_keyvalues - Share your Google Spreadsheet with the service account email address
# Clone the repository
git clone https://github.com/your-username/golfrivals.git
cd golfrivals
# Install dependencies
npm install
# Run the development server
npm run devVisit http://localhost:3000 to see the application running.
- Set up a Cloudflare Pages project
- Connect your GitHub repository
- Configure the build settings:
- Build command:
npm run build - Build output directory:
out
- Build command:
- Add your environment variables in the Cloudflare Pages dashboard
- Deploy your application
MIT