An intelligent AI-powered learning platform that provides real-time feedback on student work through voice assistance, PDF annotation, and conversational AI tutoring.
- π Smart PDF Workspace - Upload PDFs and annotate them with an integrated drawing canvas
- π¨ Real-time Drawing - Draw, highlight, and mark up documents with multi-page support
- π Voice Interaction - Ask questions using voice input and receive audio feedback
- π€ AI-Powered Analysis - Automatic OCR processing and error detection using Mathpix & Google Gemini
- π¬ Conversational AI Tutor - Context-aware tutoring with conversation memory
- π΅ Natural Voice Feedback - Text-to-speech responses using ElevenLabs
- π€ Export Functionality - Save annotated PDFs with your work
- π― Auto-capture - Automatic screenshot capture 5 seconds after drawing stops
- Next.js 15.5 - React framework with Turbopack
- React 19 - UI library
- Tailwind CSS 4 - Styling
- React PDF - PDF rendering
- Fabric.js - Canvas drawing
- React Dropzone - File uploads
- FastAPI - Python web framework
- Google Gemini AI - Conversational AI and analysis
- Mathpix OCR - Handwriting and math formula recognition
- ElevenLabs - Text-to-speech synthesis
- Uvicorn - ASGI server
- Node.js 18.x or higher
- Python 3.8 or higher
- npm or yarn
- API Keys (see Configuration section)
-
Clone the repository
git clone https://github.com/your-username/FUJI-hackathon.git cd FUJI-hackathon -
Set up the Frontend
cd tutor npm install -
Set up the Backend
cd ../backend pip install -r requirements.txt
Create a .env file in the backend/ directory:
# Required API Keys
GEMINI_API_KEY=your_google_gemini_api_key_here
MATHPIX_APP_ID=your_mathpix_app_id_here
MATHPIX_APP_KEY=your_mathpix_app_key_here
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
# Optional: ElevenLabs Voice ID (default provided in code)
ELEVENLABS_VOICE_ID=your_preferred_voice_idGet your API keys:
- Google Gemini: https://makersuite.google.com/app/apikey
- Mathpix: https://mathpix.com/
- ElevenLabs: https://elevenlabs.io/
Create a .env.local file in the tutor/ directory:
NEXT_PUBLIC_API_URL=http://localhost:8000cd backend
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000
In a new terminal:
cd tutor
npm run devThe application will be available at http://localhost:3000
- Navigate to the Workspace page
- Upload a PDF document using drag-and-drop or the "Add PDF" button
- Enable Drawing Mode to annotate the document
- Your work will be automatically analyzed after 5 seconds of inactivity
- Click the "Talk" button to start voice recognition
- Ask your question or describe your problem
- The system will:
- Capture the current PDF page
- Process handwriting with OCR
- Analyze your work with AI
- Provide audio and text feedback
- Navigate to the Tutor page
- Type your questions in the chat interface
- Receive instant AI-powered responses
- Context is maintained throughout the conversation
- Click the "Export" button in the workspace
- Choose to export:
- Current page only
- All pages with annotations
- Download the annotated PDF
Primary Colors:
- Indigo:
#4F46E5(indigo-600) - Purple:
#9333EA(purple-600) - Pink:
#EC4899(pink-600)
Gradients:
- Primary:
from-indigo-600 to-purple-600 - Extended:
from-indigo-600 via-purple-600 to-pink-600
FUJI-hackathon/
βββ backend/ # FastAPI backend
β βββ main.py # Main API routes and logic
β βββ requirements.txt # Python dependencies
β βββ .env # Environment variables (create this)
β
βββ tutor/ # Next.js frontend
β βββ src/
β β βββ app/ # Next.js app directory
β β β βββ page.js # Home page
β β β βββ work/page.js # PDF workspace
β β β βββ tutor/page.js # AI chat tutor
β β β βββ login/page.js # Login page
β β βββ components/ # React components
β β βββ Navbar.js # Navigation bar
β β βββ DrawingCanvas.js # Canvas component
β βββ public/ # Static assets
β βββ .env.local # Environment variables (create this)
β
βββ README.md # This file
POST /api/ocr- Process image with Mathpix OCRPOST /api/analyze- Analyze student work with Gemini AIGET /api/voice- Get voice settingsPOST /api/voice- Update voice settingsPOST /api/chat- Chat with AI tutor
- Student uploads PDF β Renders in workspace
- Student draws/annotates β Auto-capture after 5 seconds
- Screenshot sent to Mathpix β OCR extracts LaTeX/text
- Data sent to Gemini AI β Analyzes work and context
- AI generates feedback β Text response created
- ElevenLabs TTS β Converts to natural speech
- Student receives β Audio playback + visual feedback panel
Port already in use:
uvicorn main:app --reload --port 8001API keys not working:
- Double-check
.envfile is in thebackend/directory - Ensure no extra spaces in API keys
- Verify API keys are active and have credits
PDF not rendering:
- Check that
pdf.worker.min.jsis in thepublic/folder - Clear browser cache and reload
Voice not working:
- Use Chrome or Safari (required for Web Speech API)
- Grant microphone permissions
- Check if backend is running
This project was created for the FUJI Hackathon.
- Usmaan Sayed
- Iqbal Ghanci
- Furqan Ahcom
- Jonathan Robin
- Google Gemini AI for intelligent tutoring
- Mathpix for OCR capabilities
- ElevenLabs for natural voice synthesis
- Next.js and FastAPI communities
Made with β€οΈ for students everywhere