Skip to content
mannas006Public

About

EduPapers - AI-Powered Question Paper Platform with intelligent PDF processing, answer generation, and modern Material UI design. Built with React, Python, Supabase, and Google Gemini AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

59 Commits

Folders and files

Repository files navigation

πŸŽ“ EduPapers

AI-Powered Question Paper Management System

React TypeScript Python Supabase Framer Motion

Status License Maintained


πŸ“‹ Table of Contents


🎯 Overview

EduPapers is a comprehensive, AI-powered question paper management system designed for educational institutions, students, and educators. The platform streamlines the process of organizing, processing, and sharing examination papers with intelligent question extraction and categorization capabilities.

🌟 Key Highlights

  • πŸ€– AI-Powered Processing: Leverages Google Gemini AI for intelligent question extraction and analysis
  • πŸ“Š Smart Organization: Automatically categorizes papers by university, course, semester, and subject
  • πŸ”’ Secure & Scalable: Built with modern security practices and scalable architecture
  • πŸ“± Responsive Design: Seamless experience across desktop, tablet, and mobile devices
  • ⚑ Real-time Updates: Live progress tracking and instant feedback during processing
  • πŸŒ™ Dark Mode: Beautiful water ripple animations with smooth theme transitions

πŸ”„ Recent Updates

Version 2.2.0 - Dark Mode & Water Ripple Animation ✨

🌊 Beautiful Dark Mode Features:

  • πŸ’§ Water Ripple Animation: Stunning water drop animation starting from the dark mode toggle button
  • 🌊 Multi-layered Ripples: Realistic physics with surface tension effects and progressive delays
  • πŸ”„ Bidirectional Animation: Smooth transitions between light ↔ dark mode with adaptive effects
  • ⚑ GPU-Optimized Performance: Hardware-accelerated animations with smooth easing curves
  • 🎨 Enhanced UI Theming: Dynamic AppBar backgrounds, improved Material-UI component styling
  • πŸŒ™ Adaptive Color Schemes: Intelligent color adaptation for both light and dark themes

πŸ”§ Technical Improvements:

  • WaterRippleAnimation Component: Built with Framer Motion for smooth animations
  • DarkModeContext: Centralized theme management with animation support
  • Click Position Detection: Accurate ripple origin tracking for natural effects
  • Performance Optimization: Efficient animation cleanup and memory management
  • Enhanced Theme System: Component-level overrides for consistent theming

Version 2.1.0 - Backend Structure Optimization

πŸ—οΈ Backend Improvements:

  • πŸ“ Streamlined Structure: Moved all Python processing files to backend/src/ for better organization
  • πŸš€ Cleaner Architecture: Consolidated AI processing logic into a single, maintainable directory
  • πŸ”§ Updated References: All Node.js server references now point to the new backend/src/ structure
  • πŸ“¦ Simplified Deployment: More conventional backend layout for easier deployment and maintenance
  • 🧹 Code Organization: Removed redundant directory nesting and improved code accessibility
  • πŸ—‘οΈ Dependency Cleanup: Removed redundant root node_modules for cleaner project structure

πŸ“ New Backend Structure:

  • /backend/src/ - All Python AI processing logic (main.py, gemini_client.py, etc.)
  • /backend/server/ - Node.js API server
  • /backend/output/ - Processing results storage
  • Clean separation with conventional naming patterns

Version 2.0.0 - Project Reorganization

🎯 Major Improvements:

  • πŸ—οΈ Restructured Architecture: Separated frontend and backend into dedicated directories
  • πŸ› Bug Fixes: Fixed notification issues showing "0 questions" during processing
  • 🧹 Code Cleanup: Removed unused test files, debug scripts, and temporary files
  • πŸ“¦ Dependency Management: Separate package.json for frontend and backend services
  • πŸš€ Enhanced Deployment: Improved build process and deployment configuration

πŸ“ New Structure:

  • /frontend/ - React TypeScript application with Vite
  • /backend/ - Node.js API server and Python AI processing engine
  • Clean separation of concerns for better maintainability

πŸ”§ Fixed Issues:

  • Resolved "Processing completed! Found 0 questions" false notifications
  • Fixed hardcoded "0" display during PDF processing
  • Improved error handling and user feedback
  • Updated all internal references and import paths

✨ Features

πŸŽ“ Core Functionality

