ChatWithPDF is a full-stack application that enables users to interact with the contents of an uploaded PDF through a chat interface. By processing the PDF, the app allows users to ask questions and receive answers, simulating a conversational experience with the document.
This repository contains both frontend and backend components of the application. Detailed documentation for each component can be found in their respective directories:
/frontend- React-based user interface/backend- FastAPI-based server application
Please refer to the README.md files in each directory for specific setup and installation instructions:
- Fork the Repository: Begin by forking this repository to your own GitHub account.
- Clone the Repository: After forking, clone the repository to your local machine:
git clone https://github.com/Eahtasham/ChatWithPDF.git cd ChatWithPDF
- PDF Upload and Processing: Easily upload a PDF file for analysis.
- Interactive Chat: Engage in a conversational Q&A format with the content of the uploaded PDF.
- Answer Extraction: Get answers extracted directly from the text of the PDF.
- FastAPI
- PostgreSQL
- Google Gemini AI
- LangChain
- FAISS
- React
- TypeScript
- Tailwind CSS
- Material UI
For detailed setup instructions, please refer to:
- Backend setup: See
/backend/README.md - Frontend setup: See
/frontend/README.md
The project is split into two main components, each with its own dependencies:
- FastAPI and related packages
- PostgreSQL client (asyncpg)
- PDF processing tools
- AI/ML libraries
- See
/backend/requirements.txtfor complete list
- React and related packages
- UI component libraries
- State management tools
- See
/frontend/package.jsonfor complete list
Each component requires its own configuration:
Create a .env file in the backend directory:
GEMINI_API_KEY=your_gemini_api_key_here
DATABASE_URL=your_postgresql_database_url_here
Configure the API endpoint in the frontend environment files.
- Upload a PDF: Start the app and upload a PDF document through the provided interface.
- Ask Questions: After uploading, you can ask questions based on the content of the PDF.
- Receive Answers: The application will analyze your queries and respond with relevant answers from the document's contents.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under MIT. Please refer to the LICENSE file for more details.