A full-stack app to upload PDF or images, extract text, and generate summaries using Google Gemini.
- Frontend: React + Vite + TailwindCSS
- Backend: Node.js + Express
client/ # React frontend (Vite) server/ # Express API
- Node.js 18+
- NPM
cd server cp .env.example .env
edit .env and set GEMINI_API_KEY npm install npm run dev
Server: http://localhost:8080
cd ../client npm install
optional: set VITE_API_BASE_URL in .env to http://localhost:8080 npm run dev
Frontend: http://localhost:5173
- POST /upload — multipart/form-data with field
file(PDF/JPG/PNG). Returns{ text }. - POST /summarize — JSON
{ text, length }. Returns{ summary }.
Notes:
- OCR with tesseract.js can be slower for large images; consider compressing before upload.
- CORS is configured via
CLIENT_ORIGIN.
- Platforms: Vercel or Netlify
- Build:
npm run build - Output:
dist - Env:
VITE_API_BASE_URL→ your backend URL
- Build:
- Platforms: Render or Railway
- Env:
GEMINI_API_KEY,CLIENT_ORIGIN(your frontend URL),PORTif needed
- Env:
- File upload limit: 15MB
- Backend:
npm run devinserver/ - Frontend:
npm run previewinclient/