InvoiceIQ – AI Powered Invoice Management System InvoiceIQ is a React-based web application that automates the extraction, processing, and management of invoice data from uploaded files. The system uses AI-powered document parsing to extract structured information and organizes it into three synchronized sections:Invoices,Products, and Customers. State management is handled using Redux to ensure real-time updates across all tabs.
- Upload invoices in PDF format
- Automatic extraction of invoice data using AI
- OCR support for scanned documents
- Organized dashboard with:
- Invoices
- Products
- Customers
- Real-time synchronization using Redux
- Confidence scoring for extracted invoices
- Clean responsive UI
The application follows a modular architecture with clear separation of concerns between frontend and backend.
- Pages are organized under
pages/(InvoicesPage, ProductsPage, CustomersPage) - Redux slices are maintained separately for invoices, products, and customers
- Global state is managed using Redux Toolkit to ensure consistent real-time updates across all tabs
- Components are kept lightweight and focused on rendering logic
- Business logic (such as invoice total calculation) is abstracted into helper functions
Key best practices followed:
- Functional React components with hooks (
useState,useSelector,useDispatch) - Redux Toolkit for predictable state management
- Separation of UI and data logic
- Reusable components
- Clean folder structure
- Meaningful variable and function naming
- Minimal inline styling with centralized CSS
This modular design allows the system to scale easily and makes individual features independently testable and maintainable.
The backend uses an AI-powered extraction pipeline to process uploaded invoices.
- User uploads PDF files through the React frontend.
- Files are sent to the FastAPI backend using multipart form upload.
- Text is extracted from PDFs using:
- PyPDF / PDFPlumber for digital PDFs
- PyMuPDF + Pillow for image extraction
- For scanned invoices, Tesseract OCR converts images into readable text.
- Extracted raw text is sent to Google Generative AI for structured parsing.
- The AI model identifies:
- Invoice ID
- Customer details
- Product items
- Prices
- Confidence score
- Structured JSON is returned to the frontend.
- Redux updates Invoices, Products, and Customers in real time.
This hybrid approach ensures both digital and scanned invoices are supported.
Manual functional testing was performed to validate application behavior across all major workflows.
- Invoice upload and extraction
- Multi-file upload handling
- Redux synchronization across tabs
- Invoice total calculation
- Confidence score rendering
- OCR support for scanned PDFs
- Navigation between Invoices, Products, and Customers
- Empty state handling
- UI responsiveness
Each test case was verified visually and functionally.
Screenshots and demo recordings are included in the solution/ directory to demonstrate:
- Successful uploads
- Extracted invoice data
- Products and customers synchronization
- Confidence visualization
- Total calculation
- Overall dashboard usability
These artifacts serve as validation of correct system behavior.
- React (Vite)
- Redux Toolkit
- TypeScript
- CSS
- FastAPI
- Python
- Google Generative AI
- PDFPlumber / PyPDF
- Tesseract OCR
This project consists of:
- Backend: FastAPI (Python)
- Frontend: React (Vite)
- AI Extraction: Google Gemini
- File Support: PDF, XLSX (Excel), Images (OCR via Tesseract)
Make sure you have the following installed:
- Python 3.11+
- Node.js 18+
- npm
- Git
Install Tesseract:
brew install tesseractVerify:
tesseract --version- Clone the Repository
git clone https://github.com/Divya-A10/invoiceiq.git
cd invoiceiq- Backend Setup (FastAPI) Navigate to backend:
cd backend
Create virtual environment:
python3 -m venv venv
source venv/bin/activateUpgrade pip:
python -m pip install --upgrade pipInstall backend dependencies:
python -m pip install fastapi uvicorn python-multipart google-generativeai PyPDF2 pandas openpyxl pillow pytesseract pdfplumberNote: OpenTelemetry / google-adk are NOT required for this project. Environment Variables Create a .env file inside backend/:
GOOGLE_API_KEY=your_gemini_api_key_hereStart Backend From backend/:
python -m uvicorn app.main:app --reloadBackend will run at: http://127.0.0.1:8000
- Frontend Setup (React) Open a new terminal, then:
cd frontend
npm install
npm run devFrontend will run at: http://localhost:5173
- Using the Application
1.Open the frontend URL in your browser. 2.Upload files (PDF / XLSX / Images). 3.Extracted data appears across:
- Invoices
- Products
- Customers 4.State is synchronized across tabs using Redux.
- PDF (text extraction)
- XLSX (parsed via pandas/openpyxl)
- JPG / PNG (OCR via Tesseract) All file content is converted to text and passed to Gemini for structured extraction.
If Gemini API quota is exceeded, the backend safely falls back to mock/sample data so the frontend continues to function.
A full demo walkthrough is available: solutions/demo.mp4
- Please ensure Tesseract is installed (required for image OCR).
- Backend must be started before frontend.
- If ports are busy, adjust Vite or Uvicorn ports accordingly.
- Virtual environment (venv) and node_modules are excluded via .gitignore.
invoiceiq/ ├── backend/ │ ├── app/ │ │ ├── main.py │ │ ├── routes/ │ │ └── services/ │ └── venv/ ├── frontend/ │ └── src/ └── README.md│ ├── solutions/ # UI screenshots for documentation ├── demo.mp4 # Demo recordings └──dashboard.png
Manual functional testing was performed covering upload, extraction, Redux synchronization, and UI rendering. Detailed test cases are listed below.
Steps
- Click Choose Files
- Select PDF invoice
- Upload
Expected Result
- Invoice appears in Invoices tab
- Products populated
- Customers populated
Status: Pass
Steps
- Upload invoice
- Switch tabs
Expected Result
- Same data visible across all tabs instantly
Status: Pass
Steps
- Upload invoice with products
Expected Result
- Total reflects sum of product prices
Status: Pass
Steps
- Upload invoice
Expected Result
- Confidence % displayed per invoice
Status: Pass
Steps
- Upload scanned PDF
Expected Result
- Text extracted successfully
Status: Pass
Steps
- Upload multiple PDFs
Expected Result
- All invoices processed and displayed
Status: Pass
Steps
- Load app without uploads
Expected Result
- No crash, clean UI
Status: Pass
Steps
- Switch between Invoices / Products / Customers
Expected Result
- Tabs change correctly
Status: Pass
Below is a shortened example of the structured JSON returned by the backend after uploading an invoice. This data is then synchronized across the Invoices, Products, and Customers tabs using Redux.
TA X I N V O I C E ORIGIN AL FOR RECIPIENT
EInvoices
GSTIN: 29AABCT1332L000
H/No 1 59/9, M.S.R.Y Nilayam, 4th floor,
Masjid Banda, Kondapur , Rangareddy, H-
yderabad
Bangalore South, KARNATAKA, 560030
Mobile: +91 9999999999
Email: Swipe@gmail.com
Consignee:
Shounak
NextSpeed Technologies Pvt Ltd
GSTIN: ABCDE1234567890
Ph: 9999999994Invoice #:
INV-148CZSInvoice Date:
12 Nov 2024
Place of Supply:
29-KARNATAKA
SlDescription Rate/ItemQuantityTaxable Value GSTAmount
1GEMS CHOCLATE POUCH 4.76191,000.0004,761.90238.10 (5%)5,000.00
2TREAT BKS CASE 80PKT 535.714350.00026,785.713,214.29
(12%)30,000.00
3NUTRI CHOICE BKS CASE 666.666725.00016,666.67833.33 (5%)17,500.00
4MILK BIKIS CLASSIC CASE 120PK 809.523820.00016,190.48809.52 (5%)17,000.00
Total Items / Qty : 4 / 1,095.000 Making charges₹123456.00 debit card charges ₹12345.00 Shipping Charges₹60.00 Shipping Charges₹60.00 Shipping Charges₹60.00 Taxable Amount ₹2,00,385.76 CGST 2.5% ₹940.48 SGST 2.5% ₹940.48 CGST 6.0% ₹1,607.14 SGST 6.0% ₹1,607.14 Total₹2,05,481.00 Total amount (in words): INR Two Lakh, Five Thousand, Four Hundred And Eighty-One Rupees Only . Amount Payable: ₹2,05,481.00 Total Amount due: ₹2,05,481.00 Bank Details: Bank:Example Bank Account #: 1234567890 IFSC Code: IFSC0001234 Branch: Main Branch Beneficiary Name : VishnuPay using UPI: For EInvoices Authorized Signatory Notes: THANKS Terms and Conditions:
- The tenant has no right of any kind to have a right title interest RAW GEMINI:
{
"invoices": [
{
"id": "INV-148CZS",
"customer": "Shounak NextSpeed Technologies Pvt Ltd",
"total": 205481.00,
"confidence": 0.95
}
],
"products": [
{
"id": "1",
"name": "GEMS CHOCLATE POUCH",
"price": 5000.00,
"confidence": 0.9
},
{
"id": "2",
"name": "TREAT BKS CASE 80PKT",
"price": 30000.00,
"confidence": 0.9
},
{
"id": "3",
"name": "NUTRI CHOICE BKS CASE",
"price": 17500.00,
"confidence": 0.9
},
{
"id": "4",
"name": "MILK BIKIS CLASSIC CASE 120PK",
"price": 17000.00,
"confidence": 0.9
}
],
"customers": [
{
"id": "ABCDE1234567890",
"name": "Shounak NextSpeed Technologies Pvt Ltd",
"confidence": 0.95
}
]
}PARSED: {'invoices': [{'id': 'INV-148CZS', 'customer': 'Shounak NextSpeed Technologies Pvt Ltd', 'total': 205481.0, 'confidence': 0.95}], 'products': [{'id': '1', 'name': 'GEMS CHOCLATE POUCH', 'price': 5000.0, 'confidence': 0.9}, {'id': '2', 'name': 'TREAT BKS CASE 80PKT', 'price': 30000.0, 'confidence': 0.9}, {'id': '3', 'name': 'NUTRI CHOICE BKS CASE', 'price': 17500.0, 'confidence': 0.9}, {'id': '4', 'name': 'MILK BIKIS CLASSIC CASE 120PK', 'price': 17000.0, 'confidence': 0.9}], 'customers': [{'id': 'ABCDE1234567890', 'name': 'Shounak NextSpeed Technologies Pvt Ltd', 'confidence': 0.95}]} Only a shortened sample is shown here for readability. Full responses are handled dynamically within the application.