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