Feature Description Status
PDF Upload & Processing Drag-and-drop PDF upload with intelligent text extraction βœ…
AI Question Extraction Advanced OCR and AI-powered question identification βœ…
Smart Categorization Automatic organization by academic hierarchy βœ…
Multi-format Support Support for various PDF formats and layouts βœ…
Progress Tracking Real-time processing status with detailed feedback βœ…
Search & Filter Advanced search across questions and papers βœ…
User Management Role-based access control (Student, Pro, Admin) βœ…
Export Options Multiple export formats (JSON, PDF, etc.) βœ…
Dark Mode Beautiful water ripple animations and theme switching βœ…

πŸ”§ Technical Features

  • Modern Tech Stack: React 18, TypeScript, Node.js, Python
  • Advanced Animations: Framer Motion with water ripple effects and smooth transitions
  • Dark Mode Support: GPU-optimized theme switching with realistic physics animations
  • Database: Supabase with PostgreSQL backend
  • Authentication: Secure user authentication and authorization
  • File Storage: Cloud-based file storage and management
  • API Integration: RESTful APIs with comprehensive error handling
  • Build System: Vite with optimized production builds
  • Styling: Tailwind CSS with responsive design patterns and Material-UI theming

πŸ—οΈ Architecture

graph TB
    A[Frontend - React/TypeScript] --> B[API Gateway - Express.js]
    B --> C[PDF Processor - Node.js]
    C --> D[Python AI Engine - backend/src/]
    D --> E[Google Gemini AI]
    B --> F[Supabase Backend]
    F --> G[PostgreSQL Database]
    F --> H[File Storage]
    
    subgraph "Processing Pipeline"
        C --> I[PDF Upload]
        I --> J[Text Extraction]
        J --> K[AI Analysis]
        K --> L[Question Categorization]
        L --> M[Database Storage]
    end
    
    subgraph "Backend Structure"
        D --> N[main.py - Entry Point]
        D --> O[gemini_client.py - AI Service]
        D --> P[pdf_extractor.py - Text Processing]
        D --> Q[supabase_integration.py - Database]
    end
Loading

🎯 Architecture Benefits

Clean Separation:

  • Frontend (/frontend/) - Pure React/TypeScript UI layer
  • Backend API (/backend/server/) - Node.js REST API and routing
  • AI Processing (/backend/src/) - Python AI and processing logic
  • Storage (/backend/output/) - Processed results and temporary files

Scalability:

  • Microservices-ready architecture
  • Independent deployment of frontend and backend
  • Modular Python processing components
  • Clear data flow and responsibility separation

Maintainability:

  • Conventional directory structure
  • Type-safe interfaces between layers
  • Centralized configuration management
  • Comprehensive error handling and logging

πŸ“ Project Structure

EduPapers/
β”œβ”€β”€ πŸ“‚ frontend/                # Frontend application
β”‚   β”œβ”€β”€ πŸ“‚ src/                # React source code
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ components/     # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.tsx     # Navigation with dark mode toggle
β”‚   β”‚   β”‚   β”œβ”€β”€ WaterRippleAnimation.tsx # Dark mode animations
β”‚   β”‚   β”‚   └── QuestionEditor.tsx # Question editing interface
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ pages/          # Application pages
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ contexts/       # React contexts (Auth, DarkMode, etc.)
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx    # Authentication context
β”‚   β”‚   β”‚   └── DarkModeContext.tsx # Theme management context
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ lib/            # External integrations
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ theme/          # Material-UI theme configurations
β”‚   β”‚   β”‚   └── mui-theme.ts   # Dark/light theme definitions
β”‚   β”‚   └── πŸ“‚ types/          # TypeScript definitions
β”‚   β”œβ”€β”€ πŸ“‚ public/             # Static assets
β”‚   β”œβ”€β”€ πŸ“‚ config/             # Build & deployment configs
β”‚   β”‚   β”œβ”€β”€ vite.config.ts     # Vite configuration
β”‚   β”‚   β”œβ”€β”€ tailwind.config.js # Tailwind CSS config (with dark mode)
β”‚   β”‚   └── tsconfig.json      # TypeScript config
β”‚   β”œβ”€β”€ index.html             # Main HTML template
β”‚   └── package.json           # Frontend dependencies (includes framer-motion)
β”‚
β”œβ”€β”€ πŸ“‚ backend/                 # Backend services
β”‚   β”œβ”€β”€ πŸ“‚ src/                # Python AI processing engine
β”‚   β”‚   β”œβ”€β”€ main.py            # Main processing entry point
β”‚   β”‚   β”œβ”€β”€ gemini_client.py   # AI integration service
β”‚   β”‚   β”œβ”€β”€ pdf_extractor.py   # PDF text extraction
β”‚   β”‚   β”œβ”€β”€ supabase_integration.py # Database operations
β”‚   β”‚   └── production_webhook.py   # Webhook handlers
β”‚   β”œβ”€β”€ πŸ“‚ server/             # Node.js API server
β”‚   β”‚   β”œβ”€β”€ index.js           # Main API server
β”‚   β”‚   └── pdf-processor.js   # PDF processing service
β”‚   β”œβ”€β”€ πŸ“‚ output/             # Processing results
β”‚   β”œβ”€β”€ πŸ“‚ temp-processing/    # Temporary file storage
β”‚   β”œβ”€β”€ package.json           # Backend Node.js dependencies
β”‚   β”œβ”€β”€ requirements.txt       # Python dependencies
β”‚   └── runtime.txt            # Python runtime version
β”‚
β”œβ”€β”€ πŸ“‚ docs/                    # Documentation
β”œβ”€β”€ πŸ“‚ database/                # Database schemas & migrations
β”œβ”€β”€ πŸ“‚ scripts/                 # Utility scripts
β”œβ”€β”€ .env                        # Environment variables
└── README.md                   # This file

