Skip to content

Repository files navigation

LearnFlow πŸ“š

An adaptive, intelligence-driven learning platform β€” built for students who want to study smarter, prepare for exams with confidence, and get personalized guidance from a cognitive tutor that teaches, not just answers.


🌟 Feature Overview

Feature Description
πŸ€– Concept Coach Interactive step-by-step cognitive tutor β€” Socratic guided learning
πŸ“ Rubric Evaluator Upload assignments and get detailed rubric-based intelligent feedback
πŸ“– Exam Preparation Syllabus upload, previous paper analysis, question bank generation
πŸ“… AI Strategy Roadmap Day-by-day exam study schedule tailored to your syllabus
🧠 Adaptive Quizzes ML-powered quiz engine that targets your weak areas
πŸ—‚οΈ Flashcard Generator AI-generated flashcards from your lecture notes
πŸ“„ Lecture Summarizer Automatically summarizes lengthy lecture PDFs
πŸ“Š Study Plan Long-term AI study plans based on your weaknesses
πŸ“ˆ Analytics Dashboard Real-time mastery tracking, streaks, and performance metrics
πŸ” Auth System JWT + Google OAuth 2.0

πŸš€ Core Features

1. πŸ€– Concept Coach AI (Flagship Feature)

An interactive AI tutor modelled after the Socratic method β€” it never just gives you the answer. Instead it:

  • Guides you step-by-step with targeted hints, formulas, and guided questions
  • Teaches like a real teacher: confirms understanding before moving on
  • Renders rich responses: bold, code, numbered steps, formula boxes, markdown headings
  • Quick action chips: "Give me a hint", "Show the formula", "Explain differently", "I got it, next step"
  • Full Gemini-style chat UI with typing indicator, copy, thumbs up/down, and a new-chat button
  • Powered by a Socratic system prompt via Gemini AI on the backend

2. πŸ“ AI Rubric Evaluator

Upload any assignment (PDF, DOCX, TXT) for intelligent rubric-based feedback:

  • Overall Score with colour-coded rating
  • Content Accuracy and Clarity & Logic sub-scores with progress bars
  • Originality Check with a circular gauge
  • Top Strengths and Actionable Suggestions from AI
  • Clean dark AI feedback panel with export option

3. πŸ“– Exam Preparation β€” Question Bank Generator

  • Upload syllabus (PDF or text) and previous question papers independently
  • Questions only generate when you explicitly click "Generate Questions" β€” no premature generation
  • Configure mark distribution: set how many questions per mark tier (e.g., 2-mark Γ— 5, 5-mark Γ— 3, 10-mark Γ— 2)
  • AI analyses syllabus deeply and generates detailed answers calibrated to each mark value
  • Filter questions by All / Frequent / Long Answer
  • Bookmark questions and toggle "Secure Centum Mode" for comprehensive coverage
  • High-Yield Pattern badges on questions derived from previous paper analysis

4. πŸ“… AI Strategy Roadmap (Exam-Focused)

  • Input your exam date and daily available hours
  • AI generates a day-by-day study schedule in a clean inline table format
  • Shows total days, study hours, and topics covered in a summary bar
  • Priorities are automatically derived from syllabus + previous paper patterns
  • This is distinct from the Study Plan (which is for long-term learning)

5. 🧠 Adaptive Quiz Engine

  • Generates MCQs from uploaded lecture notes using Gemini AI
  • Tracks topic mastery (0.0–1.0) and weakness scores per topic
  • Adaptive question selection:
    • 50% from identified weak topics
    • 50% matching your current accuracy-based difficulty
    • Avoids recently answered questions
  • Detailed results with time-taken, correct/incorrect breakdown, and explanations

6. πŸ“Š Study Plan (Long-Term Preparation)

  • AI-generated plans based on identified weak topics and learning history
  • Includes recommended resources, revision schedules, and practice prompts
  • Clearly differentiated from the Exam Strategy Roadmap

7. πŸ—‚οΈ Flashcard Generator

  • Auto-generate flashcards from lecture notes
  • Flip-to-reveal interaction, bookmark support, spaced-repetition ready

8. πŸ“„ Lecture Summarizer & Notes

  • Upload PDF or text lecture notes
  • AI-generated summaries with key concepts extracted
  • Smart OCR pipeline for scanned PDFs (Tesseract + Poppler)
  • Windows Explorer-style PDF preview panel

