PrepAI is an intelligent quiz generation platform that transforms PDF documents into interactive quizzes using AI. Upload any PDF, and our system automatically generates multiple-choice questions and open-ended text questions based on the content.
- PDF to Quiz Conversion: Upload PDF documents and automatically generate quizzes using Google Gemini AI
- Dual Question Types:
- Multiple Choice Questions (MCQs) with 4 options each
- Open-ended text questions for deeper understanding
- Intelligent Answer Validation: AI-powered validation for text answers with detailed feedback
- Quiz Sharing: Generate unique codes to share quizzes with others
- Personal Quiz Library: Manage and access all your created quizzes
- Secure Authentication: User registration and login with encrypted token-based authentication
- Profile Management: Personal dashboard with quiz history
- Cross-platform Access: Web, iOS, and Android support
- Modern UI: Dark theme with intuitive design
- Real-time Feedback: Instant scoring for MCQs and AI feedback for text answers
- Copy & Share: Easy quiz code sharing with clipboard integration
- Responsive Design: Optimized for all screen sizes
frontend/
├── app/
│ ├── _layout.js # Root layout component
│ ├── index.js # Home page with quiz management
│ ├── login.js # User authentication
│ ├── register.js # User registration
│ └── quiz/
│ └── [code].js # Dynamic quiz page
├── assets/ # App icons and images
└── package.json
backend/
├── controllers/
│ ├── AuthCheck.js # Token validation
│ ├── SignIn.js # User login
│ ├── SignUp.js # User registration
│ ├── PdfToQuiz.js # PDF processing & AI quiz generation
│ ├── GetQuizByCode.js # Quiz retrieval
│ ├── GetAllQuizzes.js # User's quiz list
│ └── ValidateAnswer.js # AI answer validation
├── models/
│ ├── UserModel.js # User schema
│ ├── QuizModel.js # Quiz schema
│ └── PdfContentModel.js # PDF content cache
├── routes/ # API route definitions
├── utils/
│ ├── hashUnhash.js # Encryption utilities
│ └── resolveTokens.js # Token processing
└── index.js # Express server setup
- Node.js (v16 or higher)
- MongoDB database
- Google Gemini API key
- Expo CLI (for mobile development)
Create .env files in both frontend and backend directories:
Backend .env:
MONGODB_URI=mongodb://localhost:27017/prepai
PORT=3000
GEMINI_API_KEY=your_gemini_api_key_here
HASH_TOKEN=your_secure_hash_token_hereFrontend .env:
BACKEND_URL=http://localhost:3000-
Clone the repository:
git clone <repository-url> cd PrepAI
-
Backend Setup:
cd backend npm install npm start -
Frontend Setup:
cd frontend npm install expo start -
Mobile Development:
- Install Expo Go app on your device
- Scan the QR code from
expo start
POST /signup- Create new user accountPOST /signin- User loginPOST /authcheck- Validate authentication token
POST /pdf-to-quiz- Upload PDF and generate quizPOST /get-quiz-by-code- Retrieve quiz by sharing codePOST /get-all-quizzes- Get user's quiz listPOST /validate-answer- AI-powered answer validation
- React Native: Cross-platform mobile development
- Expo: Development platform and build tools
- Expo Router: File-based routing system
- AsyncStorage: Local data persistence
- Axios: HTTP client for API requests
- Document Picker: PDF file selection
- Node.js: Runtime environment
- Express.js: Web application framework
- MongoDB: NoSQL database
- Mongoose: MongoDB object modeling
- Multer: File upload handling
- PDF-Parse: PDF text extraction
- Google Gemini AI: Quiz generation and answer validation
- Custom Encryption: AES-256-CBC for secure token management
- CORS: Cross-origin resource sharing
- Nanoid: Unique quiz code generation
- Crypto: Built-in encryption utilities
- Create Account: Register with email, username, and password
- Upload PDF: Select any PDF document from your device
- Generate Quiz: Add a title and let AI create the quiz
- Share Quiz: Copy the generated code to share with others
- Take Quiz:
- Answer multiple choice questions
- Submit for instant scoring
- Answer text questions for AI feedback
- Manage Quizzes: View and access all your created quizzes
- Content Analysis: Extracts and analyzes PDF text content
- Question Generation: Creates relevant MCQs and text questions
- Smart Formatting: Ensures consistent question structure
- Content Optimization: Focuses on key concepts and facts
- Context-Aware: Validates answers against original PDF content
- Intelligent Feedback: Provides constructive feedback for improvements
- Flexible Scoring: Recognizes multiple correct answer variations
{
email: String (unique),
username: String,
password: String (encrypted),
quizIds: [ObjectId],
createdAt: Date
}{
pdfContentId: ObjectId,
Title: String,
author: ObjectId,
quizContent: [{
question: String,
options: [String],
answer: String
}],
textQuestions: [String],
link_code: String (unique),
createdAt: Date
}{
hashedKey: String (unique),
content: String,
createdAt: Date
}- Token-based Authentication: Secure user sessions with 7-day expiry
- Password Encryption: AES-256-CBC encryption for user passwords
- File Validation: PDF-only upload restrictions
- Input Sanitization: Protection against malicious inputs
- CORS Protection: Controlled cross-origin access
- Dark Theme: Modern dark interface for better user experience
- Responsive Design: Works seamlessly across all devices
- Intuitive Navigation: Simple and clean user interface
- Real-time Feedback: Instant visual feedback for user actions
- Accessibility: Designed with accessibility best practices
- Multiple File Formats: Support for DOCX, TXT, and other document types
- Advanced Analytics: Detailed quiz performance statistics
- Collaborative Features: Team quiz creation and sharing
- Question Banks: Reusable question libraries
- Custom Themes: User-customizable UI themes
- Offline Support: Local quiz storage and offline access
- Social Features: Quiz ratings and comments
- Export Options: PDF and Word quiz exports
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Google Gemini AI for powerful quiz generation capabilities
- Expo for excellent cross-platform development tools
- MongoDB for flexible data storage solutions
- React Native community for extensive library support
Made with ❤️ by Aditya Belgaonkar