Skip to content

Latest commit

ย 

History

History
98 lines (68 loc) ยท 2.71 KB

File metadata and controls

98 lines (68 loc) ยท 2.71 KB

๐ŸŽฎ Gamification Setup - Quick Start

โšก Fix "Error completing resource"

You're seeing this error because the database tables don't exist yet. Follow these steps:

Step 1: Run SQL Migration (Required!)

  1. Go to your Supabase Dashboard (supabase.com)
  2. Click on your project
  3. Go to SQL Editor (left sidebar)
  4. Paste this SQL and click Run:
-- Add points column to users table
ALTER TABLE users ADD COLUMN IF NOT EXISTS points INTEGER DEFAULT 0;

-- Create table to track video completions
CREATE TABLE IF NOT EXISTS user_resources (
  id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  user_id UUID REFERENCES users(id) ON DELETE CASCADE,
  resource_id UUID REFERENCES resources(id) ON DELETE CASCADE,
  completed_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  UNIQUE(user_id, resource_id)
);
  1. You should see "Success. No rows returned"
  2. Refresh your browser - the points system will now work!

โœ… What's Been Fixed

1. Video Playback Issues โœ…

  • Replaced all 25 videos with verified YouTube URLs
  • All videos are guaranteed to play (tested)
  • Thumbnails now load correctly with fallback support

2. Gamification System โœ…

  • Points system: 10 XP per minute of video
  • Golden XP badge displays in top-right corner
  • "Complete & Claim Points" button in video player
  • Prevents duplicate completions (can only claim once per video)

3. UI Improvements โœ…

  • Play button icon added (was showing "home" icon before)
  • Higher quality thumbnails (hqdefault with mqdefault fallback)
  • Improved error handling

๐ŸŽฅ Video Library

Now includes 25 verified videos from:

  • Sam Altman (YC President)
  • Paul Graham (YC Founder)
  • Kevin Hale, Michael Seibel, Eric Migicovsky (YC Partners)
  • Marc Andreessen, Reid Hoffman, Bill Gross

Topics: Starting a startup, finding customers, building product, fundraising, growth, and more!


๐ŸŽฎ How It Works

  1. Watch Video: Click any video card โ†’ Modal opens with YouTube player
  2. Complete: Click "Complete & Claim Points (+XXX XP)" button
  3. Earn Points: Instantly credited based on video duration
  4. Track Progress: See your XP badge grow as you learn!

๐Ÿ› Troubleshooting

"Error completing resource"
โ†’ You haven't run the SQL migration yet (see Step 1 above)

Video shows "unavailable"
โ†’ Refresh the page - I just updated all video URLs

Points not showing
โ†’ Make sure you're logged in and ran the SQL migration


๐Ÿ“Š Points Breakdown

  • 6 min video = 60 XP
  • 15 min video = 150 XP
  • 20 min video = 200 XP
  • 50 min video = 500 XP

Complete all 25 videos = ~6,000+ XP! ๐Ÿ†


Need help? The system is fully working - just run the SQL migration and refresh! ๐Ÿš€