Turn dense lecture PDFs or pasted notes into AI-generated flashcards you can study immediately. The project pairs a lightweight Vite + React frontend with an Express backend that calls Google’s Gemini models to build question/answer pairs.
- Drag-and-drop PDF upload or plain text paste area with rich Tailwind styling.
- Smart flashcard generation via
POST /generate, handling both JSON and multipart bodies. - Responsive 2-column flashcard grid with reveal-on-click answers.
- Backend PDF text extraction powered by
pdfjs-distand Gemini 2.5 Flash.
- Frontend: Vite, React 19, Tailwind CSS 3, Fetch API.
- Backend: Node.js + Express,
google-generative-ai,express-fileupload,pdfjs-dist.
FlashMind/
├── backend/ # Express API that talks to Gemini and extracts PDF text
├── frontend/ # Vite + React single-page interface
└── LICENSE # MIT License
- Node.js 20+
- npm 10+
- A valid Google Gemini API key (
GEMINI_API_KEY) with access togemini-2.5-flash.
cd backendnpm install- Create a
.envfile and add your key:GEMINI_API_KEY=your-key-here - Start the server:
The server registers
node server.jsPOST /generateand logs any raw Gemini output for troubleshooting.
cd frontendnpm installnpm run dev- Open the printed Vite URL (defaults to
http://localhost:5173). Use the UI to upload a PDF or paste text, then click Generate Flashcards. The app will callhttp://localhost:3000/generate.
- Endpoint:
POST http://localhost:3000/generate - Request body:
- JSON:
{ "text": "plain note content" } - Multipart:
pdffile field (PDF up to ~20 MB)
- JSON:
- Response:
[{ "question": "string", "answer": "string" }, ... ] - On errors, the backend returns
500 { "error": "Generation failed" }.
- Fork the repo, create a feature branch, and submit changes via pull request.
- Ensure your code follows the existing style and passes basic linting.
- Include a brief description of the changes and any related issue numbers.
MIT © 2025 Sameer Shahed