A simple internal tool to upload PDF documents, label key-value pairs, and store both the PDF and labels JSON in Google Drive.
- Server: Node.js, Express, Google Drive API (service account)
- Client: React (Vite), react-pdf
- Node.js 18+
- Google Cloud project with a Service Account that has Drive API enabled
- A Drive folder ID (optional) to store files in a specific folder
- Copy
server/.env.exampletoserver/.envand fill values:GOOGLE_SERVICE_ACCOUNT_EMAILGOOGLE_SERVICE_ACCOUNT_KEY(paste raw key with newline escapes\n)GOOGLE_DRIVE_FOLDER_ID(optional)
- Install deps and run:
Server runs on
cd server npm install npm run devhttp://localhost:4000.
- Copy
client/.env.exampletoclient/.envand setVITE_SERVER_URLto the server URL. - Install deps and run:
App runs on the printed Vite URL (usually
cd client npm install npm run devhttp://localhost:5173).
- Open the client, choose a PDF.
- Fill predefined fields; add custom fields as needed.
- Click "Send to Drive" to upload. The server will upload the PDF and a JSON file containing labels and the uploaded PDF file ID to Google Drive.
- CORS origin can be controlled via
CORS_ORIGINin server.envif needed. - Service account needs access to the Drive folder. Share the folder with the service account email.