An intelligent learning platform that transforms study materials into interactive flashcards and adaptive quizzes using natural language processing. StudyPal helps students learn more efficiently with AI-powered content analysis, spaced repetition algorithms, and personalized difficulty adjustment.
- Multi-format Support - Upload PDF, DOCX, or TXT files
- Intelligent Text Extraction - Parses complex documents with high accuracy
- AI Content Analysis - Automatically identifies key concepts, topics, and difficulty level
- Smart Summarization - Generates concise summaries using extractive NLP
- Auto-generation - Creates flashcards from uploaded documents using NLP
- Spaced Repetition (SM-2) - Optimizes review timing based on performance
- Manual Editing - Customize AI-generated cards to your preferences
- Progress Tracking - Monitor mastery levels for each card
- Multiple Question Types - Multiple choice, true/false, fill-in-the-blank
- Difficulty Adaptation - Adjusts based on user performance
- Instant Feedback - Detailed explanations for each answer
- Performance Analytics - Identifies strengths and knowledge gaps
- Study Session Tracking - Records time, cards reviewed, and accuracy
- Streak Monitoring - Gamified daily study streaks
- Progress Dashboard - Visual insights into learning patterns
- AI Recommendations - Personalized study suggestions
┌────────────────────────────────┐
│ React Frontend (TypeScript) │
│ - Document Upload Interface │
│ - Flashcard Review System │
│ - Quiz Taking Platform │
│ - Analytics Dashboard │
└───────────┬────────────────────┘
│ REST API
┌───────────▼────────────────────┐
│ Node.js + Express Backend │
│ - Authentication (JWT) │
│ - Document Management │
│ - Spaced Repetition Logic │
│ - Study Session Tracking │
└──┬─────────────────────┬───────┘
│ │
▼ ▼
┌──────────┐ ┌─────────────────────┐
│ MongoDB │ │ Python NLP Service │
│ │ │ (FastAPI) │
│ - Users │ │ - PDF Parsing │
│ - Docs │ │ - Text Analysis │
│ - Cards │ │ - Summarization │
│ - Quizzes│ │ - Flashcard Gen │
│ - Sessions│ │ - Quiz Generation │
└──────────┘ └─────────────────────┘
- React 18 with TypeScript
- Tailwind CSS for styling
- Lucide React for icons
- Axios for API requests
- React Router for navigation
- Node.js with Express.js
- TypeScript for type safety
- MongoDB with Mongoose ODM
- JWT for authentication
- Multer for file uploads
- Python 3.10+ with FastAPI
- spaCy for NLP tasks
- PyPDF2 for PDF parsing
- python-docx for Word documents
- scikit-learn for ML algorithms
- SM-2 Spaced Repetition - Optimizes flashcard review intervals
- Extractive Summarization - Sentence scoring and ranking
- Keyword Extraction - TF-IDF and noun phrase analysis
- Difficulty Estimation - Multi-factor text complexity analysis
node >= 18.0.0
python >= 3.10
mongodb >= 5.0- Clone the repository
git clone https://github.com/yourusername/studypal.git
cd studypal- Backend Setup
cd backend
npm install
cp .env.example .env
# Configure MongoDB URI and NLP API URL
npm run dev- NLP Service Setup
cd nlp_service
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m spacy download en_core_web_sm
uvicorn main:app --reload- Frontend Setup
cd frontend
npm install
cp .env.example .env
npm startBackend (.env)
MONGODB_URI=mongodb://localhost:27017/studypal
JWT_SECRET=your-secret-key
NLP_API_URL=http://localhost:8000
PORT=3000Frontend (.env)
REACT_APP_API_URL=http://localhost:3000/apiPOST /api/documents/upload- Upload and process documentGET /api/documents- List user's documentsGET /api/documents/:id- Get document detailsDELETE /api/documents/:id- Delete document
POST /api/flashcards/generate- Generate flashcards from documentGET /api/flashcards/due- Get cards due for reviewPOST /api/flashcards/:id/review- Submit flashcard reviewGET /api/flashcards- List all flashcardsPUT /api/flashcards/:id- Update flashcardDELETE /api/flashcards/:id- Delete flashcard
POST /api/quizzes/generate- Generate quiz from documentGET /api/quizzes- List available quizzesGET /api/quizzes/:id- Get quiz detailsPOST /api/quizzes/:id/start- Start quiz attemptPOST /api/quizzes/attempts/:id/submit- Submit quiz answers
POST /api/study/session/start- Start study sessionPOST /api/study/session/:id/end- End study sessionGET /api/study/analytics- Get study statistics
POST /nlp/parse-document- Extract text from filePOST /nlp/analyze- Analyze contentPOST /nlp/generate-flashcards- Create flashcardsPOST /nlp/generate-quiz- Create quiz questionsPOST /nlp/summarize- Generate summary
StudyPal implements the SuperMemo 2 (SM-2) algorithm for optimal review scheduling:
# Quality rating: 0-5 (0=blackout, 5=perfect)
new_EF = EF + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02))
if quality < 3: # Incorrect
interval = 1 day
repetitions = 0
else: # Correct
if repetitions == 0:
interval = 1 day
elif repetitions == 1:
interval = 6 days
else:
interval = previous_interval * EFBenefits:
- Cards you know well appear less frequently
- Struggling cards appear more often
- Review timing adapts to individual retention patterns
- Maximizes long-term memory retention
![Dashboard showing study stats, recent documents, and due flashcards]
![Interactive flashcard with flip animation and quality rating]
![Multiple choice quiz with instant feedback]
![Drag-and-drop upload with AI analysis progress]
- PDF: Uses PyPDF2 to extract text from all pages
- DOCX: Parses Word documents with python-docx
- TXT: Direct UTF-8 text reading
- Named Entity Recognition - Identifies people, places, concepts
- Noun Phrase Extraction - Finds key terms and topics
- Difficulty Estimation - Analyzes sentence complexity, vocabulary diversity
- Topic Modeling - Extracts main themes using frequency analysis
- Definition Detection - Finds "X is Y" patterns
- Important Sentence Selection - Scores based on keywords and length
- Key Term Extraction - Creates term-definition pairs
- Multiple Choice: Blanks out key terms, generates distractors
- True/False: Modifies statements to create false versions
- Adaptive Difficulty: Adjusts question complexity based on user level
{
front: String,
back: String,
spaced_repetition: {
easiness_factor: Number,
interval: Number,
repetitions: Number,
next_review_date: Date
},
review_history: [{
quality: Number,
response_time: Number
}]
}{
quiz_id: ObjectId,
answers: [{
question_id: ObjectId,
user_answer: String,
is_correct: Boolean
}],
score: Number,
performance_analysis: {
strengths: [String],
weaknesses: [String]
}
}- Document upload and parsing
- Flashcard generation
- Spaced repetition system
- Quiz generation
- Basic analytics
- Voice-to-text for flashcard answers
- Image occlusion for diagrams
- Collaborative study sets
- Mobile app (React Native)
- GPT integration for better content generation
- Personalized learning paths
- Predictive performance modeling
- Natural language quiz answers (not just multiple choice)
- Study groups and leaderboards
- Shared flashcard decks
- Peer tutoring matching
- Study challenges and competitions
# Backend tests
cd backend
npm test
# NLP service tests
cd nlp_service
pytest
# Frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2e- Document Processing: <5 seconds for typical PDF
- Flashcard Generation: ~10 cards per second
- Spaced Repetition Calculation: <10ms per card
- Quiz Generation: <3 seconds for 10 questions
- API Response Time: <100ms for most endpoints
- Authentication: JWT tokens with secure httpOnly cookies
- File Validation: Type and size checks before processing
- Input Sanitization: Prevents XSS and injection attacks
- Rate Limiting: Prevents API abuse
- Data Privacy: User data encrypted at rest
Through building StudyPal, I gained expertise in:
- Natural language processing with spaCy
- Complex algorithm implementation (SM-2)
- File parsing and text extraction
- MongoDB schema design for flexible data
- Microservices architecture
- Educational technology best practices
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
Your Name
- LinkedIn: linkedin.com/in/yourprofile
Built with ❤️ to help students learn more effectively through AI-powered study tools