This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Upload a PDF (text-based or scanned). The backend will:
- Extract selectable text via
pdfminer.six. - OCR low-text pages with Tesseract (needs local install) & PyMuPDF rendering.
- Clean headers/footers and chunk content; build a FAISS vector index.
- Generate quiz questions (MCQ / T/F / short answer) using Gemini or an external provider.
Create .env.local (frontend) and server env vars for backend:
GEMINI_API_KEY=your_key_here
GEMINI_MODEL=models/gemini-2.5-flash
QUIZ_PROVIDER=gemini # or external
QUIZ_API_URL= # required if QUIZ_PROVIDER=external
QUIZ_API_KEY= # optional external key
VECTOR_DIR=./data/indexes
SQLITE_PATH=./data/app.db
- Download installer: https://github.com/UB-Mannheim/tesseract/wiki
- Install (default path:
C:\Program Files\Tesseract-OCR). - Add that path to your system PATH or set
TESSERACT_CMDenvironment variable.
cd exam-backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python main.py
Navigate to /practice:
- Upload PDF.
- Adjust count, difficulty, type.
- Generate quiz and answer questions.
- Submit results (stored via
/attempts/save).
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.