- Create a Supabase project at supabase.com
- Get your credentials from Settings > API:
- Project URL
- Anon/public key
Create a .env.local file in your project root:
```env NEXT_PUBLIC_SUPABASE_URL=your_project_url_here NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here GEMINI_API_KEY=your_gemini_api_key_here ```
Run these SQL scripts in order in your Supabase SQL Editor:
```sql -- Copy and paste the contents of scripts/setup-database-clean.sql ```
```sql -- Copy and paste the contents of scripts/setup-policies.sql ```
```sql -- Copy and paste the contents of scripts/setup-functions.sql ```
```sql -- Copy and paste the contents of scripts/setup-storage.sql ```
- Go to Authentication > Settings in Supabase
- Disable email confirmations for development:
- Uncheck "Enable email confirmations"
- Add your site URL:
- Site URL:
http://localhost:3000 - Redirect URLs:
http://localhost:3000/**
- Site URL:
```bash npm install ```
```bash npm run dev ```
-
"Permission denied" errors:
- Make sure you're running SQL as the project owner
- Try running each script section separately
-
"Policy already exists" errors:
- The scripts now handle this automatically
- If you still get errors, manually drop policies first
-
File upload errors:
- Check that storage policies are set up correctly
- Verify your Supabase URL and keys
-
AI features not working:
- Verify your Gemini API key is correct
- AI features require a valid Gemini API key to function
- Go to Google AI Studio
- Create a new API key
- Add it to your
.env.localfile
- ✅ File Upload: Drag & drop with progress tracking
- ✅ AI Quiz Generation: Powered by Gemini AI
- ✅ Interactive Chat: Real-time AI conversation
- ✅ Achievement System: Gamified learning progress
- ✅ Progress Tracking: XP, levels, and streaks
- ✅ Responsive Design: Works on all devices
If you encounter any issues:
- Check the browser console for errors
- Verify all environment variables are set
- Ensure all SQL scripts ran successfully
- Check Supabase logs for database errors