Skip to content

ReviseBuddy is an AI-powered MERN web app for school students to revise NCERT PDFs using Gemini API. It offers quizzes, RAG-based chat, progress tracking, and YouTube video suggestions with full customization and responsive design.

License

AmSh4/revise-buddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReviseBuddy: AI-Powered Revision Tool for School Students

Overview

ReviseBuddy is a fully functional, responsive web application designed to help school students revise their coursebooks efficiently using AI. It serves as a virtual teaching companion, allowing users to upload or select PDFs (e.g., NCERT textbooks), generate quizzes, track progress, chat with an AI tutor, and receive personalized YouTube video recommendations.

Built with a modern MERN stack (MongoDB, Express.js, React, Node.js), it incorporates advanced AI features via the Gemini API for question generation, Retrieval-Augmented Generation (RAG) answers with citations, and video suggestions.


This project stands out from typical revision apps by offering:

  • Highly Customizable UI/UX: Live particle backgrounds, custom cursors, animated buttons, and a settings page for theme, color, cursor, and font customization—making it engaging and personalized.
  • AI-Driven Interactivity: Uses Gemini API for dynamic quizzes (MCQs, SAQs, LAQs), RAG-based chat with PDF citations, and video recommendations without needing paid APIs like YouTube Data API.
  • Seamless Integration: Split-view PDF reader with chat/quiz, progress tracking dashboard, and responsive design for mobile/desktop.
  • Error-Free and Scalable: All code is validated, with fallback mechanisms (e.g., text-based search if embeddings fail due to API limits).

Whether you're a student revising NCERT Class XI Physics or uploading custom PDFs, ReviseBuddy makes learning interactive and fun. It's different from normal projects by prioritizing advanced frontend aesthetics (e.g., Framer Motion animations, Tailwind CSS) and AI depth (RAG for accurate citations), while being beginner-friendly to set up.


Features

ReviseBuddy provides the following core features:

Source Selector:

  • Choose from seeded PDFs (e.g., NCERT Class XI Physics Part 1 & 2) or all uploaded PDFs.
  • Upload your own PDF coursebooks for personalized revision.

PDF Viewer:

  • Display selected PDFs in a split-view or tab alongside chat/quiz.
  • Responsive navigation (prev/next pages) using react-pdf.

Quiz Generator Engine:

  • AI-generated quizzes from selected PDFs: Multiple Choice Questions (MCQs), Short Answer Questions (SAQs), and Long Answer Questions (LAQs).
  • Render quizzes, capture answers, score submissions, and provide explanations.
  • Option to generate new sets of questions.
  • Stores attempts in MongoDB for progress tracking.

Progress Tracking:

  • Dashboard showing strengths, weaknesses, and recent scores (e.g., "Mechanics: 80%").
  • Analyzes quiz results to highlight areas for improvement (e.g., "Topic Mastered" if score >70%).
  • Visual placeholders for new users (e.g., "No progress yet. Complete a quiz to see your scores!").

Chat UI (Inspired by ChatGPT):

  • Virtual teacher companion with a clean, mobile-responsive design.
  • Left drawer for chat history, main window for messages, bottom input box.
  • New chat creation, switching between chats.
  • RAG-based answers: AI responses cite PDF page numbers and snippets (e.g., "According to p. 23: '...'").

YouTube Video Recommender:

  • Recommends 3-5 educational YouTube videos relevant to the selected PDF or topic.
  • Powered by Gemini API prompts (no YouTube API needed)—e.g., "Top videos on Newton's Laws".

Additional Highlights

  • Advanced Frontend Customization: Settings page to change theme (light/dark), background/button colors, cursor style (default/glow/pointer), and font (Roboto/sans-serif/monospace). Changes persist via localStorage.
  • Animations and Visuals: Framer Motion for page transitions/button hovers, particles.js for live backgrounds, custom loading spinners.
  • Responsive Design: Mobile-first with Tailwind CSS; works seamlessly on phones, tablets, and desktops.
  • Authentication: Simple JWT-based signup/login for personalized progress and chats.
  • Error Handling: Graceful fallbacks (e.g., text-based search if Gemini embeddings fail due to quota limits).

Tech Stack

Frontend

  • Framework: React.js (for UI components and state management).
  • Styling: Tailwind CSS (responsive design), Custom CSS (themes, animations).
  • Animations/UI Libraries: Framer Motion (transitions), particles.js (live backgrounds), lucide-react (icons), react-pdf (PDF viewer).
  • State Management: React Context (for themes), localStorage (persistence).
  • HTTP Client: Axios (API requests).
  • Routing: React Router DOM.

