EduNiverse Setup Guide
This guide will help you set up the EduNiverse project with Supabase and Gemini AI integration.
Prerequisites
Node.js 18+ installed
A Supabase account (free tier works)
Gemini API key
Step 1: Environment Variables
Create a .env file in the root directory with the following variables:
# Supabase Configuration
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
# Google Gemini AI Configuration
VITE_GEMINI_API_KEY=your-gemini-api-key
VITE_GEMINI_MODEL=gemini-2.5-flash
# RapidAPI Configuration (for Translation)
VITE_RAPIDAPI_KEY=your-rapidapi-key
# Backend API Configuration (optional)
VITE_API_URL=http://localhost:3001Step 2: Set Up Supabase
Create a Supabase Project:
Go to supabase.com
Create a new project
Wait for the project to be fully provisioned
Get Your Supabase Credentials:
Go to Project Settings → API
Copy the "Project URL" → This is your
VITE_SUPABASE_URLCopy the "anon public" key → This is your
VITE_SUPABASE_ANON_KEYUpdate your
.envfile with these values
Set Up the Database Schema:
Go to SQL Editor in your Supabase dashboard
Copy the contents of
supabase-schema.sqlPaste and run it in the SQL Editor
This will create all necessary tables, indexes, and security policies
Set Up Storage:
The schema includes storage bucket creation
If needed, you can also create it manually:
Go to Storage in Supabase dashboard
Create a new bucket named "notes"
Make it public if you want public file access
Step 3: Install Dependencies
npm installStep 4: Run the Development Server
npm run devThe app should now be running at http://localhost:8080
Step 5: Test the Integration
Test Authentication:
Go to
/registerand create a new accountCheck Supabase Auth → Users to see if the user was created
Check the
userstable to see if the profile was created
Test AI Features:
Go to
/ai-botand send a messageIt should get a response from Gemini AI
Go to
/notesand upload a text fileGenerate a summary, flashcards, or quiz
Test Roadmap:
Go to
/roadmapEnter a learning goal
Generate a roadmap (uses Gemini AI)
Troubleshooting
Authentication Issues
Error: "Supabase credentials not configured"
Make sure your
.envfile has the correct Supabase URL and anon keyRestart the dev server after updating
.env
Error: "Failed to create user"
Check Supabase dashboard → Authentication → Settings
Ensure email authentication is enabled
Check if email confirmation is required (disable for testing)
AI/Gemini Issues
Error: "Failed to get response from AI"
Check if the Gemini API key is correct
Verify you have API quota remaining
Check browser console for detailed error messages
Database Issues
Error: "relation does not exist"
Make sure you ran the
supabase-schema.sqlfileCheck Supabase dashboard → Database → Tables to verify tables exist
Error: "permission denied"
Check Row Level Security (RLS) policies
Ensure you're authenticated when making requests
Verify RLS policies in
supabase-schema.sqlwere created
Next Steps
Project Structure
src/
├── lib/
│ ├── supabase.ts # Supabase client configuration
│ └── gemini.ts # Gemini AI service functions
├── services/
│ ├── authService.ts # Authentication functions
│ ├── userService.ts # User profile functions
│ ├── notesService.ts # Notes and AI generation
│ └── roadmapService.ts # Roadmap generation
├── pages/ # React page components
├── components/ # Reusable UI components
└── store/ # Zustand state managementAPI Keys Security
⚠️ Important: Never commit your .env file to version control!**
The .env file is already in .gitignore, but make sure:
Don't share your API keys publicly
Use environment variables in production
Rotate keys if they're accidentally exposed
Support
If you encounter any issues:
Check the browser console for errors
Check Supabase logs (Dashboard → Logs)
Verify all environment variables are set correctly
Ensure all dependencies are installed
Last updated