All backend features have been successfully implemented:
- ✅ Database schema with users and speeches tables
- ✅ Row Level Security (RLS) policies on tables and storage
- ✅ Google OAuth authentication
- ✅ Speech submission API with YouTube URL validation
- ✅ Audio file upload via Supabase Storage (max 50 MB)
- ✅ Storage bucket
speech-audiofor audio files - ✅ Duplicate URL checking per user
- ✅ Weekly and all-time speech tracking
- ✅ Real-time leaderboard updates
- ✅ Auth components and modal UI with tabbed interface
IMPORTANT: Before enabling OAuth, configure your redirect URLs:
- Go to Supabase Dashboard
- Select your project (fcmxrgdcxcttwgorwpmf)
- Navigate to Authentication → URL Configuration
- Set Site URL to your production domain (e.g.,
https://yourdomain.com) - Add Redirect URLs:
https://yourdomain.com/auth/callback(production)http://localhost:3000/auth/callback(local development)
- In Supabase Dashboard, navigate to Authentication → Providers
- Find Google in the list and click Enable
- You'll need to:
- Create a Google OAuth Client in Google Cloud Console
- Add authorized redirect URIs:
https://fcmxrgdcxcttwgorwpmf.supabase.co/auth/v1/callback(Supabase callback)https://yourdomain.com/auth/callback(production)http://localhost:3000/auth/callback(for local development)
- Copy the Client ID and Client Secret to Supabase
The speech-audio storage bucket has been created via database migration with the following settings:
- Public access: Enabled (for playback)
- File size limit: 50 MB
- Allowed MIME types: All audio formats (audio/*)
- RLS policies:
- Authenticated users can upload to their own folders
- Public read access for all audio files
- Users can delete their own files
If you need to verify or manually create the bucket:
- Go to Storage in Supabase Dashboard
- Verify
speech-audiobucket exists - Check that RLS policies are enabled
For live leaderboard updates:
- In Supabase Dashboard, go to Database → Replication
- Enable replication for the
speechestable - This allows the app to receive real-time updates when new speeches are submitted
# Start development server
npm run dev
# Open browser to http://localhost:3000- Visit the app → See the leaderboard with weekly and all-time speech counts
- Click "Log In" → Authenticate with Google OAuth
- Click "New Speech" → Choose to submit either:
- An unlisted YouTube link (YouTube URL tab)
- Upload an audio file directly (Upload Audio tab, max 50 MB)
- Leaderboard updates → See rankings update in real-time
- Weeks start on Monday at 00:00:00
- The
week_start_dateis calculated and stored with each speech - Weekly counts reset automatically based on the current week
- Users cannot submit the same recording URL twice (YouTube or audio)
- Validation happens on both client and server side
- Error message shown if duplicate is detected
- File size limit: 50 MB (approximately 50 minutes of audio at standard quality)
- Supported formats: All audio formats (MP3, M4A, WAV, OGG, AAC, FLAC, etc.)
- Storage: Files are stored in Supabase Storage bucket
speech-audio - Organization: Files are organized by user ID in separate folders
- Access: Public read access for playback, authenticated write access only
id(UUID, references auth.users)email(TEXT)name(TEXT)avatar_url(TEXT)created_at(TIMESTAMPTZ)email_reminders_enabled(BOOLEAN, default: true)last_reminder_sent_at(TIMESTAMPTZ, nullable)focus_area(TEXT, nullable) - Current focus area for skill improvementcurrent_streak(INTEGER, default: 0) - Current consecutive days with speech submissionslongest_streak(INTEGER, default: 0) - Highest streak achievedlast_streak_date(DATE, nullable) - Date of last speech submission for streak calculationstreak_updated_at(TIMESTAMPTZ, nullable) - Timestamp of last streak update
id(UUID, primary key)user_id(UUID, foreign key to users)speech_url(TEXT) - stores either YouTube URL or Supabase Storage URLsubmitted_at(TIMESTAMPTZ)week_start_date(DATE)
- Public read access for audio playback
- Authenticated write access (users can upload to their own folders)
- 10 MB file size limit
- Supports all audio MIME types
- Row Level Security (RLS) enabled on all tables
- Authenticated users can only modify their own data
- Anyone can read leaderboard data
- YouTube URL validation prevents invalid submissions
- Cause: Supabase redirect URLs not configured for production domain
- Solution:
- Go to Supabase Dashboard → Authentication → URL Configuration
- Set Site URL to your production domain
- Add your production callback URL to Redirect URLs (e.g.,
https://yourdomain.com/auth/callback) - Also add it to Google Cloud Console authorized redirect URIs
- Verify redirect URIs in Google Cloud Console
- Check that Google provider is enabled in Supabase
- Ensure environment variables are loaded (restart dev server)
- Verify Supabase URL Configuration includes both production and localhost URLs
- Check browser console for errors
- Verify Realtime is enabled in Supabase
- Check that speeches table has replication enabled
- Make sure user is logged in before submitting speeches
- Clear browser cookies and try logging in again
- Verify Supabase auth middleware is working