An AI-powered invoice processing system that transforms PDF invoices into structured JSON data with intelligent extraction and management capabilities.
π Demo β’ π Features β’ π οΈ Installation β’ π API Documentation β’ π€ Contributing
Invoice AI is a cutting-edge full-stack application that revolutionizes invoice processing by combining the power of OpenAI's GPT-3.5 with modern web technologies. Upload PDF invoices and watch as our AI intelligently extracts structured data, stores it in MongoDB, and presents it through an elegant, responsive dashboard.
- π€ AI-Powered Extraction: Leverages OpenAI GPT-3.5-turbo for intelligent invoice data parsing
- π± Modern UI/UX: Built with React 18, TypeScript, and Tailwind CSS for exceptional user experience
- π Real-time Processing: Instant feedback with progress indicators and notifications
- ποΈ Smart Storage: MongoDB integration with duplicate detection and version control
- π SAP Integration: Ready-to-use SAP-compatible data formatting
- π Analytics Dashboard: Comprehensive invoice management and tracking
- β Multi-file PDF Upload - Process multiple invoices simultaneously
- β Intelligent Data Extraction - Extract 15+ key invoice fields automatically
- β Duplicate Detection - Prevent duplicate invoice processing
- β Real-time Processing Status - Live updates during AI processing
- β JSON Export - Clean, structured data output
- β Invoice Management - Full CRUD operations on processed invoices
- π Invoice details (number, date, PO number)
- π€ Customer information (name, address, PAN, GST)
- π’ Seller information (details, address)
- ποΈ Itemized purchases (name, quantity, price, subtotal)
- π° Financial data (CGST, SGST, total amounts)
- π± Currency information
- π Total amount in words
- π¨ Modern Design System - Radix UI components with custom styling
- π± Responsive Design - Works flawlessly on all devices
- π Secure Processing - Environment-based API key management
- π Fast Performance - Optimized React 18 with efficient state management
- π― Type Safety - Full TypeScript implementation
| Technology | Version | Purpose |
|---|---|---|
| React | 18.3.1 | Core frontend framework |
| TypeScript | 4.9.5 | Type safety and developer experience |
| Tailwind CSS | 3.4.12 | Utility-first styling framework |
| Radix UI | Latest | Accessible component primitives |
| React Router | 6.26.2 | Client-side routing |
| Lucide React | 0.441.0 | Modern icon library |
| Technology | Purpose |
|---|---|
| Python Flask | RESTful API framework |
| OpenAI API | AI-powered text processing |
| PyMuPDF | PDF text extraction |
| MongoDB | NoSQL database for invoice storage |
| Flask-CORS | Cross-origin resource sharing |
- Node.js 16+ and npm
- Python 3.8+ and pip
- MongoDB (local or cloud instance)
- OpenAI API Key (get one at platform.openai.com)
# Clone the repository
git clone https://github.com/yourusername/invoice-ai.git
cd invoice-ai
# Install dependencies
npm install
# Start development server
npm startThe frontend will be available at http://localhost:3000
# Navigate to backend directory (if separate)
cd backend
# Install Python dependencies
pip install flask flask-cors pymupdf openai pymongo python-dotenv
# Set up environment variables
export OPENAI_API_KEY="your-openai-api-key-here"
# Start Flask server
python api.pyThe API will be available at http://localhost:5000
Create a .env file in your backend directory:
OPENAI_API_KEY=your_openai_api_key_here
MONGODB_URI=mongodb://localhost:27017/
DATABASE_NAME=invoiceDB
PORT=5000http://localhost:5000
POST /process_invoice
Content-Type: multipart/form-dataRequest Body:
files: Multiple PDF files
Response:
{
"filename.pdf": {
"Details": {
"invoice_details": {
"invoice_number": "INV-001",
"invoices_date": "2024-01-15",
"customer_name": "John Doe",
"total_amount_with_gst": 1180.00
}
},
"duplicate": false,
"processed_at": "13-09-2024 01:12:30"
}
}GET /invoicesResponse:
[
{
"filename": "invoice_001.pdf",
"customer_name": "John Doe",
"invoice_number": "INV-001",
"invoices_date": "2024-01-15",
"total_amount_with_gst": 1180.00,
"processed_at": "13-09-2024 01:12:30"
}
]GET /invoice/<filename>POST /update_invoice
Content-Type: application/jsonGET /postSap/<filename># Development server
npm start
# Build for production
npm run build
# Run tests
npm test
# Eject configuration (one-way operation)
npm run eject- File Upload Dropzone - Drag & drop PDF upload interface
- Processing Status Cards - Real-time extraction progress
- Invoice Data Viewer - JSON tree view with editing capabilities
- Dashboard Analytics - Invoice statistics and trends
- Responsive Navigation - Mobile-first navigation system
invoice-ai/
βββ π public/
β βββ index.html
β βββ manifest.json
βββ π src/
β βββ π components/
β β βββ ui/ # Reusable UI components
β β βββ forms/ # Form components
β β βββ dashboard/ # Dashboard components
β βββ π pages/ # Route components
β βββ π hooks/ # Custom React hooks
β βββ π utils/ # Utility functions
β βββ π types/ # TypeScript type definitions
β βββ App.tsx
βββ π backend/
β βββ api.py # Flask API server
β βββ requirements.txt # Python dependencies
βββ package.json
βββ tailwind.config.js
βββ tsconfig.json
βββ README.md
# Run all tests
npm test
# Run tests with coverage
npm test -- --coverage
# Run tests in watch mode
npm test -- --watch# Build production bundle
npm run build
# Deploy to Vercel
vercel --prod
# Or deploy to Netlify
netlify deploy --prod --dir=build# Install Gunicorn
pip install gunicorn
# Create Procfile
echo "web: gunicorn api:app" > Procfile
# Deploy to Heroku
heroku create your-app-name
git push heroku mainWe welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing powerful AI capabilities
- Vercel for hosting and deployment platform
- MongoDB for reliable database solutions
- React Team for the amazing frontend framework
- Tailwind CSS for the utility-first CSS framework
Made with β€οΈ by TechnoAS
β Star this repo if it helped you! β