Enterprise-Grade Financial Intelligence Engine powered by Google Gemini 2.5 Flash.
Automated OCR Extraction, Real-time Margin Tracking, and Intelligent Anomaly Detection.
Profit Lens Core is a sophisticated full-stack financial tool designed to eliminate the manual overhead of accounting. By leveraging LLM-based OCR (Google Gemini 2.5 Flash), the system transforms raw invoice images and PDF data into structured, actionable financial insights with high precision.
Traditional accounting software often relies on rigid, template-based OCR that fails when invoice layouts change. Profit Lens Core uses a semantic approach, understanding the context of a document to extract data regardless of formatting, while simultaneously validating business logic (VAT consistency, NIP verification, category classification).
The system follows a modern MERN architecture (MongoDB, Express, React, Node) with a heavy focus on asynchronous processing and AI-driven validation.
graph TD
A[User / Client] -->|Upload Image/PDF| B(Express API)
B -->|Payload| C{Gemini 2.5 Flash}
C -->|JSON Extraction| D[Structured Data]
D -->|Business Logic Validation| E{Anomaly Engine}
E -->|Clean| F[(MongoDB)]
E -->|Flag Anomaly| G[Notification System]
F --> H[Dashboard / Real-time Stats]
G --> H
- AI Engine: Prompt Engineering for zero-shot data extraction with enforced JSON Schema.
- Frontend Architecture: React 19 with a mobile-first, "Sticky Action" design pattern.
- Performance: Multer memory-based buffering for rapid AI handshakes.
- UX/UI: Glassmorphic design system using Tailwind 4.0 and Framer Motion for micro-interactions.
- DevOps: Containerized with Docker for seamless environment synchronization.
- AI-Powered OCR: Semantic extraction using Gemini 2.5 Flash.
- Interactive API Docs: Explore and test endpoints via Swagger UI.
- Real-time Analytics: Dashboard with margin tracking and stats.
- Smart Validation: VAT/NIP consistency and anomaly checks.
The project includes interactive API documentation powered by Swagger. When the server is running, you can explore the endpoints and test requests directly from your browser:
👉 http://localhost:5000/api-docs
This interface provides detailed information about request schemas, authentication requirements, and example responses.
- Semantic OCR Extraction: Automatically pulls Vendor Name, Date, NIP, Net/Gross, and Category using Gemini's vision-to-json capabilities.
- Intelligent Anomaly Detection:
- Flags VAT discrepancies (e.g., Net + 23% != Gross).
- Identifies missing identifiers (NIP/Tax IDs).
- Detects duplicate entries and classification errors.
- Financial Analytics: Real-time margin tracking and expense distribution visualizations.
- Multi-Device Support: Fully responsive interface featuring "Sticky Footer" actions for mobile productivity.
- Accounting Export: Batch processing and CSV export ready for integration with professional accounting software.
- Node.js: v20+ (Long Term Support)
- Docker: (Optional but recommended for MongoDB/zero-config)
- Google AI Studio API Key: For Gemini 2.5 Flash access.
# Clone and Launch everything (DB, API, Client)
git clone https://github.com/yourusername/profit-lens-core.git
cd profit-lens-core
docker-compose up --buildAccess the app at http://localhost:80
- Install Dependencies: npm install (root, client, server).
- Environment: Create server/.env with MONGO_URI and GEMINI_API_KEY.
- Launch: npm run dev.
This project was built to demonstrate:
- Integration of LLMs into production workflows beyond simple chatbots.
- Full-stack proficiency with modern libraries (React 19, Tailwind 4).
- Handling of sensitive data and building robust validation layers.
- DevOps mindset via Dockerization and structured CI/CD preparation.
Distributed under the MIT License. See CONTRIBUTING.md for how to get involved.
Built for the Open Source Community.