A system that allows users to upload notes (PDFs or images), extract text, and ask questions to an AI chatbot about the content.
- Upload PDF documents or images
- Extract text using OCR (for images) or PDF parsing
- Ask questions about the document content
- AI-powered responses using Gemini AI
- Fallback mechanisms when AI services are unavailable
- Node.js (v14 or higher)
- npm or yarn
- Gemini AI API key (already in your .env file)
- Make sure your
.envfile contains the Gemini API key:
GEMINI_AI=your_gemini_api_key_here
- Install dependencies:
# In the root directory
npm install
# In the client directory
cd client
npm install- Start the server:
# In the root directory
node start-server.js- In a separate terminal, start the client:
# In the client directory
cd client
npm run dev- Access the application at http://localhost:5175 (or whatever port Vite is using)
If you see "No response from server" or "Failed to connect to server" errors:
- Make sure the server is running on port 5000
- Check that the Vite proxy is configured correctly in
client/vite.config.js - Restart both the server and client
If file uploads fail:
- Make sure the
uploadsdirectory exists in the root of the project - Check that the server has write permissions to this directory
- Verify that the file size is under 10MB
If text extraction fails:
- For PDFs, make sure the PDF is not encrypted or password-protected
- For images, ensure the image is clear and the text is readable
- Try a different file format if possible
- Upload: Files are uploaded to the server and stored in the
uploadsdirectory - Extract: Text is extracted using pdf-parse (for PDFs) or Tesseract.js (for images)
- Chat: User questions are sent to the Gemini AI with the extracted text as context
- Response: AI generates responses based on the document content
- Frontend: React, Vite, Tailwind CSS
- Backend: Express.js
- AI: Gemini AI
- Text Extraction: pdf-parse, Tesseract.js
- File Storage: Local filesystem