A full-stack application that generates intelligent quiz questions from text content or uploaded documents using AI.
- π Multiple Input Methods: Support for direct text input, PDF, and DOCX files
- π€ AI-Powered: Uses advanced AI to generate intelligent questions
- π― Interactive Quiz: Take quizzes with immediate feedback
- π Score Tracking: Get instant results with detailed feedback
- π¨ Modern UI: Clean, responsive interface built with React and Tailwind CSS
Galelio/
βββ client/ # React + TypeScript frontend
β βββ src/
β β βββ components/ # React components
β β βββ api/ # API service layer
β β βββ types/ # TypeScript type definitions
β β βββ App.tsx # Main application component
β βββ package.json
β βββ vite.config.ts
βββ server/ # FastAPI backend
β βββ services/ # Business logic services
β β βββ quiz_generator.py
β β βββ file_parser.py
β βββ main.py # FastAPI application
β βββ models.py # Pydantic models
β βββ requirements.txt
βββ README.md
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Navigate to the server directory:
cd server
-
Create a virtual environment:
python -m venv venv venv\\Scripts\\activate # On Windows # source venv/bin/activate # On macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the server directory:HUGGINGFACEHUB_API_TOKEN=your_huggingface_token_here
-
Start the backend server:
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to the client directory:
cd client
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Access the Application: Open your browser and go to
http://localhost:5173
-
Generate Quiz Questions:
- Text Input: Paste your content directly into the text area (minimum 50 characters)
- File Upload: Drag and drop or select a PDF/DOCX file (max 10MB)
-
Take the Quiz:
- Select answers for each question
- Click "Submit Quiz" to see results
- Get instant feedback with correct answers highlighted
-
Generate New Quiz: Click "Generate New Quiz" to start over
Backend API (http://localhost:8000)
GET /
- Health checkPOST /generate
- Generate quiz from text inputPOST /upload
- Generate quiz from uploaded file
// Generate quiz from text
const response = await fetch('http://localhost:8000/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ content: 'Your text content here...' })
});
// Generate quiz from file
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('http://localhost:8000/upload', {
method: 'POST',
body: formData
});
- React 19 - UI framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Vite - Build tool and dev server
- FastAPI - Web framework
- Python - Programming language
- Uvicorn - ASGI server
- Pydantic - Data validation
- Hugging Face Inference Client - AI integration
- β Fixed quiz parsing algorithm to handle AI-generated content better
- β Added proper error handling for malformed responses
- β Improved prompt engineering for consistent question format
- β Added CORS support for frontend integration
- β Enhanced fallback mechanism when parsing fails
- β Complete responsive UI with Tailwind CSS
- β Drag-and-drop file upload functionality
- β Real-time character counting for text input
- β Interactive quiz with answer selection
- β Immediate feedback and scoring system
- β Tab-based navigation between input methods
- β Loading states and error handling
- CORS Errors: Ensure the backend server is running on port 8000 and CORS is configured
- File Upload Issues: Check file size (max 10MB) and format (PDF/DOCX only)
- API Token: Make sure your Hugging Face API token is set in the
.env
file - Port Conflicts: Ensure ports 8000 (backend) and 5173 (frontend) are available
- Use the browser's Developer Tools to monitor network requests
- Check the backend logs for detailed error messages
- The frontend shows user-friendly error messages for common issues
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.