9. πŸ“ˆ Analytics Dashboard

  • Real-time accuracy, total questions, correct answers
  • Per-topic weakness scores with mastery progression
  • Quiz attempt history with performance metrics
  • User streaks (global and per-topic)

πŸ—οΈ Technology Stack

Backend

Layer Technology
Framework Django 5.x + Django REST Framework
Auth rest_framework_simplejwt (JWT) + django-allauth (Google OAuth)
Database SQLite (dev) β€” easily switchable to PostgreSQL
AI Engine Google Gemini 2.0 Flash via google-generativeai
PDF Processing Hybrid pipeline: pdfplumber + Tesseract OCR + Poppler
File Storage Django media files

Frontend

Layer Technology
Framework React 19
UI Library Material-UI (MUI) v7
Routing React Router DOM v7
HTTP Client Axios
File Upload react-dropzone
Charts Recharts
Animations Framer Motion
Design System Glassmorphism dark theme with gradient accents

πŸ—‚οΈ App Navigation

The sidebar contains all main sections, with Concept Coach AI highlighted as the flagship feature:

πŸ“Š  Dashboard
πŸ“–  Lecture Notes
❓  Practice Arena (Quiz)
πŸ“…  Study Plan
πŸŽ“  Exam Prep
πŸ—ƒοΈ  Flashcards
πŸ“„  Summarize Lecture
✦  Concept Coach AI       ← MAIN FEATURE
πŸ“‹  Rubric Evaluator
πŸ‘€  Profile

πŸ“‹ Prerequisites

  • Python 3.8+
  • Node.js 16+, npm 8+
  • Tesseract-OCR v5.0+ (for scanned PDFs)
  • Poppler (for PDF-to-image conversion)
  • Google Gemini API Key β€” Get one here
  • Google OAuth Credentials (optional) β€” for Google social login

πŸš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/yourusername/LearnFlow.git
cd LearnFlow

2. Backend Setup

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate          # Windows
# source venv/bin/activate     # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# β†’ Edit .env and set GEMINI_API_KEY=your_key_here

# Run migrations
python manage.py makemigrations
python manage.py migrate

# Create admin superuser
python manage.py createsuperuser

# Start server
python manage.py runserver
# β†’ Running at http://localhost:8000

3. Frontend Setup

cd frontend

npm install

npm start
# β†’ Running at http://localhost:3000

πŸ” Google OAuth Setup (Optional)

See GOOGLE_OAUTH_SETUP.md for the full guide.

Quick Steps:

  1. Create OAuth credentials in Google Cloud Console
  2. Add redirect URI: http://localhost:8000/accounts/google/login/callback/
  3. Configure in Django Admin (/admin) under Social Applications

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register/ Register new user
POST /api/auth/login/ Login β€” returns JWT tokens
POST /api/auth/refresh/ Refresh access token
GET /api/auth/me/ Get current user details
GET /accounts/google/login/ Google OAuth login

Lecture Notes

Method Endpoint Description
POST /api/upload-note/ Upload lecture note (text/PDF)
POST /api/upload-pdf/ Upload PDF with OCR support
GET /api/lectures/ List all lecture notes
GET /api/lectures/{id}/ Get specific lecture note
POST /api/lectures/{note_id}/summarize/ Summarize lecture note

Questions & Quizzes

Method Endpoint Description
POST /api/generate-questions/{note_id}/ Generate MCQ questions
GET /api/quiz/{note_id}/ Get quiz questions
POST /api/submit-mcq/ Submit MCQ answer
POST /api/adaptive/quiz/start/ Start adaptive quiz
POST /api/quiz-completed/ Mark quiz as completed

Analytics & Progress

Method Endpoint Description
GET /api/weak-topics/ Get weak topics for a note
GET /api/progress/ Get overall progress
GET /api/analytics/{note_id}/ Get analytics for specific note
GET /api/next-actions/ Get recommended next actions
GET /api/ai-insights/{note_id}/ Get AI-powered insights

Study Plans

Method Endpoint Description
POST /api/study-plan/ Generate personalized study plan
GET /api/study-plan/{note_id}/ Get study plan for note

Flashcards

Method Endpoint Description
POST /api/flashcards/generate/ Generate flashcards for a note

