This repository contains a web application designed to upload PDF files to AWS S3, process them using Google GenAI LLM, and allow users to ask questions related to the content of the PDF file. The application utilizes FastAPI for the backend, React for the frontend, and integrates with AWS S3, Google GenAI, PostgreSQL with Supabase, and PyPDF2 for PDF content extraction.
- Framework: FastAPI (Python)
- Technologies:
- PyPDF2: For reading the content of PDF files.
- PostgreSQL with Supabase: Database solution for storing pdf meta data.
- Endpoints:
/
: Endpoint to check health of the servers./v1/upload/
: Endpoint for uploading PDF files to AWS S3./v1/chat/
: Endpoint for users to ask questions related to the content of the processed PDF files./docs/
: Endpoint to test the API using OpenAPI
- Framework: React (TypeScript + vite)
- Features:
- File Upload: Allows users to select and upload PDF files to the backend.
- Chat Interface: Provides a user-friendly interface for users to ask questions related to the content of the PDF files.
- Docker-Compose: Provides a Docker Compose file for running the entire backend.
- Dockerfile: Defines Docker images for the backend services, making it easy to deploy and scale.
- Backend Setup:
- Clone the repository.
- Navigate to the
backend
directory. - Install dependencies:
pip install -r requirements.txt
. - Start the FastAPI server:
uvicorn main:app --reload
. or runpython main.py
- Frontend Setup:
- Navigate to the
frontend
directory. - Install dependencies:
npm install or bun install or yarn install
. - Start the React development server:
npm start or bun run dev or yarn dev
.
- Navigate to the
- Docker Deployment:
- Ensure Docker and Docker Compose are installed.
- Navigate to the root directory of the repository.
- Run
docker-compose up --build
to build and start the Docker containers.
- Accessing the Application:
- Open your web browser and navigate to
http://http://localhost:5173/
or look for port number in the terminal. - You should see the frontend interface for uploading files and interacting with the chat.
- Open your web browser and navigate to
Contributions are welcome! If you'd like to contribute to this project, feel free to fork the repository and submit a pull request with your changes.