A web application that converts PDFs into MCQs using AI. Because a lot of the times you don't get practice exams.
- User authentication via Supabase Auth
- PDF upload and management
- AI-powered MCQ generation (using OpenAI models)
- Interactive quiz taking
- Results with explanations
- Install dependencies:
pip install -r requirements.txt- Create a
.envfile with the following variables:
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini
APP_SECRET_KEY=your_secret_key
BASE_URL=http://localhost:8000
-
Set up Supabase:
- Create a project on Supabase
- Go to the SQL Editor and run the contents of
schema.sqlto create tables - Go to Storage and create a bucket named
pdfswith public access disabled
-
Run the application:
uvicorn app.main:app --reload- Access the app at
http://localhost:8000
- Build the Docker image:
docker build -t pdf-to-mcq .- Run the container:
docker run -p 8000:8000 --env-file .env pdf-to-mcqOr use Docker Compose (recommended):
docker-compose up -dTo stop:
docker-compose downapp/
main.py - FastAPI application entry point
config.py - Configuration settings
deps.py - FastAPI dependencies
auth/ - Authentication module
router.py - Auth routes
service.py - Auth service
pdfs/ - PDF management module
router.py - PDF routes
service.py - PDF service
storage.py - Storage utilities
mcq/ - MCQ generation module
router.py - MCQ routes
service.py - MCQ service
pipeline/ - LLM pipeline to ingest documents and generate MCQs
quiz/ - Quiz module
router.py - Quiz routes
service.py - Quiz service
templates/ - Jinja2 HTML templates
static/ - CSS and JavaScript files