Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

BillFlow-AI

AI-assisted web-based billing and sales management system for manufacturing enterprises, with inventory management, invoice automation, and machine learning–based demand forecasting.

Overview

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.

Features

  • 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

System Modules

Customer Dashboard

  • Register and log in
  • Place orders via estimation slips or tax invoices
  • View order history and invoices (paginated)
  • Track order status

Admin Dashboard

  • Manage customers ("parties") and products
  • Approve or reject orders
  • Generate and download invoices as PDF
  • Monitor inventory and sales analytics

Inventory Management

  • Add, update, and delete products
  • Monitor stock levels
  • Automatic stock deduction on invoice, with restoration on order rejection

Billing System

  • Generate estimation slips and tax invoices
  • Automated GST calculation (CGST/SGST breakdown) and amount-in-words conversion
  • PDF generation via ReportLab

Machine Learning Module

  • 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

Machine Learning Pipeline

The forecasting module works around a common real-world constraint: limited historical sales data per product.

Workflow:

  1. Collect historical sales data (real + supplementary CSV data)
  2. Preprocess and aggregate sales by item and month
  3. Augment sparse data with synthetic samples generated by CTGAN (via the SDV library)
  4. Train a Random Forest Regressor (scikit-learn) on the combined real + synthetic dataset
  5. Predict next month's demand quantity per product
  6. 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).

Tech Stack

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

System Architecture

  • 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)

Project Workflow

  1. Customer places an order (or admin creates a sale directly)
  2. Backend validates items, price, and stock server-side
  3. Admin approves/rejects the order
  4. Invoice (PDF) generated automatically on approval/conversion
  5. Inventory updated in real time via Firestore batch writes
  6. Sales data stored in Firestore
  7. ML module analyzes sales patterns in the background
  8. Next month's product demand predicted and surfaced on the dashboard

Installation

Clone the repository

git clone https://github.com/RIGASWAR/BillFlow-AI.git
cd BillFlow-AI

Backend setup

cd backend
pip install -r requirements.txt

Place your Firebase serviceAccountKey.json inside the backend/ folder (get it from Firebase Console → Project Settings → Service Accounts → Generate New Private Key).

python app.py

Backend runs on http://127.0.0.1:5000.

Frontend setup

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:8080 and proxies /api requests to the Flask backend.

Future Enhancements

  • 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)

Contributors

  • Preethi R
  • Rigaswar S
  • Syed Wasiq Hussain
  • Yugendharan A M

License

This project was developed for academic and research purposes under PSG College of Technology.

About

AI-powered web-based billing and sales management system for manufacturing enterprises with predictive analytics, inventory management, invoice automation, and machine learning–based demand forecasting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages