An open API service indexing awesome lists of open source software.

https://github.com/chadokar/chatbotpdf

PDF chatbot with RAG pipeline
https://github.com/chadokar/chatbotpdf

chatbot fastapi langchain llm python3 rag react typescript

Last synced: 3 months ago
JSON representation

PDF chatbot with RAG pipeline

Awesome Lists containing this project

README

          

# ChatbotPDF

This is a full-stack application with a React frontend and a FastAPI backend. The application is containerized using Docker and can be run with a single command using `docker-compose up`.

---

![ChatbotPDF Demo](./pdf%20chatbot%20.gif)

- Click [here](https://docs.google.com/document/d/1KGA15VUscxcSkF3qevS2hXMtH7uZLeBqX5iJciMHRAE/edit?usp=sharing) to read more about the project

## Features

- **Frontend**: Built with React and Vite, styled with TailwindCSS.
- **Backend**: Powered by FastAPI, with Python dependencies managed via `requirements.txt`.
- **Dockerized**: Easily run both the frontend and backend using Docker.
- **Networking**: Both services communicate seamlessly within a shared Docker network.

---

## Prerequisites

Make sure you have the following installed:

- **Docker**: [Install Docker](https://docs.docker.com/get-docker/)
- **Docker Compose**: [Install Docker Compose](https://docs.docker.com/compose/install/)

---

## Environment Setup

1. Create a new file named `.env` in the `/server` directory
2. Add the following environment variables:

```env
# MongoDB Connection String
# Replace with your actual MongoDB connection URL
# Example: mongodb://username:password@host:port/database
MONGODB_URI=

# Google Gemini API Key
# Get your API key from: https://makersuite.google.com/app/apikey
GEMINI_API_KEY=
```

---

## Access the Application

```
Once the application is running:

Frontend will be available at: http://localhost:3000
Backend API will be available at: http://localhost:5000
```

## Project Structure

```plaintext
chatbotpdf/
├── client/ # Frontend (React)
│ ├── src/ # React source files
│ ├── Dockerfile # Dockerfile for frontend
│ ├── package.json # Node.js dependencies
│ └── ... # Other frontend files
├── server/ # Backend (FastAPI)
│ ├── routes/ # API routes
│ ├── utils/ # Utility functions
│ ├── Dockerfile # Dockerfile for backend
│ ├── main.py # FastAPI entry point
│ ├── requirements.txt # Python dependencies
│ ├── .env # Environment variables (must be created manually)
│ └── ... # Other backend files
├── docker-compose.yml # Docker Compose file to orchestrate services
└── README.md # Documentation
```