Exam Preparation

Method Endpoint Description
GET /api/exam/syllabi/ List all uploaded syllabi
POST /api/exam/syllabus/upload/ Upload exam syllabus (PDF/text)
POST /api/exam/syllabus/{id}/papers/ Upload previous question papers
POST /api/exam/syllabus/{id}/generate/ Generate exam questions with mark config
GET /api/exam/syllabus/{id}/questions/ Get generated exam questions
POST /api/exam/syllabus/{id}/strategy/ Generate AI study strategy roadmap
PUT /api/exam/question/{id}/update/ Update exam question
DELETE /api/exam/question/{id}/delete/ Delete exam question

Concept Coach AI

Method Endpoint Description
POST /api/ai-tutor/chat/ Send a chat message β€” AI responds using Socratic method

Rubric Evaluator

Method Endpoint Description
POST /api/ai-tutor/evaluate/ Upload assignment for rubric-based AI evaluation

Notifications

Method Endpoint Description
GET /api/notifications/ List all notifications
POST /api/notifications/{id}/mark-read/ Mark as read
POST /api/notifications/mark-all-read/ Mark all as read
DELETE /api/notifications/{id}/delete/ Delete notification

User Profile

Method Endpoint Description
GET /api/profile/ Get user profile
PUT /api/profile/ Update user profile

πŸ—„οΈ Database Models

Core Models

LectureNote

user Β· title Β· file (PDF) Β· content (text) Β· created_at

Question (MCQ)

lecture_note Β· topic Β· question_text Β· option_a/b/c/d Β· correct_option Β· explanation Β· difficulty (0.2–0.9)

UserAnswer

user Β· question Β· user_answer Β· is_correct Β· time_taken (seconds) Β· answered_at

TopicMastery

user Β· lecture_note Β· topic Β· mastery (0.0–1.0) Β· last_updated

TopicWeakness

user Β· lecture_note Β· topic Β· weakness_score (0.0–2.0)

UserStreak

user Β· topic (null = global) Β· streak (int) Β· last_updated

QuizAttempt

user Β· lecture_note Β· score Β· total_questions Β· completed_at

Badge

user Β· name Β· description Β· icon Β· earned_at

Exam Preparation Models

ExamSyllabus

user Β· title Β· content (extracted text) Β· file (PDF) Β· created_at Β· updated_at

PreviousQuestionPaper

exam_syllabus Β· file Β· content (extracted text) Β· uploaded_at

ExamQuestion

exam_syllabus Β· question_text Β· answer Β· marks Β· priority (1=highest) Β· topic Β· is_from_pattern

ExamConfiguration

exam_syllabus Β· total_marks Β· num_questions Β· mark_distribution (JSON) Β· secure_centum_mode


πŸ”„ Key Workflows

Learning Workflow

graph TD
    A[Upload Lecture Note] --> B[AI Generates MCQs]
    B --> C[Take Adaptive Quiz]
    C --> D[Track Performance]
    D --> E{Weak Topics?}
    E -->|Yes| F[AI Study Plan]
    E -->|No| G[Continue Learning]
    F --> H[Concept Coach AI Tutoring]
    H --> C
    G --> A
Loading

Exam Preparation Workflow

graph TD
    A[Upload Syllabus] --> B[Upload Previous Papers]
    B --> C[Configure Mark Distribution]
    C --> D[Generate Question Bank]
    D --> E[AI Strategy Roadmap]
    E --> F[Day-by-Day Study Schedule]
    F --> G[Practice Questions]
    G --> H[Concept Coach AI for Doubts]
Loading

Adaptive Learning Algorithm

Weakness Scoring:

  • Wrong answer: weakness_score += 0.15 + (difficulty Γ— 0.15)
  • Correct but slow: weakness_score += 0.03–0.08 Γ— difficulty
  • Correct and fast: weakness_score -= 0.1–0.15 Γ— mastery_gain

Mastery Calculation:

  • Learning rate: 0.05–0.12 based on difficulty
  • Correct: mastery += lr Γ— (1.0 - current_mastery)
  • Wrong: mastery -= lr Γ— 0.6 Γ— current_mastery
  • Clamped: 0.0 to 1.0

Question Selection:

  1. 50% from weak topics (easier questions first)
  2. 50% matching target difficulty (based on recent accuracy)
  3. Avoids last 100 answered questions

