This is a Next.js 16 app for a focused v1 invoice extraction workflow:
- Upload a single
PDF,PNG, orJPGinvoice - For PDFs, render up to the first 5 pages as images
- Send the document to Gemini through the Vercel AI SDK
- Validate the result against a strict Zod schema
- Review the extracted fields, line items, and raw JSON in the UI
Create a local env file and add your Google AI Studio key:
cp .env.example .env.localGOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_studio_api_key
GEMINI_MODEL=gemini-3-flash-previewGEMINI_MODEL is optional. The app defaults to gemini-3-flash-preview.
pnpm devOpen http://localhost:3000.
- Invoice-only extraction
- PDF/image upload through a Next.js route handler
- Page-image-heavy PDF processing with a PDF-file fallback
- Strict JSON output using
generateText()plusOutput.object() - shadcn/ui upload and results interface
- Persistent file storage
- Background job queues
- Contract extraction
- Cross-document search or embeddings