Your personal AI tutor with real-time voice interaction and animated avatar
- Animated character that talks to you with synchronized lip movements
- Voice synthesis powered by ElevenLabs
- Live subtitles showing what the tutor is saying
- Emotional expressions that adapt to your learning state
- Persistent learner profiles that remember your preferences
- Dynamic teaching strategies based on your cognitive style
- Emotional state tracking to detect frustration and boost confidence
- Progress visualization across topics and subjects
- Google Drive - Automatically sync study materials
- Notion - Import your notes and databases
- Canvas LMS - Connect to your courses (optional)
- Local uploads - Add any PDF, document, or notes
- Automatic material analysis using Gemini AI
- Quiz generation from your study materials
- Concept mapping and prerequisite tracking
- Personalized recommendations based on your progress
- Node.js 18+ and npm
- MongoDB Atlas account (free tier works)
- Gemini API key (from Google AI Studio)
- ElevenLabs API key (for voice synthesis)
git clone <your-repo-url>
cd amberlear
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate backend/.env file:
# Server
PORT=3001
NODE_ENV=development
# Database - Get from MongoDB Atlas
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/amberlear
# Security
JWT_SECRET=your-super-secret-key-min-32-characters
# AI - Get from https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your-gemini-api-key
# Voice - Get from https://elevenlabs.io
ELEVENLABS_API_KEY=your-elevenlabs-key
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
# Google Drive OAuth (optional)
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3001/api/connectors/google-drive/callback
# Frontend URL
FRONTEND_URL=http://localhost:5173- Go to mongodb.com/cloud/atlas
- Create a free cluster (M0 Sandbox)
- Create a database user (username/password)
- Whitelist your IP:
0.0.0.0/0(allow all for development) - Get your connection string and add to
.env
Gemini API (Required - Free tier available):
- Go to Google AI Studio
- Create API key
- Copy to
GEMINI_API_KEYin.env
ElevenLabs API (Required for voice):
- Sign up at elevenlabs.io
- Go to Profile β API Keys
- Copy to
ELEVENLABS_API_KEYin.env - Browse voices and update
ELEVENLABS_VOICE_IDif desired
# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run devVisit: http://localhost:5173
- Sign up and create your learning profile
- Talk or type - Use voice input or text chat
- Watch the avatar respond with synchronized lip movements
- See subtitles in real-time as the tutor speaks
- Get adaptive responses based on your learning style
User Input (Voice/Text)
β
Gemini AI (Context-Aware Response)
β
ElevenLabs (Voice Synthesis + Visemes)
β
Avatar Animation (Lip Sync)
β
Audio Playback + Subtitles
The system tracks:
- Response times - Detects confusion
- Success patterns - Builds confidence
- Mistake patterns - Identifies knowledge gaps
- Learning pace - Adjusts difficulty
- Emotional state - Provides encouragement
POST /api/auth/register - Create account
POST /api/auth/login - Sign in
POST /api/auth/refresh - Refresh token
POST /api/chat/message - Send message, get AI response with voice
GET /api/materials - List all materials
POST /api/materials/upload - Upload new material
POST /api/materials/:id/analyze - AI analysis
POST /api/materials/:id/quiz - Generate quiz
PUT /api/materials/:id/progress - Update progress
DELETE /api/materials/:id - Remove material
GET /api/progress/:userId - Get progress graph
POST /api/progress/:userId/mastery - Update topic mastery
GET /api/progress/:userId/recommendations - Get next topics
GET /api/connectors - List connections
POST /api/connectors/google-drive/connect - Connect Google Drive
POST /api/connectors/:type/sync - Sync materials
Edit frontend/src/components/AvatarTutor.tsx:
// Change colors
ctx.fillStyle = '#F3D5B5'; // Skin tone
ctx.fillStyle = '#4A3728'; // Hair color
ctx.fillStyle = '#6B46C1'; // Clothing colorIn backend/.env:
# Try different voices from ElevenLabs
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM # Rachel (default)
# Or: EXAVITQu4vr4xnSDxMaL (Bella)
# Or: pNInz6obpgDQGcFmaJgB (Adam)Edit backend/src/models/LearningProfile.ts to change default preferences.
- Check ElevenLabs API key is valid
- Ensure browser allows audio playback
- Check browser console for errors
- Verify canvas is rendering (check browser dev tools)
- Check that
isSpeakingprop is updating
- Verify OAuth credentials in Google Console
- Check redirect URI matches exactly
- Ensure Google Drive API is enabled
- Verify API key is correct
- Check you haven't exceeded free tier limits
- Review rate limiting in Gemini console
- Express.js - REST API
- MongoDB/Mongoose - Data persistence
- JWT - Authentication
- Gemini AI - Conversational responses
- ElevenLabs - Voice synthesis
- React 18 - UI framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Canvas API - Avatar rendering
- Web Speech API - Voice input
amberlear/
βββ backend/
β βββ src/
β β βββ config/ # DB, env config
β β βββ controllers/ # Route handlers
β β βββ models/ # MongoDB schemas
β β βββ services/ # AI, voice, adaption
β β βββ middleware/ # Auth, errors
β β βββ routes/ # API routes
β βββ .env
β
βββ frontend/
βββ src/
β βββ components/ # Avatar, UI components
β βββ hooks/ # useAuth, useTutorChat
β βββ App.tsx # Main application
βββ .env
- Push to Git repository
- Connect to hosting service
- Set environment variables
- Deploy!
- Build:
npm run build - Deploy
dist/folder - Set API URL environment variable
We welcome contributions! Areas for improvement:
- More avatar customization options
- Additional voice providers
- Enhanced viseme accuracy (ElevenLabs speech marks API)
- Multi-language support
- Mobile app version
- Spaced repetition algorithm
- Collaborative study sessions
MIT License - See LICENSE file
- Gemini AI - Conversational intelligence
- ElevenLabs - Realistic voice synthesis
- MongoDB - Flexible data storage
- Tailwind CSS - Beautiful UI components
Questions? Open an issue or reach out!