How movoid12/quiz-my-pdf works
Quiz My PDF lets signed-in users turn PDFs into AI-generated quizzes, answer them, and review saved attempts. The main generation route validates and scans uploads, extracts and sanitizes text, generates questions, then persists quiz content; the quiz router handles retrieval, scoring, history, and results. Authentication includes Google sign-in and two-factor setup. The README describes database-backed operation, and the sampled generation and auth code use Drizzle. Dashboard pages and other capabilities are included from the file tree, but their client-side wiring was not sampled, so uncertain links are omitted.
Main entry points: route.ts PDF processing · index.ts PostgreSQL · page.tsx Home · pdf-upload-section.tsx PDF upload
Components 20
User experience
- Home
src/app/page.tsx - PDF upload
src/components/sections/pdf-upload-section.tsx - Quiz start
src/app/dashboard/start/page.tsx - Take quiz
src/app/dashboard/quiz/[quizId]/page.tsx - Attempt results
src/app/dashboard/result/[attemptId]/page.tsx - Quiz history
src/app/dashboard/history/page.tsx - Profile
src/app/dashboard/profile/page.tsx
Authentication
- Auth forms
src/components/auth/sign-up-form.tsx - Auth client
src/lib/auth-client.ts - Auth endpoint
src/app/api/auth/[...all]/route.ts - Auth service
src/server/auth.ts
Quiz generation
- PDF processing
src/app/api/process-pdf/route.ts - PDF validation
src/server/pdf/pdf-scanner.ts - Text extraction
src/server/pdf/extract-text.ts - AI generation
src/server/ai/generate-quiz.ts
Quiz and attempts
- tRPC endpoint
src/app/api/trpc/[trpc]/route.ts - Quiz operations
src/server/routers/quiz.ts - PostgreSQL
src/server/db/index.ts
Other components
- Learner
- Google Gemini
Connections 21
- Learner → Home: opens app
- Home → Quiz start: navigates to
- Learner → PDF upload: provides PDF
- PDF upload → PDF processing: submits PDF
- PDF processing → PDF validation: scans PDF
- PDF processing → Text extraction: extracts text
- PDF processing → AI generation: generates quiz
- AI generation → Google Gemini: requests generation
- PDF processing → PostgreSQL: writes quiz data
- Learner → Auth forms: signs in
- Auth forms → Auth client: calls auth
- Auth client → Auth endpoint: sends auth request
- Auth endpoint → Auth service: dispatches request
- Auth service → PostgreSQL: reads and writes
- Learner → Take quiz: answers questions
- Take quiz → tRPC endpoint: quiz requests
- tRPC endpoint → Quiz operations: dispatches procedures
- Quiz operations → PostgreSQL: reads and writes
- Learner → Quiz history: views attempts
- Learner → Attempt results: reviews attempt
- Learner → Profile: manages profile