Skip to content

KuroganeToyama/pdf_to_mcq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF to MCQ Web App

A web application that converts PDFs into MCQs using AI. Because a lot of the times you don't get practice exams.

Features

  • User authentication via Supabase Auth
  • PDF upload and management
  • AI-powered MCQ generation (using OpenAI models)
  • Interactive quiz taking
  • Results with explanations

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file 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
  1. Set up Supabase:

    • Create a project on Supabase
    • Go to the SQL Editor and run the contents of schema.sql to create tables
    • Go to Storage and create a bucket named pdfs with public access disabled
  2. Run the application:

uvicorn app.main:app --reload
  1. Access the app at http://localhost:8000

Docker Deployment

  1. Build the Docker image:
docker build -t pdf-to-mcq .
  1. Run the container:
docker run -p 8000:8000 --env-file .env pdf-to-mcq

Or use Docker Compose (recommended):

docker-compose up -d

To stop:

docker-compose down

Project Structure

app/
  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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors