Minimal Next.js + Tailwind scaffold that extracts text from PDFs and uses an AI provider to produce a concise summary and key points.
- Single PDF upload (drag-and-drop or file picker)
- Client-side validation (PDF only, < 10MB)
- Server-side PDF text extraction using
pdf-parse - Server-side AI call to OpenAI Chat Completions (configurable via env var)
- 30s timeout for AI requests
- Parses AI output into
summaryandkeyPointsarray - Copy-to-clipboard and download
.txtof results
- Install dependencies
npm install- Create
.env.localfrom the example and set your API key
cp .env.local.example .env.local
# Edit .env.local and replace the placeholder with your real key- Run the dev server
npm run dev- The API route
pages/api/summarize.jsdecodes the uploaded PDF (base64), extracts text withpdf-parse, builds a prompt, sends it to the configured AI provider, and parses the response. Update the provider integration there if you prefer Claude or another API. - This scaffold does not persist uploaded PDFs or summaries.
Push the repository to GitHub, connect the project to netlify, Vercel or any other web hosting service, and add GOOGLE_API_KEY, OPENAI_API_KEY your dashboard environment variables. It will run npm run build automatically.
- Improve AI response parsing and edge-case handling
- Add server-side rate limiting
- Add visual polish and accessibility improvements
- Add tests and CI
- Keep API keys out of source control. Do not commit
.env.local.
This scaffold is provided as-is for educational purposes.