Skip to content

sub1120/Talk2PDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation


💫 Talk2PDF | Now Ask any question to your PDF 💫

React TypeScript.js Tailwind CSS Express.js js.langchain

Talk2PDF is an application that empowers users to ask find answers within their PDF documents.

Tabel of Content

  • Demo Video
  • Client Setup
  • Server Setup
  • Project Structure
  • API End Points
  • Deployment
  • Contact

Demo Video

talk2pdf-demo.mp4

Below steps will guide you, how to set up your project locally. To get a local copy up and running follow these simple example steps.

Client Setup

  1. Clone Repo
git clone https://github.com/sub1120/Talk2PDF.git
  1. Install pnp
npm i -g pnpm
  1. Install dependencies for client
cd client; pnpm i
  1. Create a .env file and put this
VITE_API_URL=http://localhost:4001/api/v1
  1. Start client locally
cd client; pnpm run dev

Server Setup

  1. Install dependencies for server
cd server; npm i
  1. Create a .env file and put this
PORT=4000
GOOGLE_PALM_API_KEY=YOUR-API-KEY

Note: To create an GOOGLE_PALM_API_KEY, please visit Get an API key

  1. Start server locally
cd server; npm run dev

Project Structure

The repository contains two folder, one for frontend code (client) and other for backend code (server). Below is description of some important subfolders.

Client Structure

File Description
client/src Contains main srouce code for frontend
client/src/api Contains API Inegration functions
client/src/components Contains react components
client/src/util Contains some helper functions and constants
client/src/App.tsx Its root component of our application
client/src/main.tsx Its app entry point.

Server Structure

File Description
server/controllers/chat.controllers.ts Defined controller to get answer from llm.
server/controllers/doc.controller.ts Defined controllers to upload or delete document and vectorstore.
server/middleware/uploader.middleware.ts Defined middleware to validate file and upload to server.
server/router/doc.router.ts Defined all api routes for doc controllers.
server/router/chat.router.ts Defined all api routes for chat controllers.
server/config Contains all config varibles required by app.
server/types Defined types.
server/util Contains some helper functions and constants

API End Points

1. Upload documents

POST /api/v1/doc/upload

2. Delete all documents

DEL /api/v1/doc/delete

3. Get answer of given question

POST api/v1/chat/answer

Body

{
  "question": "Your question"
}

Deployment

Contact

Contact on subhamsahu1120@gmail.com for any kind of support