InvoiceSnap is a full-stack AI invoice management system with OCR extraction, anomaly-aware review, GST reporting, and analytics.
- Hybrid extraction pipeline: digital PDF text parsing, Gemini extraction, and local OCR fallback
- Self-Learning Vendor Brain: vendor profiles, anomaly scoring, and explainable risk reasons
- Human-in-the-loop review flow: confidence + risk driven
needsReviewpipeline - Source document intelligence: original invoice storage, inline preview, and download
- Duplicate detection before save
- Batch extraction + bulk draft save
- Email/password signup and login
- Google auth integration
- Cookie-based auth sessions
- Profile/settings update and password change
- Create, read, update, delete invoices
- Server-side filtering, sorting, and pagination
- Category tagging and editable line items
- Invoice export to PDF and CSV
- Upload supports PDF, PNG, JPG, JPEG, WebP
POST /api/extractfor single-file extractionPOST /api/extract/batchfor multi-file extraction- Extraction metadata:
extractionSourceextractionConfidenceextractionNeedsReview
- Vendor profile modeling from historical invoices
- Invoice risk score (
vendorRiskScore) and explainable reasons (vendorRiskReasons) - Anomaly signals include:
- duplicate invoice number patterns
- unusual amount deviation
- unseen GST rates
- category drift
- Vendor Brain analytics endpoint:
GET /api/analytics/vendor-brain
- Auto review flagging from extraction confidence and data completeness
- Additional review escalation from vendor anomaly risk
- Duplicate detection at invoice create
- Summary, trends, status distribution, top vendors
- Monthly category analysis
- Vendor Brain profiles and anomaly feed in analytics UI
- GST monthly reports with CSV/PDF export
- Frontend: Next.js, React, TypeScript, Tailwind, shadcn/ui
- Backend: Node.js, Express, TypeScript, Zod, Multer
- Database: MongoDB
- AI/OCR: Gemini API, pdf-parse, tesseract.js
- Node.js 18+
- MongoDB
cd backend
npm install
npm run devcd frontend
npm install
npm run devPORT=4000
JWT_SECRET=replace_with_a_long_random_secret
CORS_ORIGIN=http://localhost:3000
MONGODB_URI=mongodb://127.0.0.1:27017
MONGODB_DB_NAME=invoicesnap
AUTH_COOKIE_NAME=invoicesnap_auth
AUTH_COOKIE_SAME_SITE=lax
GOOGLE_CLIENT_ID=your_google_client_id
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-2.0-flashNEXT_PUBLIC_API_BASE_URL=http://localhost:4000/api
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_idnpm run devnpm run lintnpm test
npm run devnpm run build
MIT