https://github.com/beargallbladder/-golf-shot-transcription
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: beargallbladder
- Language: JavaScript
- Default Branch: main
- Size: 7.15 MB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
🏌️ Golf Shot Transcription App
A full-stack web application that uses AI to analyze golf simulator screenshots and extract shot metrics like speed, distance, spin, and launch angle.
🚀 Features
- AI-Powered Analysis: Upload golf simulator screenshots and get instant analysis using OpenAI GPT-4o Vision
- Google OAuth Authentication: Secure login with Google accounts
- Shot Dashboard: View and manage all your analyzed shots
- Leaderboard: Compete with other users across different metrics
- Social Sharing: Share your best shots with custom URLs
- Mobile-Friendly: Responsive design works on all devices
🏗️ Architecture
- Frontend: Next.js + React + TypeScript + Tailwind CSS (deployed on Vercel)
- Backend: Node.js + Express + PostgreSQL (deployed on Render)
- AI: OpenAI GPT-4o Vision API for image analysis
- Database: PostgreSQL with automatic migrations
- Authentication: Google OAuth 2.0 with JWT tokens
📋 Prerequisites
- Node.js 18+ and npm
- PostgreSQL database (or use Render's managed PostgreSQL)
- Google OAuth credentials
- OpenAI API key
🛠️ Setup Instructions
1. Clone the Repository
bash
git clone <repository-url>
cd golf-shot-transcription
npm install
2. Backend Setup
```bash cd backend npm install
Copy environment template
cp env.example .env
Edit .env with your credentials:
- DATABASE_URL (PostgreSQL connection string)
- GOOGLECLIENTID & GOOGLECLIENTSECRET
- OPENAIAPIKEY
- JWT_SECRET (generate a secure random string)
- SESSION_SECRET (generate a secure random string)
```
3. Frontend Setup
```bash cd frontend npm install
Create .env.local
echo "NEXTPUBLICAPI_URL=http://localhost:3001" > .env.local ```
4. Database Setup
bash
cd backend
npm run migrate
5. Google OAuth Setup
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3001/auth/google/callback(development)https://your-backend-domain.onrender.com/auth/google/callback(production)
6. OpenAI API Setup
- Get your API key from OpenAI Platform
- Add it to your backend
.envfile - Ensure you have sufficient credits for GPT-4o Vision API calls
🚀 Development
Start both backend and frontend in development mode:
```bash
From root directory
npm run dev
Or start individually:
Backend (port 3001)
cd backend && npm run dev
Frontend (port 3000)
cd frontend && npm run dev ```
Visit http://localhost:3000 to see the application.
🌐 Deployment
Backend Deployment (Render)
- Connect your GitHub repository to Render
- Create a new Web Service
- Use the
backenddirectory as the root - Set environment variables in Render dashboard
- Deploy using the provided
render.yamlconfiguration
Frontend Deployment (Vercel)
- Connect your GitHub repository to Vercel
- Set the root directory to
frontend - Add environment variable:
NEXT_PUBLIC_API_URL=https://your-backend-url.onrender.com - Deploy automatically on push to main branch
Environment Variables
Backend (.env)
env
NODE_ENV=production
DATABASE_URL=postgresql://username:password@hostname:port/database
JWT_SECRET=your-super-secret-jwt-key
SESSION_SECRET=your-session-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=https://your-backend.onrender.com/auth/google/callback
OPENAI_API_KEY=your-openai-api-key
FRONTEND_URL=https://your-frontend.vercel.app
Frontend (.env.local)
env
NEXT_PUBLIC_API_URL=https://your-backend.onrender.com
📱 Usage
- Sign In: Click "Continue with Google" to authenticate
- Upload Shot: Drag and drop or select a golf simulator screenshot
- View Analysis: See extracted metrics (speed, distance, spin, launch angle)
- Dashboard: View all your shots with statistics
- Leaderboard: Check rankings across different metrics
- Share: Copy share links to show off your best shots
🔧 API Endpoints
Authentication
GET /auth/google- Initiate Google OAuthGET /auth/google/callback- OAuth callbackGET /auth/me- Get current userPOST /auth/logout- Logout user
Shots
POST /api/shots- Upload and analyze shotGET /api/shots/me- Get user's shotsGET /api/shots/leaderboard- Get leaderboardDELETE /api/shots/:id- Delete shot
Sharing
GET /share/shot/:id- Public shot view
🧪 Testing
The app includes mock data functionality for development: - If no OpenAI API key is provided, it uses mock shot analysis - This allows testing the full flow without API costs
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
📄 License
This project is licensed under the MIT License.
🆘 Support
For issues and questions: 1. Check the GitHub issues 2. Create a new issue with detailed description 3. Include error logs and environment details
Built with ❤️ for golf enthusiasts who want to improve their game through data analysis!
Owner
- Name: Sam Kim
- Login: beargallbladder
- Kind: user
- Repositories: 2
- Profile: https://github.com/beargallbladder
GitHub Events
Total
- Push event: 59
- Create event: 2
Last Year
- Push event: 59
- Create event: 2
Dependencies
- nodemon ^3.0.2 development
- bcryptjs ^2.4.3
- cors ^2.8.5
- dotenv ^16.3.1
- express ^4.18.2
- express-rate-limit ^7.1.5
- express-session ^1.17.3
- express-validator ^7.0.1
- helmet ^7.1.0
- jsonwebtoken ^9.0.2
- multer ^1.4.5-lts.1
- openai ^4.20.1
- passport ^0.7.0
- passport-google-oauth20 ^2.0.0
- pg ^8.11.3
- @types/js-cookie ^3.0.6 development
- @types/node ^20.10.5 development
- @types/react ^18.2.45 development
- @types/react-dom ^18.2.18 development
- eslint ^8.56.0 development
- eslint-config-next 14.0.4 development
- typescript ^5.3.3 development
- @heroicons/react ^2.0.18
- autoprefixer ^10.4.16
- axios ^1.6.2
- js-cookie ^3.0.5
- next 14.0.4
- postcss ^8.4.32
- react ^18.2.0
- react-dom ^18.2.0
- react-dropzone ^14.2.3
- react-hot-toast ^2.4.1
- recharts ^2.8.0
- tailwindcss ^3.3.6
- concurrently ^8.2.2 development