2026CompletedLLM/AI
Zapdoc – AI Invoice Extraction Platform

Metrics & Visuals
20 MB
Max File Size
10/doc
Max Pages
5
Concurrent Pages
3
Retry Attempts
120s
LLM Timeout
4
Export Formats
Diagram
Pipeline overview. App screenshots coming soon.
Overview
Businesses handle large volumes of invoices daily — manual data entry is slow, error-prone, and expensive. Traditional OCR tools produce unstructured text that still requires human cleanup. Zapdoc solves this by combining Google Gemini 2.5 Flash (a multimodal AI vision model) with structured prompt engineering and a rule-based fallback parser. Upload any invoice — the system extracts, structures, and returns the data in machine-readable formats ready for your ERP or accounting pipeline.
Key Features
- Multi-format upload: PDF, PNG, JPG, JPEG, and ZIP archives
- AI-powered extraction using Gemini 2.5 Flash vision model for structured invoice fields
- Multi-page PDF support with parallel page processing via asyncio.Semaphore (up to 5 concurrent pages)
- Smart invoice grouping — auto-detects and merges multi-page invoices by invoice number
- Dual parser: auto-detects JSON vs. plain text OCR output for reliable parsing
- Custom field extraction — specify additional fields beyond standard schema
- Multi-format export: JSON, CSV, Excel (.xlsx), and ZIP bundles
- Stripe payment gateway integration with credit-based usage system
- Supabase JWT authentication with API Key (X-API-KEY) header security
- Exponential backoff retry via Tenacity (3 attempts per page) with partial success reporting
How It Works
- 1React SPA → Nginx reverse proxy → FastAPI backend
- 2POST /api/v1/requests → Create request → Upload document → Trigger async extraction
- 3Background worker queue with in-memory asyncio.Queue processes jobs
- 4Gemini 2.5 Flash extracts structured data; rule-based parser handles fallback
- 5Results stored in MongoDB; available for download as JSON/CSV/Excel/ZIP
- 6Stripe webhook → credit top-up → user balance updated in Supabase
System Architecture
Client
React SPA
Vite + Tailwind
Reverse Proxy
Nginx
Serves SPA, proxies /api
Application
FastAPI
REST API
Worker Queue
asyncio.Queue
AI / OCR
Gemini 2.5 Flash
Vision extraction
Rule-based Parser
Fallback
Data
MongoDB
Document store
Supabase
Auth + Storage
Stripe
Payments
Data Flow
Nginx→FastAPI(proxy /api)
FastAPI→Worker Queue(enqueue job)
Worker Queue→Gemini 2.5 Flash(OCR request)
Gemini 2.5 Flash→Rule-based Parser(fallback)
FastAPI→Stripe(webhook)
Roadmap
- Replace asyncio.Queue with persistent broker (Redis / Celery / RabbitMQ)
- Add API rate limiting with slowapi
- Analytics dashboard with usage statistics
- Support for Azure Document Intelligence and AWS Textract
- Webhook notifications for extraction completion
- CI/CD pipeline for automated deployment
Tech Stack
Backend
PythonFastAPIUvicornMotor (async MongoDB)Tenacity
AI & OCR
Google Gemini 2.5 FlashPyMuPDFRule-based Parser
Frontend
React 18ViteTailwind CSSAxiosReact Router 6
Infrastructure
DockerDocker ComposeNginxMongoDBSupabaseStripe