πŸš€ Quick Start

Prerequisites

Ensure you have the following installed:

  • Node.js >= 18.0.0
  • Python >= 3.8
  • npm or yarn
  • Git

One-Command Setup

# Clone and setup the entire project
git clone https://github.com/your-username/edupapers.git
cd edupapers && npm install && npm run setup

Note: This project has been recently reorganized with separate frontend/ and backend/ directories for better maintainability and deployment flexibility.

Manual Setup

  1. Clone Repository

    git clone https://github.com/your-username/edupapers.git
    cd edupapers
  2. Install Frontend Dependencies

    cd frontend
    npm install
    cd ..
  3. Install Backend Dependencies

    cd backend
    npm install
    pip install -r requirements.txt
    cd ..
  4. Environment Setup

    cp .env.example .env
    # Configure your environment variables
  5. Start Development

    # Start both frontend and backend
    npm run dev-with-processor
    
    # Or start individually:
    npm run frontend:dev     # Frontend only
    npm run backend:dev      # Backend only

βš™οΈ Configuration

Environment Variables

Create a .env file in the project root with the following configuration:

# Supabase Configuration (Required)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# PDF Processing Service
VITE_WEBHOOK_URL=http://localhost:8000/webhook/process-pdf

# AI Integration
GEMINI_API_KEY=your-google-gemini-api-key

# Firebase Authentication (Optional)
VITE_FIREBASE_API_KEY=your-firebase-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
VITE_FIREBASE_APP_ID=your-app-id

πŸ”§ Supabase Setup

  1. Create a Supabase Project:

    • Go to supabase.com
    • Create a new project
    • Note your project URL and anon key
  2. Create Storage Bucket:

    -- Create a storage bucket for question papers
    INSERT INTO storage.buckets (id, name, public) VALUES ('question-papers', 'question-papers', true);
    
    -- Alternative bucket names (the app will try these automatically):
    -- 'documents', 'uploads', 'files'
  3. Set up Database Tables:

    -- Create question_papers table
    CREATE TABLE question_papers (
      id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
      title TEXT NOT NULL,
      file_url TEXT NOT NULL,
      file_path TEXT NOT NULL,
      university_id TEXT NOT NULL,
      course_id TEXT NOT NULL,
      semester TEXT NOT NULL,
      year INTEGER NOT NULL,
      subject TEXT,
      uploader_name TEXT NOT NULL,
      uploaded_by UUID REFERENCES auth.users(id),
      processing_status TEXT DEFAULT 'pending',
      created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
    );
  4. Configure Row Level Security (RLS):

    -- Enable RLS
    ALTER TABLE question_papers ENABLE ROW LEVEL SECURITY;
    
    -- Allow authenticated users to read all papers
    CREATE POLICY "Allow authenticated read" ON question_papers FOR SELECT TO authenticated USING (true);
    
    -- Allow authenticated users to insert their own papers
    CREATE POLICY "Allow authenticated insert" ON question_papers FOR INSERT TO authenticated WITH CHECK (auth.uid() = uploaded_by);

