Skip to content

Ranapriyanshi/DSAGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA-GPT: An Emotion-Aware Intelligent Tutoring System

Master Data Structures & Algorithms with AI-Powered, Emotion-Aware Tutoring

React FastAPI OpenAI GPT VADER

🎯 Overview

DSA-GPT is an innovative intelligent tutoring system that combines the power of Large Language Models (GPT-3.5) with real-time sentiment analysis (VADER) to provide personalized, emotion-aware learning experiences for Data Structures and Algorithms.

🌟 Key Features

  • 🧠 Emotion-Aware AI: Detects user emotional state and adapts teaching style
  • 📊 Personalized Analytics: Comprehensive progress tracking and emotional trends
  • 🎯 Interactive Quizzes: AI-generated assessments that adapt to your level
  • 💬 Real-time Chat: Contextual conversations with your AI tutor
  • 🔧 Multi-Language Support: Python, C++, and JavaScript examples
  • 📈 Progress Tracking: Detailed learning analytics and recommendations

🗺️ User Journey Map

Phase 1: Discovery & Onboarding

1.1 Landing Page Experience

┌─────────────────────────────────────────────────────────────┐
│                    Welcome to DSA-GPT                       │
├─────────────────────────────────────────────────────────────┤
│  🎯 Hero Section:                                           │
│  • "Master DSA with AI-Powered Emotion-Aware Tutoring"      │
│  • Key statistics: 30+ problems, 3 languages, 24/7 AI       │
│  • Call-to-action buttons: "Get Started Free" / "Sign In"   │
│                                                             │
│  🚀 Features Showcase:                                      │
│  • Emotion-Aware AI (🧠)                                    │
│  • Personalized Analytics (📊)                              │
│  • Interactive Quizzes (🎯)                                 │
│  • Real-time Chat (💬)                                      │
│  • Multi-Language Support (🔧)                              │
│  • Progress Tracking (📈)                                   │
│                                                             │
│  📋 How It Works:                                           │
│  1. Create Account → 2. Start Learning → 3. Track Progress │
└─────────────────────────────────────────────────────────────┘

1.2 Registration Process

┌─────────────────────────────────────────────────────────────┐
│                    Create Your Account                      │
├─────────────────────────────────────────────────────────────┤
│  📝 User Information:                                       │
│  • Full Name                                                │
│  • Email Address                                            │
│  • Password                                                 │
│                                                             │
│  🎯 Learning Preferences:                                   │
│  • Preferred Language: [Python/C++/JavaScript]             │
│  • DSA Level: [Beginner/Intermediate/Advanced]             │
│                                                             │
│  ✅ Account Creation:                                        │
│  • JWT token generation                                     │
│  • User profile initialization                              │
│  • Learning style assessment                                │
│  • Cognitive profile setup                                  │
└─────────────────────────────────────────────────────────────┘

Phase 2: Core Learning Experience

2.1 Dashboard Overview

┌─────────────────────────────────────────────────────────────┐
│                    Learning Dashboard                       │
├─────────────────────────────────────────────────────────────┤
│  📊 Quick Stats:                                            │
│  • Sessions completed: 12                                   │
│  • Problems solved: 8/30                                    │
│  • Average confidence: 3.8/5                                │
│  • Current streak: 5 days                                   │
│                                                             │
│  🎯 Recommended Actions:                                     │
│  • Continue learning path: "Binary Trees"                   │
│  • Review weak topics: "Recursion"                          │
│  • Take daily quiz: "Array Operations"                      │
│  • Chat with AI tutor                                       │
│                                                             │
│  📈 Recent Progress:                                        │
│  • Emotional trend chart                                    │
│  • Learning velocity graph                                  │
│  • Topic mastery indicators                                 │
└─────────────────────────────────────────────────────────────┘

2.2 Emotion-Aware Chat Experience

┌─────────────────────────────────────────────────────────────┐
│                    AI Tutor Chat                            │
├─────────────────────────────────────────────────────────────┤
│  💬 Conversation Flow:                                      │
│                                                             │
│  User: "I'm confused about recursion"                       │
│  [Sentiment: -0.4 (Frustrated)]                             │
│                                                             │
│  AI: "I understand recursion can be tricky! Let me help    │
│      you with a simple example..."                          │
│  [Adaptive Response: Encouraging + Simplified]              │
│                                                             │
│  🎯 Quiz Generation:                                         │
│  • Triggered when user shows positive sentiment             │
│  • Contextual to current topic                              │
│  • Adaptive difficulty based on user level                  │
│                                                             │
│  📊 Sentiment Tracking:                                      │
│  • Real-time VADER analysis                                 │
│  • Emotional trend visualization                             │
│  • Adaptive response generation                              │
└─────────────────────────────────────────────────────────────┘

2.3 Problem-Solving Journey

┌─────────────────────────────────────────────────────────────┐
│                    Problem Solving                          │
├─────────────────────────────────────────────────────────────┤
│  📋 Problem Selection:                                       │
│  • Browse by difficulty: Basic/Intermediate/Advanced        │
│  • Filter by language: Python/C++/JavaScript                │
│  • Search by topic: Arrays, Trees, Graphs, etc.             │
│                                                             │
│  🔍 Problem Analysis:                                        │
│  • Read problem description                                 │
│  • View examples and constraints                            │
│  • Check difficulty indicators                              │
│                                                             │
│  💻 Solution Development:                                    │
│  • Monaco code editor with syntax highlighting              │
│  • Language-specific templates                              │
│  • Real-time error detection                                │
│                                                             │
│  🤖 AI Assistance:                                           │
│  • "Explain in detail" - Step-by-step breakdown             │
│  • "Check my approach" - Code review and suggestions        │
│  • "Show solution" - Complete implementation                │
│  • "Generate test cases" - Custom test scenarios            │
└─────────────────────────────────────────────────────────────┘

Phase 3: Advanced Features

3.1 Analytics & Insights

┌─────────────────────────────────────────────────────────────┐
│                    Learning Analytics                       │
├─────────────────────────────────────────────────────────────┤
│  📊 Performance Metrics:                                     │
│  • Quiz accuracy over time                                  │
│  • Problem-solving success rate                             │
│  • Time spent per topic                                     │
│  • Learning velocity trends                                 │
│                                                             │
│  😊 Emotional Intelligence:                                  │
│  • Sentiment trend analysis                                 │
│  • Frustration detection and intervention                   │
│  • Confidence level tracking                                │
│  • Engagement pattern analysis                              │
│                                                             │
│  🎯 Personalized Insights:                                   │
│  • Weak topic identification                                │
│  • Recommended study schedule                               │
│  • Learning style optimization                              │
│  • Progress predictions                                     │
└─────────────────────────────────────────────────────────────┘

3.2 Personalization & Adaptation

┌─────────────────────────────────────────────────────────────┐
│                    Personalization Panel                    │
├─────────────────────────────────────────────────────────────┤
│  🧠 Learning Style Assessment:                               │
│  • Visual preference: 0.7/1.0                               │
│  • Auditory preference: 0.3/1.0                             │
│  • Kinesthetic preference: 0.8/1.0                          │
│  • Reading preference: 0.5/1.0                              │
│                                                             │
│  🧩 Cognitive Profile:                                       │
│  • Working memory capacity: 0.6/1.0                         │
│  • Processing speed: 0.7/1.0                                │
│  • Attention span: 0.8/1.0                                  │
│  • Pattern recognition: 0.9/1.0                             │
│                                                             │
│  🎯 Adaptive Features:                                       │
│  • Dynamic difficulty adjustment                             │
│  • Personalized learning paths                              │
│  • Custom explanation styles                                │
│  • Targeted intervention strategies                         │
└─────────────────────────────────────────────────────────────┘

3.3 Spaced Repetition System

┌─────────────────────────────────────────────────────────────┐
│                    Spaced Repetition                        │
├─────────────────────────────────────────────────────────────┤
│  📅 Review Schedule:                                         │
│  • Today's reviews: 3 topics                                │
│  • Upcoming reviews: 5 topics                               │
│  • Mastered topics: 12 topics                               │
│                                                             │
│  🎯 Review Sessions:                                         │
│  • Topic: "Binary Search"                                   │
│  • Difficulty: 3/5                                          │
│  • Last reviewed: 3 days ago                                │
│  • Success rate: 85%                                        │
│                                                             │
│  📈 Progress Tracking:                                       │
│  • Retention curve analysis                                 │
│  • Optimal review intervals                                 │
│  • Long-term memory consolidation                           │
│  • Knowledge decay prevention                               │
└─────────────────────────────────────────────────────────────┘

🏗️ Technical Architecture

Frontend (React + TypeScript)

┌─────────────────────────────────────────────────────────────┐
│                    Frontend Architecture                    │
├─────────────────────────────────────────────────────────────┤
│  🎨 Core Components:                                         │
│  • App.tsx - Main application router                        │
│  • EmotionAwareChat.tsx - AI tutor interface                │
│  • AnalyticsDashboard.tsx - Learning analytics              │
│  • BookmarkManager.tsx - Save and organize content          │
│  • LearningPathManager.tsx - Personalized curriculum        │
│  • PersonalizationPanel.tsx - User preferences              │
│  • SessionControls.tsx - Learning session management       │
│  • SpacedRepetitionManager.tsx - Review scheduling          │
│  • VisualDSARenderer.tsx - Mermaid diagram support          │
│                                                             │
│  🎯 Key Features:                                            │
│  • Real-time sentiment visualization                        │
│  • Interactive code editor (Monaco)                         │
│  • Responsive design (Tailwind CSS)                         │
│  • Dark/light theme support                                 │
│  • Progressive Web App capabilities                         │
└─────────────────────────────────────────────────────────────┘

