๐ A premium, full-stack AI-powered learning platform that generates intelligent, personalized quizzes from any topic or text-readable PDF. Users can create accounts, track their progress, and review complete historical questions and answers with detailed AI explanations.
Here is a summary of the major features, UI redesigns, and bug fixes recently implemented:
- Document Parsing: Added support for uploading study materials, lecture notes, or textbook chapters in PDF format (up to 5MB).
- Robust PDF Parsing: Integrated class-based parsing via
pdf-parsev2 (new PDFParse(Uint8Array)), fixing legibility and server crashes caused by legacy function-based parser integrations. - Smart Quiz Extraction: AI analyzes the semantic context of your uploaded PDF and generates precise questions matching your preferred blueprint.
- Question Logs Retention: Extended the MongoDB schema to retain complete historical records of quiz runsโstoring questions, option arrays, correct answers, explanations, and user selections.
- Detailed Revision Modal: Built a dedicated revision review window in the History tab. Users can review past quizzes with color-coded options (green for correct, red for selected wrong answers) and reference easy AI explanations for revision.
- Theme Contrast Optimization: Fixed visibility bugs in light theme. High-contrast colors are applied to labels, metric values, inputs, and dropdowns. Correct/incorrect highlights dynamically swap to rich dark-emerald and dark-rose tones in light mode to guarantee full readability.
- Responsive Profile Section: Refactored the
ProfileSectionsubcomponent to listen directly to the global theme context, ensuring identity cards and metric cards adapt seamlessly.
- Direct Landing Dashboard: Removed the generic landing page. Both
/and/dashboardload the main dashboard directly. - Dynamic Guest View: Logged-out visitors can explore the dashboard's features, capability cards, and product descriptions, with a clear "Login / Register ๐" button below the header. Protecting api routes keeps keys secure, prompting guests to authenticate only when launching a quiz.
- Unified Auth Rename: Cleaned up route structures and normalized the login/signup controllers.
- Case-Insensitive Logins: Standardized user creation and authentication handlers to enforce trimmed, lowercase emails, resolving MongoDB duplication and registration blocks.
- Strict Evaluation logic: Normalized AI-generated answers to strictly match one of the provided option choices (case-insensitive fallback), preventing evaluation discrepancy.
- ๐ง AI Quiz Generator: Create custom quizzes on any topic using Groq's Llama 3.3 70B models, selecting question counts (5-20) and format blueprints (MCQs, True/False, Mixed).
- ๐ Dark & Light Modes: Seamless visual settings saved locally.
- ๐ Analytics Matrix: Tracks your total quizzes completed, learning streak, best scores, and average score directly on the dashboard.
- ๐ฎ Interactive Quiz Player: Includes a live progress tracker, instant answer grading, and contextual explanations.
- React 19 & Vite 7 (Modern UI & ultra-fast hot reloading)
- React Router 7 (Unified routing)
- Tailwind CSS 4 (Responsive styling and layouts)
- Axios (API requests)
- Node.js & Express 5 (Server framework)
- MongoDB (Database, using Mongoose)
- JWT & bcryptjs (Secure authentication mapping)
- pdf-parse (PDF text extraction)
- Groq SDK (Orchestrates Llama model integration)
Ai-Quiz-Generator/
โโโ backend/
โ โโโ config/
โ โ โโโ db.js # MongoDB connection
โ โโโ controllers/
โ โ โโโ authController.js # Register, login, me, forgot/reset password (casing normalized)
โ โ โโโ quizController.js # Generate quiz, PDF quiz extraction, save result, history, stats
โ โโโ middleware/
โ โ โโโ authMiddleware.js # JWT verification
โ โโโ models/
โ โ โโโ User.js # User schema (trimmed & lowercase email constraints)
โ โ โโโ QuizResult.js # Quiz result schema (stores complete historical questions/answers)
โ โโโ routes/
โ โ โโโ authRoutes.js # /api/auth/*
โ โ โโโ quizRoutes.js # /api/quiz/* (secured routes)
โ โ โโโ userRoutes.js # /api/user/*
โ โโโ .env # Backend environment variables
โ โโโ server.js # Express app entry point
โ โโโ package.json
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ QuizPlayer.jsx # Theme-aware interactive player & summary sheet
โ โ โ โโโ MyQuizzesSection.jsx # Quizzes history list & revision review modal
โ โ โ โโโ ProtectedRoute.jsx
โ โ โโโ context/
โ โ โ โโโ AuthContext.jsx # Authentication provider
โ โ โ โโโ ThemeContext.jsx # Dark/light theme state provider
โ โ โโโ pages/
โ โ โ โโโ Dashboard.jsx # Core Dashboard workspace & ProfileSection
โ โ โ โโโ QuizForm.jsx # Topic-based quiz config form
โ โ โ โโโ PdfQuizForm.jsx # PDF upload drag-and-drop quiz form
โ โ โ โโโ Login.jsx # Login screen
โ โ โ โโโ Signup.jsx # Account registration screen
โ โ โโโ services/
โ โ โ โโโ api.js # Axios setup with interceptors
โ โ โโโ App.jsx # Routing configuration
โ โ โโโ index.css # Design system classes
โ โ โโโ main.jsx
โ โโโ .env # Frontend environment variables
โ โโโ tailwind.config.cjs
โ โโโ package.json
โ
โโโ README.md
- Node.js 18+ installed on your system.
- MongoDB connection (local server or MongoDB Atlas).
- Groq API Key (Obtain for free at console.groq.com).
-
Clone the repository:
git clone <repository-url> cd Ai-Quiz-Generator
-
Configure the Backend:
cd backend npm installCreate a
.envfile in thebackendfolder:PORT=5000 MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/ai_quiz_db JWT_SECRET=your_secure_jwt_random_secret_string GROQ_API_KEY=gsk_your_groq_api_key_here FRONTEND_URL=http://localhost:5174
-
Configure the Frontend:
cd ../frontend npm installCreate a
.envfile in thefrontendfolder (optional, default falls back to5000):VITE_API_URL=http://localhost:5000
To run the application locally in development mode:
Terminal 1 โ Start Backend:
cd backend
npm run devBackend runs at: http://localhost:5000
Terminal 2 โ Start Frontend:
cd frontend
npm run devFrontend runs at: http://localhost:5174 (or http://localhost:5173 depending on port availability)
Base URL: http://localhost:5000/api
POST /register: Registers a new user.POST /login: Log in user and receive a JWT.GET /me: Fetch authenticated user profile data (Requires Token).
POST /generate-quiz: Generates a quiz from a topic (JSON payload) or PDF (Multipart file upload). (Requires Token).POST /save-result: Saves completed quiz answers, score, and explanations. (Requires Token).GET /history: Retrieves authenticated user's quiz log history. (Requires Token).GET /stats: Computes streak, total quiz counts, average scores. (Requires Token).DELETE /history/all: Clears the user's completed history list. (Requires Token).
Sadhana Shree