README
Check out the rest of this README to discover more about the project, its features, and how to get started
Study Buddy - AI-Powered Study Assistant
An intelligent study companion that helps students learn with AI-powered chat, document analysis, and personalized study modes.
Features
π€ AI-Powered Chat: Chat with an AI tutor that adapts to your learning style
π Document Upload: Upload PDF, DOCX, or TXT files for AI to analyze
π Smart Study Modes: Choose from Active Learning, Break Mode, Focused, or Review
π Multi-Language Support: Available in 8 languages
π‘ Document Summarization: Get AI-generated summaries of your study materials
π― Context-Aware Answers: AI uses your uploaded notes to provide relevant answers
π Emotion Detection: AI adapts its tone based on your emotional state
Prerequisites
Python 3.8+ installed
Node.js 18+ installed
Google Gemini API Key - Get one from Google AI Studio
Quick Start
1. Install Dependencies
Backend (Python)
pip install -r requirements.txtFrontend (Node.js)
npm install2. Configure Environment
Create a .env file in the root directory:
GEMINI_API_KEY=your_actual_gemini_api_key_hereImportant: Replace your_actual_gemini_api_key_here with your actual Google Gemini API key.
3. Start the Application
Option A: Run Both Services (Recommended)
Terminal 1 - Backend:
python study_buddy_backend.pyBackend runs on http://localhost:8001
Terminal 2 - Frontend:
npm run dev:clientFrontend runs on http://localhost:5173
Option B: Use PowerShell Scripts
Backend:
.\start-backend.ps1Frontend:
.\start-client.ps14. Use the Application
Open your browser to
http://localhost:5173Upload study notes using the upload button (π€)
Ask questions about your notes or chat with the AI
The AI will automatically use your uploaded notes when answering
How to Use
Uploading Documents
Click the upload button (π€) in the chat input area
Select a PDF, DOCX, DOC, or TXT file
Wait for the upload confirmation
Start asking questions about your documents!
Chatting with AI
Type your question or message in the chat input
The AI will respond using your uploaded notes (if available)
Choose different study modes to change the AI's teaching style
Select your preferred language for responses
Getting Document Summaries
After uploading notes, you can ask:
"Can you summarize my notes?"
"What are the key concepts in my documents?"
"Give me a summary of the uploaded material"
API Endpoints
POST
/api/chat- Send chat messagesPOST
/api/notes/upload- Upload study notesPOST
/api/notes/ask- Ask questions about notesPOST
/api/notes/summary- Get document summaryGET
/api/personality-modes- Get AI personality modesGET
/health- Health check
Troubleshooting
See SETUP.md for detailed troubleshooting guide.
Common Issues
Backend won't start:
Check that
.envfile exists withGEMINI_API_KEYEnsure Python dependencies are installed:
pip install -r requirements.txt
Frontend can't connect to backend:
Verify backend is running on port 8001
Check browser console for errors
Ensure CORS is enabled (already configured in backend)
File upload fails:
Check file format (PDF, DOCX, DOC, TXT only)
Ensure file is not corrupted
Check backend logs for errors
Project Structure
βββ study_buddy_backend.py # FastAPI backend server
βββ client/ # React frontend
β βββ src/
β βββ components/ # React components
β βββ lib/ # API client and utilities
β βββ contexts/ # React contexts
βββ server/ # Express server (optional)
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ SETUP.md # Detailed setup guideDevelopment
The backend auto-reloads when code changes. The frontend uses Vite's hot module replacement for instant updates.
Notes
Backend stores data in memory (not persisted)
For production, use a database and vector store
CORS is enabled for all origins in development
License
MIT
Last updated