An intelligent web application for studying PDFs with AI-generated summaries, quizzes, and note-taking capabilities. Built on Cloudflare Workers with Workers AI.
- π€ PDF Management: Upload, view, and manage your PDF library
- π Interactive PDF Viewer: Smooth rendering with zoom and navigation controls
- π€ AI-Generated Transcriptions: Automatic page summaries using Cloudflare Workers AI
- π Smart MCQs: AI-generated multiple choice questions with instant feedback and scoring
- βοΈ Page Notes: Take and save notes for specific pages
- βοΈ Cloud Storage: PDFs stored in Cloudflare R2 for reliable access
- Node.js (v18+)
- Cloudflare account with Workers AI enabled
- R2 bucket configured (see
wrangler.jsonc)
npm installnpm run devAccess the app at http://localhost:8787
npm run deploy- Upload PDF: Drag and drop or browse to upload your PDF file
- AI Processing: The system extracts text and generates:
- Page-by-page summaries (transcriptions)
- Multiple choice questions for self-testing
- Interactive Learning:
- Read AI summaries alongside the PDF
- Test your knowledge with generated quizzes
- Track your score as you progress
- Take personal notes on each page
cf_ai_mini_pdf_tutor/
βββ public/ # Frontend assets
β βββ index.html # PDF library page
β βββ viewer.html # PDF viewer page
β βββ js/
β β βββ components/ # UI components (PDF viewer, notes, MCQ, etc.)
β β βββ services/ # API service layer
β β βββ shared/ # Utilities and constants
β βββ styles/ # CSS modules
βββ src/ # Backend (Cloudflare Worker)
β βββ controllers/ # Request handlers
β βββ services/ # Business logic (LLM, PDF, storage)
β βββ routes/ # API routes
β βββ middleware/ # CORS, validation, error handling
β βββ types/ # TypeScript definitions
βββ wrangler.jsonc # Cloudflare configuration
POST /api/pdf/upload- Upload PDF fileGET /api/pdf/list- List all PDFsGET /api/pdf/:id- Get PDF fileDELETE /api/pdf/:id- Delete PDF
GET /api/transcript/:docId/:page- Get/generate AI transcript for pageGET /api/mcq/:docId/:page- Get/generate MCQ questions for page
POST /api/notes- Save noteGET /api/notes/:docId- Get all notes for documentPOST /api/score- Update quiz scoreGET /api/score/:docId- Get current score
- Vanilla JavaScript with ES6 modules
- PDF.js for rendering
- Component-based architecture
- Responsive CSS design
- Cloudflare Workers (TypeScript)
- Workers AI (LLM integration)
- R2 Object Storage
- RESTful API design
Edit wrangler.jsonc to configure:
- R2 bucket name
- AI model settings
- Worker name and routes
- LLM Model: Uses Cloudflare Workers AI for text generation
- Storage: R2 buckets for PDF storage and metadata
- Text Extraction:
unpdflibrary for PDF text extraction - Architecture: Modular design with separation of concerns
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Modern mobile browsers
MIT License - Free to use and modify.