- Google Gemini API Key: Get your API key from Google AI Studio
- Vercel Account: Sign up at vercel.com
- GitHub Account: For version control and deployment
# Clone the repository (if not already done)
git clone <your-repo-url>
cd ai-tutor
# Install dependencies
npm install
# Create environment file
cp env.example .env.localEdit .env.local and add your actual API key:
GEMINI_API_KEY=your_actual_gemini_api_key_here
# Start development server
npm run dev
# Open http://localhost:3000
# Test both AI agents to ensure they work# Install Vercel CLI globally
npm install -g vercel
# Login to Vercel
vercel login
# Deploy
vercel --prod- Push your code to GitHub
- Go to vercel.com/dashboard
- Click "New Project"
- Import your GitHub repository
- Configure environment variables:
- Go to Project Settings → Environment Variables
- Add
GEMINI_API_KEYwith your actual API key
- Click "Deploy"
In your Vercel dashboard:
- Go to your project
- Click "Settings" → "Environment Variables"
- Add:
- Name:
GEMINI_API_KEY - Value: Your actual Gemini API key
- Environment: Production (and Preview if desired)
- Name:
- Visit your deployed URL
- Test the AI Syllabus Agent:
- Fill out the form with sample data
- Click "Generate My Curriculum"
- Verify you get a personalized curriculum
- Test the AI Teacher Agent:
- Enter a topic (e.g., "Photosynthesis")
- Select your level
- Click "Start Learning"
- Verify you get comprehensive teaching content
-
"GEMINI_API_KEY environment variable is required"
- Ensure you've added the environment variable in Vercel
- Redeploy after adding the variable
-
"Failed to generate curriculum/teaching content"
- Check your Gemini API key is valid
- Verify you have API quota remaining
- Check Vercel function logs for detailed errors
-
Build fails
- Ensure all dependencies are installed
- Check for TypeScript errors
- Verify Next.js configuration
In Vercel dashboard:
- Go to your project
- Click "Functions" tab
- Check logs for any errors
- Never commit
.env.localto version control - Keep your Gemini API key secure
- Consider using Vercel's environment variable encryption
- Monitor API usage to avoid unexpected charges
- The app is optimized for production with Next.js 14
- Static assets are automatically optimized
- API routes are serverless and scale automatically
- Consider implementing caching for frequently requested content
- Monitor your Gemini API usage in Google AI Studio
- Check Vercel analytics for user engagement
- Set up error monitoring if needed
If you encounter issues:
- Check the troubleshooting section above
- Review Vercel and Gemini API documentation
- Open an issue in the GitHub repository