web app for live tracking and score keeping for an annual golf tournament with friends
check CLAUDE.md for detailed documentation on:
- app logic (handicaps, scoring, points system)
- db structure and collections
- code architecture and key files
- dev conventions
Always keep it updated when making meaningful changes to the codebase.
![]() |
![]() |
![]() |
- create and manage multiple tournaments
- track tournament progress and completion status
- real-time tournament leaderboard
- support for multiple game formats (stroke play and match play)
- fourball pairing system (pair two matchups together)
- tournament completion locking (prevent changes after finalization)
- year selection when completing tournaments
- real-time score tracking and updates
- handicap scoring support with automatic adjustments
- stroke index management for each hole
- offline mode support with data persistence
- projected scores and current standings
- hole-by-hole score entry and validation
- auto-scrolling score entry interface
- enhanced input validation and error handling
- player profiles and statistics
- team assignments (usa vs europe format)
- player handicap tracking (calculated from historical scores)
- historical performance data
- player yearly statistics saved on tournament completion
- score preview before saving
- individual game scorecards
- match status tracking (not started, in progress, complete)
- automatic point calculation for both teams
- real-time game status updates
- detailed game statistics and analytics
- responsive design for mobile and desktop
- dark mode support
- real-time updates and notifications
- offline mode with sync capabilities
- intuitive score entry interface with auto-scroll
- game filtering by status
- enhanced security features
- improved input validation and error handling
- tournament configuration and setup
- stroke index management for courses
- user role management (admin/player)
- game completion validation
- tournament progress tracking
- user authentication and authorization
- real-time data synchronization
- local data persistence
- progressive web app capabilities
- cross-platform compatibility
- react 18
- typescript 5
- vite 7
- tailwind css
- firebase 12 (firestore, auth, storage)
- chart.js + react-chartjs-2
- vitest (testing)
- posthog (analytics)
- netlify (deployment)
- Node.js 22+ (check with
node -v) - npm (comes with Node.js)
- Firebase CLI (optional, for emulators):
npm install -g firebase-tools - Java 11+ (required for Firebase emulators):
java -version
-
Clone the repository
git clone https://github.com/12ian34/ruffryder.golf.git cd ruffryder.golf -
Install dependencies
npm install
-
Set up environment variables
Copy the example env file and fill in your values:
cp .env.example .env.local
Required variables:
Variable Description VITE_FIREBASE_API_KEYFirebase project API key VITE_FIREBASE_AUTH_DOMAINFirebase auth domain (e.g., project-id.firebaseapp.com)VITE_FIREBASE_PROJECT_IDFirebase project ID VITE_FIREBASE_STORAGE_BUCKETStorage bucket (e.g., project-id.appspot.com)VITE_FIREBASE_MESSAGING_SENDER_IDFirebase messaging sender ID VITE_FIREBASE_APP_IDFirebase app ID VITE_POSTHOG_API_KEYPostHog analytics key (optional for local dev) VITE_POSTHOG_HOSTPostHog host (default: https://eu.i.posthog.com)Optional variables for local development:
Variable Description VITE_USE_FIREBASE_EMULATORSet to trueto use local Firebase emulatorsVITE_POSTHOG_DEBUGSet to truefor PostHog debug mode -
Start the development server
npm run dev
Open http://localhost:5173 in your browser.
Using emulators lets you develop without affecting production data.
-
Install Firebase CLI (if not already)
npm install -g firebase-tools firebase login
-
Start the emulators
npx firebase emulators:start
This starts:
- Firestore: http://localhost:8080
- Auth: http://localhost:9099
- Storage: http://localhost:9199
- Emulator UI: http://localhost:4000
-
Enable emulator mode
Add to your
.env.local:VITE_USE_FIREBASE_EMULATOR=true
-
Restart the dev server to connect to emulators
| Command | Description |
|---|---|
npm run dev |
Start dev server (port 5173) |
npm run build |
Type-check + production build |
npm run type-check |
TypeScript validation only |
npm run lint |
ESLint check |
npm run preview |
Preview production build locally |
npx vitest run |
Run tests once |
npx vitest |
Run tests in watch mode |
npx vitest run --coverage |
Run tests with coverage report |
After editing firestore.rules, deploy to production:
npx firebase deploy --only firestore:rulesTo deploy indexes:
npx firebase deploy --only firestore:indexesSee CLAUDE.md for comprehensive documentation on:
- Scoring logic (handicaps, match play, points system)
- Database schemas and collections
- Code architecture and key files
- Security rules
- Known issues and roadmap
- Prefer functional and declarative patterns
- Use TypeScript
interfacefor object shapes,typefor unions - Use
as constobjects instead of enums - Keep components small; prefer composition
- Run tests before submitting PRs:
npx vitest run
Tests are in src/__tests__/ (300+ tests across 21 files).
npx vitest run # Run all tests once
npx vitest # Watch mode
npx vitest run --coverage # With coverage report
npx vitest run handicap # Run tests matching "handicap"