Backend

  • Server: Node.js with Express.js (API endpoints).
  • Database: MongoDB (user data, progress, chat history).
  • AI Integration: Google Generative AI (Gemini API) for quizzes, RAG, embeddings, and video recommendations.
  • PDF Handling: pdf-parse (text extraction), Multer (uploads).
  • Authentication: JSON Web Tokens (JWT), bcryptjs (password hashing).
  • Utilities: fs-extra (file handling), dotenv (environment variables).

Other

  • Deployment/Environment: Local setup with Node.js v18+, MongoDB v6+.
  • Tools: Gemini API (free tier), no additional paid services required.

Installation and Setup

This guide is designed for beginners with no prior knowledge. We'll cover everything step-by-step, including installing prerequisites. Prerequisites

Node.js (v18+):

  • Download from nodejs.org.
  • Install and verify: Open Command Prompt/PowerShell, run node -v (should show v18 or higher).

MongoDB:

  • Download Community Edition from mongodb.com.
  • Install and run: Open Command Prompt/PowerShell, run mongod to start the server (it runs on mongodb://localhost:27017 by default).
  • Alternative: Use free MongoDB Atlas cloud database—create a cluster, get the URI string.

Gemini API Key:

  • Sign up for free at Google AI Studio.
  • Generate an API key (free tier sufficient for testing; note quota limits).

NCERT PDFs (for Seeding):

  • Download Class XI Physics Part 1 & 2 from NCERT website.
  • Place in frontend/public/pdfs/ (create folder if missing).

Clone and Setup the Project

Clone the Repository:

  • Open Command Prompt/PowerShell.

  • Run: git clone your-repo-url cd revise-buddy

  • Install Dependencies:

  • Backend: cd backend npm install

  • Frontend: cd ../frontend npm install


Configure Environment Variables:

Backend (backend/.env—create if missing):

      MONGO_URI=mongodb://localhost:27017/revisebuddy  # Or your Atlas URI
      JWT_SECRET=supersecretkey123  # Any strong secret
      GEMINI_API_KEY=your_gemini_api_key_here  # From Google AI Studio
      PORT=5000
      NODE_ENV=development
  • Frontend (frontend/.env—create if missing):

        REACT_APP_API_URL=http://localhost:5000/api
    
  • Start MongoDB:

  • Run mongod in a separate Command Prompt (or ensure Atlas is set up).

  • Run the Backend:

      cd backend
      node server.js
      Output: “MongoDB connected”, “Server on 5000”, “Seeded PDFs: [...]”.
    
  • Run the Frontend:

      cd frontend
      npm start
      
      Opens http://localhost:3000 in your browser.
    
  • Test the App:

    Go to /login, signup/login (e.g., email: test@example.com, password: test123). Explore features: Upload PDFs, generate quizzes, chat, view dashboard.


Usage

  • Login/Signup: Required for progress tracking and chats.
  • Home Page: Select or upload PDFs.
  • Quiz Page: Generate and submit quizzes.
  • Chat Page: Ask questions about PDF content.
  • Dashboard: View progress after quizzes.
  • Settings: Customize UI (themes, colors, cursor, font).

How It's Different from Normal Projects

  • AI Focus: Integrates Gemini for dynamic content (quizzes, RAG, videos), unlike static apps.
  • Advanced UI: Live particles, custom cursors, animations—engaging for students, not just basic forms.
  • Customization: User-configurable themes/settings, rare in simple revision tools.
  • Full-Stack Depth: MERN with RAG embeddings, MongoDB persistence, JWT auth—scalable for production.
  • Beginner-Friendly Setup: Detailed README, error-free code, fallbacks for API limits.

Future Improvements

  • Enhanced AI: Integrate Pinecone for scalable vector storage; add more models (e.g., OpenAI for alternatives).
  • User Features: Multi-user support, shared chats, gamification (badges for high scores).
  • Mobile App: Convert to React Native for iOS/Android.
  • Analytics: Add charts (e.g., score trends with Chart.js) to Dashboard.
  • Accessibility: Improve ARIA labels, keyboard navigation.
  • Deployment: Host on Vercel/Heroku (frontend), Render (backend), Atlas (MongoDB).
  • Security: Add OAuth (Google login), rate limiting.
  • Extensions: Support more subjects, audio mode for quizzes, export progress to PDF.

Contributing

  • MIT License. See LICENSE for details.

About

ReviseBuddy is an AI-powered MERN web app for school students to revise NCERT PDFs using Gemini API. It offers quizzes, RAG-based chat, progress tracking, and YouTube video suggestions with full customization and responsive design.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published