Technologies Used
Supabase: For database and authentication. Flask: As the backend framework. LLM (Large Language Model): LITELLM->OPENAI GPT 4 React: For the frontend user interface.
Prerequisites
List any prerequisites that need to be installed before setting up the project: Python Node.js Supabase account Google Cloud account OPENAI API Keys
-
Store your API Keys in the .env file
-
The backend server -> app.py
The PDF Summarizer API provides a convenient way to extract text from PDF files and generate concise summaries using an LLM. This can be useful for quickly understanding the main points of lengthy documents or research papers.
- Clone the repository: git clone cd
- python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- pip install -r requirements.txt
- flask run
POST /upload Uploads a PDF file and generates a summary using an LLM. Request: Content-Type: multipart/form-data Body: file: The PDF file to be uploaded. Response: Content-Type: application/json Body: json { "summary": "The generated summary of the PDF content." }
400 Bad Request: json { "error": "No file part" }
400 Bad Request: json { "error": "No selected file" }
400 Bad Request: json { "error": "Invalid file type" }
-
make sure to have a supabase account and gcloud account for login
-
we will be utilizing the google calender api for the task
This React application allows users to upload PDF files, extract summaries, and create calendar events in Google Calendar using the extracted text. It leverages Supabase for authentication and Google Calendar API for event management.
The Calendar Event Creator app enables users to sign in with Google, upload PDF files, and create calendar events based on the summaries extracted from those files. This is particularly useful for users who want to quickly summarize documents and schedule meetings based on their content.
- React: A JavaScript library for building user interfaces.
- Supabase: An open-source Firebase alternative for authentication and database management.
- Google Calendar API: For creating and managing calendar events.
- react-datetime-picker: A React component for selecting date and time.
npm install
npm start
runs the application in local host port 3000.Given that we have enabled CORS the backend will be able to recognise the endpoint.
Sign In: Click the "Sign in with Google" button to authenticate using your Google account. Upload PDF: Use the file upload component to upload a PDF file. The app will extract the text and generate a summary. Set Event Details: Choose the start and end time for the event using the date-time picker. Enter a name for the event. The summary description will be automatically populated from the extracted text. Create Calendar Event: Click the "Calendar" button to create an event in your Google Calendar. Sign Out: Click the "Sign Out" button to log out of your Google account.
The app integrates with the Google Calendar API to create events. Ensure that you have enabled the Google Calendar API in your Google Cloud Console and have the necessary credentials set up.
The FileUpload
component allows users to upload PDF files and receive a summary of the content extracted from those files. It interacts with a backend API to handle file uploads and summary generation.
The FileUpload
component is designed to facilitate the uploading of PDF files. Upon uploading, it sends the file to a backend server, which processes the file and returns a summary of its contents.
- File Selection: Users can select a PDF file using an input field.
- File Upload: The selected file is uploaded to the backend API when the "Upload PDF" button is clicked.
- Summary Generation: The component displays a message when the summary is successfully generated.
- Error Handling: Displays error messages if the upload fails or if no file is selected.
Include in Your JSX:
function App() { return (
NOTE: Backend API: Ensure that your backend server is running and accessible at http://localhost:8080/upload for file uploads.
Video Explanation:https://share.vidyard.com/watch/fwbsp3Q8fWkT9HPNwf2bEA?