Backend (FastAPI + Python)

┌─────────────────────────────────────────────────────────────┐
│                    Backend Architecture                     │
├─────────────────────────────────────────────────────────────┤
│  🔧 Core Services:                                           │
│  • main.py - FastAPI application entry point                │
│  • auth.py - JWT authentication and user management         │
│  • database.py - SQLModel ORM and database operations       │
│  • models.py - SQLModel data models                         │
│                                                             │
│  🛣️ API Routers:                                             │
│  • /users - User registration and authentication            │
│  • /chat - Emotion-aware AI tutoring                        │
│  • /sentiment - VADER sentiment analysis                    │
│  • /questions - DSA problem management                      │
│  • /analytics - Learning analytics and insights             │
│  • /personalization - User preferences and adaptation       │
│  • /research - Data collection for studies                  │
│  • /ai - Advanced AI features                               │
│                                                             │
│  🤖 AI Integration:                                          │
│  • OpenAI GPT-3.5-turbo for tutoring                        │
│  • VADER sentiment analysis                                 │
│  • Adaptive prompt generation                               │
│  • Context-aware responses                                  │
└─────────────────────────────────────────────────────────────┘

Database Schema

┌─────────────────────────────────────────────────────────────┐
│                    Database Design                          │
├─────────────────────────────────────────────────────────────┤
│  👥 User Management:                                         │
│  • User - Basic user information and preferences            │
│  • LearningStyle - Visual, auditory, kinesthetic preferences│
│  • CognitiveProfile - Working memory, processing speed      │
│                                                             │
│  📚 Learning Content:                                        │
│  • Question - DSA problems with solutions                   │
│  • UserQuestionProgress - Individual progress tracking      │
│  • LearningPath - Personalized curriculum paths             │
│                                                             │
│  💬 Interaction Tracking:                                    │
│  • UserSession - Learning session management                │
│  • ChatMessage - Conversation history                       │
│  • EmotionalTrend - Sentiment analysis data                 │
│  • Quiz - Generated assessments and results                 │
│                                                             │
│  🔖 Advanced Features:                                       │
│  • Bookmark - Saved content and notes                       │
│  • SpacedRepetition - Review scheduling                     │
│  • SessionPause - Session interruption tracking             │
└─────────────────────────────────────────────────────────────┘

🚀 Getting Started

Prerequisites

  • Node.js 16+ and npm
  • Python 3.8+
  • OpenAI API key
  • SQLite (or PostgreSQL for production)

Installation

1. Clone the Repository

git clone https://github.com/yourusername/dsa-gpt.git
cd dsa-gpt

2. Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Set environment variables
echo "OPENAI_API_KEY=your_openai_api_key_here" > .env
echo "SECRET_KEY=your_secret_key_here" >> .env

# Run the backend
uvicorn main:app --reload

3. Frontend Setup

cd frontend
npm install
npm start

4. Access the Application

📊 Research Validation

User Study Design

  • Participants: 25 undergraduate CS students
  • Duration: 20-30 minutes per session
  • Focus: Learning outcomes + emotional experience
  • Metrics: Confidence, engagement, retention

Key Findings

  • Confidence Improvement: 2.4/5 → 4.1/5 (84% improvement)
  • Reduced External Help: 88% didn't need external resources
  • Emotional Responsiveness: 92% found tone helpful and encouraging
  • Quiz Performance: 4.2/5 average accuracy
  • Engagement: 64% reported improved understanding

🎯 Future Roadmap

Phase 1: Enhanced AI Features

  • Fine-tuned transformer models for emotion detection
  • Multi-modal learning (text + visual + audio)
  • Dynamic code tracing tools
  • Advanced personalization algorithms

Phase 2: Classroom Integration

  • Instructor dashboard and student monitoring
  • Collaborative learning features
  • Assignment management system
  • Progress reporting for educators

Phase 3: Advanced Analytics

  • Predictive learning analytics
  • Cognitive load optimization
  • Learning path optimization
  • A/B testing framework

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • OpenAI for GPT-3.5 API
  • VADER Sentiment Analysis
  • FastAPI and React communities
  • All participants in our user studies

Built with ❤️ for better DSA learning