🧾 Invoice Processing System with OCR, Google OAuth, and Calendar Integration
A complete web application that processes invoice images using advanced OCR technology and integrates with Google Calendar for automated event creation.
- 🔐 Google OAuth Authentication - Secure login with Google accounts
- 📄 Advanced OCR Processing - Extract text from invoice images using custom C++ preprocessing
- 📅 Google Calendar Integration - Automatically create calendar events from invoice data
- 🖥️ Modern Web Interface - Clean, responsive frontend for easy interaction
- 🚀 One-Click Startup - Unified launcher script starts all services
BillBox-V2/
├── backend/ # FastAPI REST API
│ ├── main.py # Application entry point
│ ├── routes/ # Organized route modules
│ │ ├── auth.py # Google OAuth endpoints
│ │ ├── calendar.py # Calendar integration
│ │ └── invoice.py # OCR processing
│ └── requirements.txt # Python dependencies
├── frontend/ # Minimal web interface
│ ├── index.html # Main application UI
│ └── callback.html # OAuth callback handler
├── services/
│ ├── ocr/ # OCR service with C++ preprocessing
│ └── preprocessing/ # C++ image processing pipeline
└── run.py # Unified launcher script
- Python 3.8+
- Google Cloud Console project with OAuth2 credentials
- Modern web browser
git clone <repository-url>
cd BillBox-V2- Create a project in Google Cloud Console
- Enable Google Calendar API and OAuth2
- Create OAuth 2.0 credentials
- Copy
backend/.env.exampletobackend/.env - Add your Google credentials to
.env:GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:3000/callback.html JWT_SECRET=your_secret_key
# One command to start everything!
python run.pyOr use platform-specific scripts:
# macOS/Linux
./run.sh
# Windows
run.batThe launcher automatically opens http://localhost:3000
cd backend
pip install -r requirements.txt
python main.pycd frontend
python -m http.server 3000cd services/ocr
# Optional: Build C++ preprocessing module
python setup.py build_ext --inplaceGET /auth/google- Initiate OAuth flowGET /auth/callback- Handle OAuth callback
POST /invoice/process- Upload and process invoice images
POST /calendar/create-event- Create Google Calendar events
GET /health- Health checkGET /docs- Interactive API documentation
- FastAPI REST API with automatic documentation
- Google OAuth2 integration for secure authentication
- Google Calendar API integration
- OCR Service integration with custom preprocessing
- Vanilla JavaScript for maximum compatibility
- Responsive design for mobile and desktop
- Real-time status updates and progress indicators
- OAuth popup flow for seamless authentication
- Custom C++ preprocessing for optimal OCR results
- Tesseract integration for text extraction
- Multiple processing pipelines (invoice, document, custom)
- Confidence scoring and word-level results
- Authenticate - Login with your Google account
- Upload Invoice - Select an image file (PNG, JPG, etc.)
- Process - OCR extracts text automatically
- Create Events - Optionally create calendar events
- Review Results - View extracted text and confidence scores
- Modular backend with separated route files
- Clean frontend with minimal dependencies
- Reusable OCR service with C++ optimization
- Comprehensive error handling and logging
- Backend: FastAPI, Uvicorn, Google APIs, JWT
- Frontend: HTML5, JavaScript ES6, CSS3
- OCR: Tesseract, OpenCV, Custom C++ preprocessing
- Infrastructure: Python HTTP server, Cross-platform scripts
- Google OAuth errors - Check redirect URI configuration
- OCR preprocessing unavailable - C++ module not built (falls back to basic processing)
- Port conflicts - Ensure ports 3000 and 8000 are available
- Python version - Requires Python 3.8 or higher
- Backend logs: Console output from FastAPI server
- Frontend: Browser developer console
- OCR: Service logs in terminal
This project is provided as-is for demonstration purposes.
This is a demonstration project. For production use, consider:
- Database integration for user sessions
- Enhanced security measures
- Kubernetes deployment configuration
- Comprehensive test suite
- CI/CD pipeline setup