A mobile app that analyzes your basketball shot using Gemini and MediaPipe.
mobile-app/: Expo (React Native) app.backend/: FastAPI Python server (Analysis Engine).prototype/: Original Python proof-of-concept.
- Create a project at supabase.com.
- Go to the SQL Editor in your Supabase dashboard.
- Copy the contents of
backend/schema.sqland run it to set up the tables and security policies. - Get your URL, Anon Key (for App), and Service Role Key (for Backend).
The backend handles video processing, calling Gemini API, and running MediaPipe.
-
Navigate to backend:
cd backend -
Create virtual environment (optional but recommended):
python -m venv venv # Windows .\venv\Scripts\activate # Mac/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up Environment Variables:
- Create a
.envfile inbackend/ - Add your keys:
GEMINI_API_KEY=your_gemini_key SUPABASE_URL=your_supabase_url SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
- Create a
-
Run the server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
The frontend allows recording/uploading videos and viewing results.
-
Navigate to app:
cd mobile-app -
Install dependencies:
npm install
-
Set up Environment Variables:
- Rename/Create
.env - Add Supabase keys:
EXPO_PUBLIC_SUPABASE_URL=your_supabase_url EXPO_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
- Rename/Create
-
Important: Update Backend URL
- Open
app/index.tsx - Update
BACKEND_URLto your machine's IP address if testing on a real device. - Use
http://10.0.2.2:8000for Android Emulator. - Use
http://localhost:8000for iOS Simulator.
- Open
-
Run the app:
npm run ios # or npm run android
- Auth: User logs in or signs up via the Mobile App.
- Input: User picks a video.
- Processing:
- App uploads video to
http://<backend>/process-videowith Auth Token. - Backend verifies user.
- Backend uploads video to Supabase Storage.
- Backend uploads to Gemini for analysis + runs MediaPipe.
- Backend saves results to Supabase Database.
- App uploads video to
- Result: App displays results.