🎨 Design System

LearnFlow uses a consistent glassmorphism dark theme:

  • Background: Deep navy (#0a0f1e) with card blur (backdrop-filter: blur(16px))
  • Accent: Electric blue (#2563EB) with purple gradient (β†’ #7c3aed)
  • Cards: Semi-transparent glass with subtle borders (rgba(42, 59, 77, 0.7))
  • Typography: System font with bold weights (700–900) for headings
  • Animations: Smooth transitions (200ms), fade-in messages, bouncing typing dots

🚨 Troubleshooting

Gemini API 429 Rate Limit

  • Built-in retry logic with exponential backoff. Wait a few seconds and retry.

PDF Extraction Fails

  • Ensure Tesseract-OCR v5+ is installed and in PATH
  • Ensure poppler-utils (pdftoppm) is installed and in PATH

Questions Not Generating

  • Verify GEMINI_API_KEY in .env
  • Check backend terminal for detailed error logs

Concept Coach / Rubric Evaluator not responding

  • Confirm backend URL routing in backend/urls.py includes ai-tutor/ paths
  • Check the GEMINI_API_KEY is valid and has quota

Google OAuth Issues

  • Verify redirect URI matches exactly in Google Cloud Console
  • Check Site configuration in Django Admin

CORS Errors

  • Verify CORS_ALLOW_ALL_ORIGINS = True in Django settings (dev only)
  • Frontend must run on http://localhost:3000

πŸ“Š Django Settings Reference

# backend/settings.py

SIMPLE_JWT = {
    'ACCESS_TOKEN_LIFETIME': timedelta(minutes=60),
    'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
}

CORS_ALLOW_ALL_ORIGINS = True  # Set to specific origins in production

# Gemini API key loaded from .env
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")

πŸ“ Project Structure

LearnFlow/
β”œβ”€β”€ backend/              # Django project settings
β”œβ”€β”€ core/                 # Main Django app
β”‚   β”œβ”€β”€ models.py         # All database models
β”‚   β”œβ”€β”€ views.py          # Core API views (notes, quiz, analytics)
β”‚   β”œβ”€β”€ exam_views.py     # Exam preparation API views
β”‚   β”œβ”€β”€ ai_tutor_views.py # Concept Coach & Rubric Evaluator views
β”‚   β”œβ”€β”€ ai_utils.py       # Gemini AI wrapper
β”‚   └── urls.py           # URL routing
β”œβ”€β”€ frontend/
β”‚   └── src/
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ ConceptCoach.js      # β˜… Flagship AI tutor chatbot
β”‚       β”‚   β”œβ”€β”€ RubricEvaluator.js   # Assignment feedback tool
β”‚       β”‚   β”œβ”€β”€ ExamPreparation.js   # Question bank + strategy
β”‚       β”‚   β”œβ”€β”€ StudyPlan.js         # Long-term study planner
β”‚       β”‚   β”œβ”€β”€ Dashboard.js         # Main analytics dashboard
β”‚       β”‚   β”œβ”€β”€ Flashcards.js        # Flashcard study tool
β”‚       β”‚   β”œβ”€β”€ SummarizeLectures.js # Lecture summarizer
β”‚       β”‚   β”œβ”€β”€ Quiz.js              # Adaptive quiz engine
β”‚       β”‚   └── Profile.js           # User profile
β”‚       β”œβ”€β”€ layout/
β”‚       β”‚   └── SidebarLayout.js     # Main navigation sidebar
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   └── api.js               # Axios instance with JWT interceptor
β”‚       └── context/
β”‚           β”œβ”€β”€ AuthContext.js        # Auth state management
β”‚           └── ThemeContext.js       # Dark mode theme provider
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
└── README.md

πŸ§ͺ Testing

# Backend
python manage.py test
python manage.py test core

# Frontend
cd frontend && npm test

Happy Learning! πŸŽ“

LearnFlow β€” Study smarter, not harder.

About

LearnFlow is an AI-powered adaptive learning platform that delivers stepwise Socratic tutoring, adaptive quizzes, and exam-aligned study roadmaps. It tracks topic mastery, analyzes syllabi and past papers, provides rubric-based feedback, and supports multilingual explanations to build clarity, confidence, and measurable academic improvement.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages