A comprehensive Learning Management System with AI features including automatic transcription, translation, note generation, and personalized recommendations.
- User Authentication: JWT-based authentication with role-based access control (Student, Teacher, Admin)
- Course Management: Teachers can create and manage courses
- Video Upload & Processing:
- Upload lecture videos (MP4, AVI, MOV, MKV)
- Automatic transcription using Whisper (local, offline)
- Automatic caption generation (VTT format)
- Multi-language translation (Hindi, Kannada) via Gemini
- Auto-generated summaries and notes
- Quiz generation from lecture content
- Exam & Results Management: Upload and view exam results with question-wise analysis
- AI Recommendations:
- Student progress analysis and study plans
- Teacher feedback and teaching effectiveness insights
- Powered by LangGraph and Gemini
- Video Player: Watch videos with multi-language captions
- Dashboard: Personalized dashboards for students and teachers
- FastAPI: Python web framework
- MongoDB: Database with GridFS for file storage
- Whisper: Speech-to-text transcription (local, offline)
- Gemini API: Translation, summarization, and AI recommendations
- LangGraph: AI agent orchestration
- JWT: Authentication
- FFmpeg: Video/audio processing
- Next.js 14: React framework
- TypeScript: Type safety
- Tailwind CSS: Styling
- React Player: Video playback
- Axios: HTTP client
- Python 3.9+ installed
- Node.js 18+ installed
- MongoDB running (local or cloud)
- FFmpeg installed on system
- Gemini API key (get from https://makersuite.google.com/app/apikey)
Simply double-click start_application.bat in the project root. This will:
- Start the backend server on http://localhost:8000
- Start the frontend server on http://localhost:3000
- Open your browser automatically
Note: Make sure MongoDB is running before starting the application.
cd backend # Create virtual environment python -m venv venv # Activate virtual environment venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Create .env file (see Configuration section below) # Create required directories New-Item -ItemType Directory -Force -Path media, uploads # Run server python run.py
Backend will be available at: http://localhost:8000
cd frontend # Install dependencies npm install # Run development server npm run dev
Frontend will be available at: http://localhost:3000
Create a .env file in the backend/ directory:
MONGODB_URL=mongodb://localhost:27017 DATABASE_NAME=lms_db JWT_SECRET_KEY=your-secret-key-change-in-production-use-long-random-string JWT_ALGORITHM=HS256 JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30 GEMINI_API_KEY=your-gemini-api-key-here BACKEND_URL=http://localhost:8000 CORS_ORIGINS=http://localhost:3000,http://localhost:3001 MEDIA_ROOT=./media UPLOAD_DIR=./uploads REDIS_URL=redis://localhost:6379/0
Important:
- Replace
GEMINI_API_KEYwith your actual API key from Google AI Studio - If using MongoDB Atlas, replace
MONGODB_URLwith your connection string - Generate a strong
JWT_SECRET_KEY:python -c "import secrets; print(secrets.token_urlsafe(32))"
Create .env.local in the frontend/ directory:
NEXT_PUBLIC_API_URL=http://localhost:8000
Note: Default value is already set, so this step is optional.
- Download from: https://www.python.org/downloads/
- During installation, check "Add Python to PATH"
- Verify:
python --version
- Download from: https://nodejs.org/
- Install LTS version
- Verify:
node --version
Option A: MongoDB Community (Local)
- Download: https://www.mongodb.com/try/download/community
- Install and start MongoDB service
- Default connection:
mongodb://localhost:27017
Option B: MongoDB Atlas (Cloud - Recommended)
- Create free account: https://www.mongodb.com/cloud/atlas
- Create a free cluster
- Get connection string and update in
.env
Windows - Using Chocolatey:
choco install ffmpeg
Windows - Manual Installation:
- Download: https://www.gyan.dev/ffmpeg/builds/
- Extract to
C:\ffmpeg - Add
C:\ffmpeg\binto System PATH - Restart terminal
- Verify:
ffmpeg -version
Linux:
sudo apt-get update sudo apt-get install ffmpeg
Mac:
brew install ffmpeg
- Visit: https://makersuite.google.com/app/apikey
- Sign in with Google account
- Click "Create API Key"
- Copy and paste into
.envasGEMINI_API_KEY
smart-lms/
āāā backend/
ā āāā app/
ā ā āāā core/ # Configuration and security
ā ā āāā models/ # Pydantic models
ā ā āāā routers/ # API endpoints
ā ā āāā services/ # Business logic (Whisper, Gemini, LangGraph)
ā ā āāā database.py # MongoDB connection
ā ā āāā main.py # FastAPI app
ā āāā requirements.txt
ā āāā run.py
ā āāā start_server.bat # Backend startup script
ā āāā .env
ā
āāā frontend/
ā āāā app/ # Next.js pages and routes
ā āāā components/ # React components
ā āāā lib/ # API client and utilities
ā āāā package.json
ā āāā .env.local
ā
āāā start_application.bat # Unified startup script
āāā README.md
- Visit
http://localhost:3000 - Register as a Student, Teacher, or Admin
- Login with your credentials
- Create a course
- Upload lecture videos
- Wait for processing (transcription, translation, notes generation - typically 5-6 minutes)
- Upload exam results
- View AI-generated teaching feedback
- Browse and enroll in courses
- Watch videos with captions (multiple languages)
- View transcripts and notes
- Take auto-generated quizzes
- View exam results
- Get AI-generated study plans
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/auth/me- Get current user
GET /api/courses- List coursesPOST /api/courses- Create course (teacher)GET /api/courses/{id}- Get course detailsPOST /api/courses/{id}/enroll- Enroll in course (student)
GET /api/videos- List videosPOST /api/videos- Upload video (teacher)GET /api/videos/{id}- Get video detailsGET /api/videos/{id}/stream- Stream videoGET /api/videos/{id}/captions/{language}- Get captions
GET /api/exams- List examsPOST /api/exams- Create exam (teacher)GET /api/exams/{id}- Get exam details
GET /api/recommendations- Get recommendationsGET /api/recommendations/student/{id}/generate- Generate student recommendationsGET /api/recommendations/teacher/{id}/generate- Generate teacher feedback
API Documentation: Visit http://localhost:8000/docs for interactive Swagger UI
"python is not recognized"
- Reinstall Python with "Add to PATH" checked
- Or manually add Python to System PATH
"venv\Scripts\Activate.ps1 cannot be loaded"
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
"MongoDB connection failed"
- Check if MongoDB service is running:
Get-Service MongoDB - Start service:
Start-Service MongoDB(as Administrator) - Check connection string in
.envfile - For Atlas: Check IP whitelist and connection string
"FFmpeg not found"
- Verify FFmpeg is in PATH:
ffmpeg -version - Add FFmpeg bin folder to PATH
- Restart terminal after adding to PATH
"Port 8000 already in use"
- Close other applications using port 8000
- Or change port in
run.py
"ModuleNotFoundError" or import errors
# Make sure virtual environment is activated # Reinstall dependencies pip install -r requirements.txt --force-reinstall
"GEMINI_API_KEY not set"
- Ensure
.envfile exists inbackend/directory - Verify
GEMINI_API_KEYis set in.env - Restart backend server after updating
.env
Port 3000 already in use
npm run dev -- -p 3001
API Connection Issues
- Ensure backend is running on
http://localhost:8000 - Check CORS settings in backend
.env - Verify
NEXT_PUBLIC_API_URLin.env.local
Build Errors
# Clear Next.js cache Remove-Item -Recurse -Force .next npm run build
Video processing fails
- Ensure FFmpeg is installed:
ffmpeg -version - Check disk space for uploads
- Verify Gemini API key is valid
- Check backend logs for detailed error messages
Processing takes too long
- Video processing typically takes 5-6 minutes per video
- Processing happens in background - you can continue using the app
- Check backend logs for progress updates
- Whisper model runs locally - first run will download the model (~150MB for base model)
- Video processing happens asynchronously in the background
- Ensure sufficient disk space for video uploads
- Gemini API key is required for translation and AI features
- MongoDB should be running before starting the backend
- The application uses optimized full-text translation for faster processing
# Backend cd backend pytest # Frontend cd frontend npm test
# Frontend cd frontend npm run build npm start # Backend cd backend uvicorn app.main:app --host 0.0.0.0 --port 8000
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions:
- Check the troubleshooting section above
- Review API documentation at
http://localhost:8000/docs - Check backend logs for detailed error messages
Happy Learning! š