AI-powered golf practice coach. Logs your range sessions, tracks progress, and tells you exactly what to work on next.
- Practice session logging (clubs, balls hit, duration, notes)
- Streak tracking and weekly goals
- Community feed
- AI coaching chat powered by Gemini — analyses your session history and gives personalised advice
- Google OAuth authentication
- Frontend — React + Vite, deployed on Vercel
- Backend — Supabase (auth, database, edge functions)
- AI — Google Gemini 2.5 Flash via Supabase Edge Function
- Node.js 20+
- A Supabase project
- A Google AI Studio API key (for the AI coach)
-
Clone the repo
git clone https://github.com/devingineer/SwingPilot.git cd SwingPilot -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root:VITE_SUPABASE_URL=your_supabase_project_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Start the dev server
npm run dev
Create a sessions table in your Supabase project:
create table sessions (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users not null,
date date not null,
duration integer not null,
balls integer not null,
clubs text[],
notes text,
created_at timestamptz default now()
);
alter table sessions enable row level security;
create policy "Users can manage their own sessions"
on sessions for all
using (auth.uid() = user_id);Deploy the AI chat function:
npx supabase functions deploy chat --project-ref your-project-refSet the Gemini API key as a secret:
npx supabase secrets set GEMINI_API_KEY=your-gemini-api-key --project-ref your-project-refEnable Google as an OAuth provider in your Supabase dashboard under Authentication → Providers. Set the redirect URL to https://your-domain.com/dashboard.
The frontend deploys automatically to Vercel on push to main via the Vercel GitHub integration.
Edge functions deploy automatically via GitHub Actions when any file under supabase/functions/ changes on main. Add these secrets to your GitHub repo (Settings → Secrets and variables → Actions):
| Secret | Value |
|---|---|
VITE_SUPABASE_URL |
Your Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Your Supabase anon key |
SUPABASE_ACCESS_TOKEN |
From supabase.com → Account → Access Tokens |
SUPABASE_PROJECT_REF |
Your Supabase project ref |