AI-assisted web-based billing and sales management system for manufacturing enterprises, with inventory management, invoice automation, and machine learning–based demand forecasting.
BillFlow-AI is a full-stack billing and sales management platform built for Velur Spun Pipes, a manufacturing enterprise. The system automates billing, order processing, inventory management, invoice generation, and sales analytics, and integrates a machine learning pipeline for predictive demand forecasting.
The platform includes dedicated Admin and Customer dashboards to streamline workflow management, improve operational efficiency, and reduce dependency on manual billing processes.
- Customer and Admin dashboards with role-based access
- Automated invoice generation (Estimation Slip & Tax Invoice)
- Real-time inventory management with stock deduction on sale
- Order processing and status tracking (Pending → Approved → Ready → Dispatched/Rejected)
- Sales analytics dashboard with charts
- Firebase Firestore database integration
- Machine learning–based demand prediction for inventory planning
- Historical billing and sales tracking
- CSV export of sales records
- Size-based product recommendation engine
- Register and log in
- Place orders via estimation slips or tax invoices
- View order history and invoices (paginated)
- Track order status
- Manage customers ("parties") and products
- Approve or reject orders
- Generate and download invoices as PDF
- Monitor inventory and sales analytics
- Add, update, and delete products
- Monitor stock levels
- Automatic stock deduction on invoice, with restoration on order rejection
- Generate estimation slips and tax invoices
- Automated GST calculation (CGST/SGST breakdown) and amount-in-words conversion
- PDF generation via ReportLab
- Analyzes historical sales data
- Predicts next month's product demand per item
- Flags items as "Trending Up" or "Stable" based on predicted quantity, for quick inventory review
The forecasting module works around a common real-world constraint: limited historical sales data per product.
Workflow:
- Collect historical sales data (real + supplementary CSV data)
- Preprocess and aggregate sales by item and month
- Augment sparse data with synthetic samples generated by CTGAN (via the SDV library)
- Train a Random Forest Regressor (scikit-learn) on the combined real + synthetic dataset
- Predict next month's demand quantity per product
- Cache results and refresh hourly via a background thread
Algorithms used:
- CTGAN (Conditional Tabular GAN) — synthetic data generation
- Random Forest Regressor — demand quantity prediction
Note: this is a regression pipeline (predicts a quantity), not a classifier. No formal accuracy/error metric (e.g. R², MAE) is currently computed against a held-out test set — this is a natural next step for the project (see Future Enhancements).
Frontend
- React 18 + TypeScript
- Vite
- Tailwind CSS + shadcn/ui (Radix UI primitives)
- React Router DOM
- TanStack React Query
- Zustand (state management)
- React Hook Form + Zod (form validation)
- Recharts (analytics charts)
Backend
- Python
- Flask + Flask-CORS
- Gunicorn (production server)
- ReportLab (PDF generation)
Database
- Firebase Firestore
Machine Learning
- scikit-learn (RandomForestRegressor)
- SDV / CTGAN (synthetic data generation)
- pandas, numpy
- Customer Dashboard (React SPA)
- Admin Dashboard (React SPA, same codebase, role-protected routes)
- Flask REST API (backend processing layer)
- Firebase Firestore (database)
- ML Forecasting Module (background thread, in-memory cache)
- Customer places an order (or admin creates a sale directly)
- Backend validates items, price, and stock server-side
- Admin approves/rejects the order
- Invoice (PDF) generated automatically on approval/conversion
- Inventory updated in real time via Firestore batch writes
- Sales data stored in Firestore
- ML module analyzes sales patterns in the background
- Next month's product demand predicted and surfaced on the dashboard
git clone https://github.com/RIGASWAR/BillFlow-AI.git
cd BillFlow-AIcd backend
pip install -r requirements.txtPlace your Firebase serviceAccountKey.json inside the backend/ folder (get it from Firebase Console → Project Settings → Service Accounts → Generate New Private Key).
python app.pyBackend runs on http://127.0.0.1:5000.
cd frontend
npm install
npm run devFrontend runs on http://localhost:8080 and proxies /api requests to the Flask backend.
- Online payment integration
- Shipment tracking
- Formal model evaluation (train/test split, accuracy/error metrics for the forecasting model)
- Mobile application support
- Enhanced authentication (password hashing, session/JWT-based auth)
- Deep learning–based forecasting models
- Cloud deployment (CI/CD pipeline, containerization)
- Preethi R
- Rigaswar S
- Syed Wasiq Hussain
- Yugendharan A M
This project was developed for academic and research purposes under PSG College of Technology.