(Currently Under Construction β So Close Yet So Far!) π§
This project is like your favorite dish in the oven β it smells great, but you canβt eat it just yet! π While itβs still baking, feel free to peek behind the scenes. π
Update: This is the hardest project I have built up until now. Unfortunately, Stripe has now switched their policy, and I can't create an account unless I get an invite. Therefore, I wonβt be deploying this SaaS. However, you can still tinker with it in local development. Please make sure to leave a star if you like it! β
Welcome to Summarize My PDF AI! This project allows users to upload a PDF, splits the document into multiple embeddings, stores them in Pinecone DB, and uses those embeddings in a chatbot to provide accurate and contextual answers, with chats stored in PostgreSQL.
- π Drag-and-Drop PDF Upload
- π§ PDF Content Summarization
- π Pinecone DB for Embeddings
- π¬ AI Chatbot with Contextual Understanding
- ποΈ Chat History Stored in PostgreSQL
- βοΈ AWS S3 for File Storage
Follow the steps below to get the project up and running on your local machine.
git clone https://github.com/dankgarlic1/SummarizeMyPDF.git
cd summarize-my-pdf-ai
Make sure you have Node.js installed, then install the project dependencies:
npm install
Create a .env
file in the root directory and add the necessary environment variables. Do not share your API keys publicly! Make sure your .env
file contains something like this:
# Clerk API Keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your_clerk_publishable_key>
CLERK_SECRET_KEY=<your_clerk_secret_key>
# Database
DATABASE_URL=<your_database_url>
# AWS S3
NEXT_PUBLIC_S3_ACCESS_KEY_ID=<your_s3_access_key>
NEXT_PUBLIC_S3_SECRET_ACCESS_KEY=<your_s3_secret_access_key>
NEXT_PUBLIC_S3_BUCKET_NAME=<your_s3_bucket_name>
# Pinecone DB
PINECONE_API_KEY=<your_pinecone_api_key>
# OpenAI
OPENAI_API_KEY=<your_openai_api_key>
Start the development server with:
npm run dev
Your app will be running at http://localhost:3000 π.
To run this project using Docker, follow these steps:
-
Create an Empty Project Directory
Create a directory for your project and navigate into it.
-
Create a
.env
FileInside the directory, create a
.env
file and use the sample provided above to add your environment variables. -
Pull the Docker Image
docker pull harshitraizada63/summarize-my-pdf
-
Run the Docker Container
Run the container using the following command:
docker run -p 3000:3000 --env-file .env harshitraizada63/summarize-my-pdf
-
Access the App
Your app will be available at http://localhost:3000.
- Next.js - Server-side rendering and static site generation π
- PostgreSQL - Robust database for storing chat history ποΈ
- Pinecone - Vector database for efficient embeddings π
- OpenAI - AI models for summarization and contextual chat π€
- AWS S3 - File storage for uploaded PDFs βοΈ
- React Dropzone - Smooth drag-and-drop PDF upload π
- Drizzle ORM - Simple, yet powerful ORM for database operations π οΈ
To push database changes to PostgreSQL, run:
npm run db:push
To access the database studio:
npm run db:studio
TailwindCSS is used for quick and scalable UI development. All components are highly customizable via props.
- For managing API keys securely, always use environment variables.
- Use react-hot-toast for displaying notifications and loading states.
- For custom embeddings and PDF content processing, @pinecone-database/doc-splitter handles PDF chunking efficiently.
In the FileUpload
component, I hardcoded my email ([email protected]
) to allow unlimited PDF sessions while other users have a limit of two. To ensure fair use and limit resources, please comment out or remove the part of the code where my email is hardcoded:
const isSpecialUser = userEmail === "[email protected]";
Feel free to explore the project π