⚠️ Important Notes

  • Required: The VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY are required for the application to function
  • Storage: The app will automatically try multiple bucket names if the primary one doesn't exist
  • Error Handling: Detailed error messages will guide you through any configuration issues

Configuration Files

File Purpose Location
vite.config.ts Build configuration /frontend/config/
tailwind.config.js Styling configuration /frontend/config/
tsconfig.json TypeScript configuration /frontend/config/
eslint.config.js Code linting rules /frontend/config/
postcss.config.js CSS processing /frontend/config/

πŸ’» Usage

1. Starting the Development Environment

# Start both frontend and backend services
npm run dev-with-processor

# Or start services individually
npm run frontend:dev     # Frontend only (localhost:5173)
npm run backend:dev      # Backend only (localhost:8000)

2. Accessing the Application

3. Important Notes for the New Structure

Backend Python Processing:

  • All Python files are now in backend/src/
  • Python dependencies: cd backend && pip install -r requirements.txt
  • Direct Python testing: cd backend && python -m src.main

Path Updates:

  • Node.js server now references src/main.py instead of old paths
  • All AI processing logic consolidated in backend/src/
  • Output files stored in backend/output/

3. PDF Processing Workflow

  1. Upload: Drag and drop PDF files or click to browse
  2. Processing: AI automatically extracts questions and metadata
  3. Review: View extracted questions with categorization
  4. Save: Store processed data in the database
  5. Export: Download results in various formats

πŸ“‘ API Documentation

Core Endpoints

PDF Processing

POST /webhook/process-pdf
Content-Type: application/json

{
  "file_url": "https://example.com/paper.pdf",
  "metadata": {
    "university": "University Name",
    "course": "Course Name",
    "semester": "Semester",
    "subject": "Subject Name"
  }
}

Status Checking

GET /status/:processing_id

Health Check

GET /health

Response Formats

{
  "success": true,
  "status": "completed",
  "data": {
    "questions": [...],
    "metadata": {...},
    "processing_time": "2.5s"
  }
}

πŸ› οΈ Development

Available Scripts

Command Description
npm run dev-with-processor Start both frontend and backend
npm run frontend:dev Start frontend development server
npm run backend:dev Start backend services
npm run frontend:build Build frontend for production
npm run frontend:preview Preview frontend production build
npm run frontend:lint Run ESLint on frontend
npm run frontend:type-check Run TypeScript checks

Development Guidelines

  1. Code Style: Follow ESLint and Prettier configurations
  2. TypeScript: Maintain strict type checking
  3. Testing: Write tests for new features
  4. Documentation: Update docs for API changes
  5. Commits: Use conventional commit messages

πŸ“‚ Working with the New Structure

Frontend Development:

cd frontend
npm run dev          # Start frontend dev server
npm run build        # Build for production
npm run lint         # Run linting
npm run type-check   # TypeScript validation

Backend Development:

cd backend
npm run start              # Start Node.js server
python -m src.main         # Run Python processor directly
pip install -r requirements.txt  # Install Python dependencies

Full Stack Development:

# From project root
npm run dev-with-processor  # Start both services

Project Structure Details

frontend/src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ Navbar.tsx      # Navigation component with dark mode toggle
β”‚   β”œβ”€β”€ WaterRippleAnimation.tsx # Water ripple animation effects
β”‚   β”œβ”€β”€ UniversityCard.tsx # University display card
β”‚   └── QuestionEditor.tsx # Question editing interface
β”œβ”€β”€ pages/              # Route-based page components
β”‚   β”œβ”€β”€ Home.tsx        # Landing page
β”‚   β”œβ”€β”€ Upload.tsx      # PDF upload interface
β”‚   └── Profile.tsx     # User profile page
β”œβ”€β”€ contexts/           # React Context providers
β”‚   β”œβ”€β”€ AuthContext.tsx # Authentication context
β”‚   └── DarkModeContext.tsx # Dark mode theme management
β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   └── useDebounce.ts  # Debounce utility hook
β”œβ”€β”€ lib/                # External service integrations
β”‚   β”œβ”€β”€ supabase.ts     # Supabase client
β”‚   └── firebase.ts     # Firebase configuration
β”œβ”€β”€ theme/              # Theme configurations
β”‚   └── mui-theme.ts    # Material-UI light/dark theme definitions
└── types/              # TypeScript type definitions
    β”œβ”€β”€ index.ts        # Common types
    └── supabase.ts     # Database types

