A modern, interactive PDF chat application that allows users to upload PDF documents and have intelligent conversations about their content using Google's Gemini AI. Built with React frontend and Node.js backend.
π Live Demo: https://pdf-chat-gold.vercel.app/
- π Drag & Drop PDF Upload - Easy file upload with progress tracking
- π¬ AI-Powered Chat - Intelligent conversations about PDF content using Google Gemini
- π Split-Screen PDF Viewer - View PDF alongside chat interface
- π¨ Modern UI/UX - Beautiful gradient designs and smooth animations
- π Resizable Panels - Draggable divider to adjust chat/PDF viewer sizes
- π€ Welcome Messages - Guided experience with suggested questions
- β‘ Real-time Responses - Fast AI responses with loading indicators
- π± Responsive Design - Works on desktop and mobile devices
PDF_Chat/
βββ client/ # React Frontend
β βββ src/
β β βββ components/
β β βββ App.jsx
β β βββ ChatView.jsx # Main chat interface
β β βββ FileUpload.jsx # PDF upload component
β βββ package.json
β βββ vite.config.js
βββ server/ # Node.js Backend
β βββ index.js # Main server file
β βββ package.json
β βββ .env # Environment variables
βββ README.md
βββ .gitignore
- Node.js (v18 or higher) - Download here
- npm or yarn package manager
- Google Gemini API Key - Get it here
-
Clone the repository
git clone https://github.com/sravanr788/PDF_Chat.git cd PDF_Chat -
Install Backend Dependencies
cd server npm install -
Install Frontend Dependencies
cd ../client npm install
-
Create environment file in the
serverdirectory:cd server touch .env -
Add your Google Gemini API key to
.env:GEMINI_API_KEY=your_gemini_api_key_here PORT=5000
-
Start the Backend Server
cd server npm startServer will run on: http://localhost:5000
-
Start the Frontend Development Server (in a new terminal)
cd client npm run devFrontend will run on: http://localhost:5173
Frontend: https://pdf-chat-gold.vercel.app/ Backend API: https://pdfchat-server.vercel.app/
-
Upload a PDF
- Drag and drop a PDF file onto the upload area
- Or click to browse and select a PDF file
- Wait for the upload progress to complete
-
Start Chatting
- Once uploaded, you'll see a welcome message with suggested questions
- Click on suggested questions or type your own
- Ask anything about the PDF content
-
Customize Your View
- Drag the blue divider between chat and PDF viewer to resize panels
- Use the X button to close and upload a new PDF
- React 18 - UI framework
- Vite - Build tool and dev server
- Tailwind CSS - Styling framework
- Lucide React - Icon library
- react-pdf - PDF rendering
- Node.js - Runtime environment
- Express.js - Web framework
- Google Gemini AI - AI chat responses
- pdf-extraction - PDF text extraction
- Multer - File upload handling
Production: https://pdfchat-server.vercel.app/ Local Development: http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| POST | /upload |
Upload PDF file and extract text |
| POST | /chat |
Send question and get AI response |
Production: https://pdf-chat-gold.vercel.app/ Local Development: http://localhost:5173
- Handles PDF file upload with drag & drop
- Shows upload progress with animated progress bar
- Manages application state transitions
- Split-screen layout with chat and PDF viewer
- Draggable divider for panel resizing
- AI chat interface with bot icons
- Welcome messages with suggested questions
β Deployed on Vercel
- URL: https://pdf-chat-gold.vercel.app/
- Status: Production Ready
cd client
vercel --prodcd server
vercel --prodMade with β€οΈ by Sravan