This is a Next.js app that takes any document (PDF/Image) and generates smart summaries.
Here are the steps to run this project on local development environment :
- Clone the project and run:
cd summary-generator
npm install
- Sign in to Google Cloud Platform and create a project in the console. Enable these APIs and services in the project:
- Cloud Storage
- Cloud Storage API
- Cloud Document AI API
- Vertex AI API
Create a storage bucket and processor with the Document AI API.
-
Install the
gcloud
CLI and set up Application Default Credentials. -
Create an OAuth app on Github, with the homepage URL set to
http://localhost:3000/dashboard
and the callback URL set tohttp://localhost:3000/api/auth/callback/github
. -
Create a MongoDB collection and copy the connection string.
-
Create a
.env.local
file and create the relevant environment variables form Google Cloud, Github, MongoDB, and NextAuth. SetHOMEPAGE_URL
tohttp://localhost:3000
. -
Run the development server using:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
This project uploads the files to Google Cloud Storage, uses the Cloud Document AI API to extract text from the PDF or Image file, and then sends a prompt to Gemini via the Vertex AI API to summarize the extracted text. NextAuth enables authentication with github or credentials that are stored in MongoDB.
This project is deployed on Vercel: https://summary-generator-beryl.vercel.app/