backend/
β”œβ”€β”€ server/             # Node.js API services
β”‚   β”œβ”€β”€ index.js        # Main API server
β”‚   └── pdf-processor.js # PDF processing service
β”œβ”€β”€ src/                # Python AI processing engine
β”‚   β”œβ”€β”€ main.py         # Main processing entry point
β”‚   β”œβ”€β”€ gemini_client.py # AI integration service  
β”‚   β”œβ”€β”€ pdf_extractor.py # PDF text extraction
β”‚   β”œβ”€β”€ supabase_integration.py # Database operations
β”‚   └── production_webhook.py   # Webhook handlers
β”œβ”€β”€ output/             # Processing results storage
β”œβ”€β”€ temp-processing/    # Temporary file storage
β”œβ”€β”€ package.json        # Node.js dependencies
β”œβ”€β”€ requirements.txt    # Python dependencies
└── runtime.txt         # Python version specification

πŸ§ͺ Testing

Running Tests

# Run all tests
npm test

# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:e2e

# Test coverage
npm run test:coverage

Test Utilities

# Test PDF processing
node scripts/test-pdf-processing.js

# Test file downloads
node scripts/test-download.js

# Validate project structure
node scripts/show-structure.js

Testing Guidelines

  • Write unit tests for utility functions
  • Integration tests for API endpoints
  • E2E tests for critical user workflows
  • Maintain >80% code coverage

πŸš€ Deployment

Production Build

# Build the frontend application
cd frontend
npm run build

# Preview the build
npm run preview

Deployment Platforms

Vercel (Recommended)

Frontend Deployment:

# Deploy frontend only
cd frontend
npm install
npm run build
vercel --prod

Full Stack Deployment:

# Deploy from project root with backend support
vercel --prod

The project includes optimized Vercel configurations:

  • vercel.json - Root configuration for full-stack deployment
  • frontend/vercel.json - Frontend-specific configuration for standalone deployment

Configuration Features:

  • Automatic build optimization for Vite frontend
  • API route handling for backend services
  • Python dependency installation for AI processing
  • Environment variable management
  • Custom headers for CORS handling

Azure Static Web Apps

# Use the configuration in config/staticwebapp.config.json

Manual Deployment

# Build and serve
npm run build
serve -s dist

Environment Setup

  1. Set up environment variables on your platform
  2. Configure database migrations
  3. Set up file storage buckets
  4. Configure AI service API keys

πŸ“š Documentation

Comprehensive documentation is available in the /docs directory:


🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for new functionality
  5. Commit your changes
    git commit -m 'feat: add amazing feature'
  6. Push to the branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Contribution Guidelines

  • Follow existing code style and patterns
  • Write clear, descriptive commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

πŸ†˜ Support

Getting Help

  1. Documentation: Check the /docs directory first
  2. Issues: Search existing GitHub issues
  3. Discussions: Join our community discussions
  4. Email: Contact us at [email protected]

Reporting Issues

When reporting issues, please include:

  • Operating system and version
  • Node.js and Python versions
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)

Feature Requests

We welcome feature requests! Please:

  1. Check existing issues and discussions
  2. Provide clear use cases
  3. Explain the expected behavior
  4. Consider contributing the feature yourself

πŸ“„ License

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

MIT License

Copyright (c) 2025 EduPapers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

πŸ™ Acknowledgments

  • React Team - For the amazing React framework
  • Supabase - For the excellent backend-as-a-service platform
  • Google - For the powerful Gemini AI API
  • Vercel - For seamless deployment platform
  • Open Source Community - For the fantastic tools and libraries

πŸ“Š Project Status

  • Current Version: 2.2.0
  • Status: Production Ready
  • Last Updated: June 2025
  • Dark Mode: βœ… Beautiful water ripple animations
  • Backend Structure: βœ… Optimized & Streamlined
  • Project Cleanup: βœ… Redundant dependencies removed
  • Maintained: βœ… Actively maintained
  • Security: βœ… Regular security updates

Built with ❀️ by the EduPapers Team

Website β€’ Email

About

EduPapers - AI-Powered Question Paper Platform with intelligent PDF processing, answer generation, and modern Material UI design. Built with React, Python, Supabase, and Google Gemini AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages