BizzAI
A comprehensive, open-source POS and inventory management system built with the MERN stack. Designed to streamline operations for small businesses with features like fast billing, custom PDF invoicing, and real-time stock tracking.
Install / Use
/learn @orion-ai-community/BizzAIREADME
🧾 BizzAI - Smart Billing & Inventory Management System
A modern, full-stack Point of Sale (POS) and inventory management system designed for retail businesses, grocery stores, and small to medium enterprises. Built with the MERN stack (MongoDB, Express.js, React, Node.js) and featuring a beautiful, responsive UI with TailwindCSS.
✨ Features
🔐 Authentication & Authorization
- Secure user registration and login with JWT authentication
- Role-based access control (Owner)
- Protected routes and API endpoints
- Password encryption with bcrypt
📦 Inventory Management
- Add, edit, and delete inventory items
- Track stock quantities in real-time
- Low stock alerts and notifications
- SKU and category management
- Cost price and selling price tracking
- Multiple unit types (kg, litre, pcs, etc.)
- Profit margin calculations
👥 Customer Management
- Comprehensive customer database
- Customer profile with contact details
- Transaction history tracking
- Due/credit management
- Customer-specific analytics
- Search and filter capabilities
💰 Point of Sale (POS)
- Intuitive, fast checkout interface
- Barcode/SKU scanning support
- Multiple payment methods (Cash, UPI, Card, Credit)
- Discount application
- Real-time inventory updates
- Invoice generation with PDF export
- Print-ready invoice format
💸 Return Management
- Process sales returns with ease
- Refund Methods:
- Customer Credit: Automatically updates customer dues/balance
- Cash: Logged as cash-out transaction
- Bank Transfer: Logged against specific bank account
- UPI: Instant bank-to-bank transfer via UPI ID
- Original Payment: Reverses the original transaction method
- Partial or Full returns support
- Inventory auto-adjustment options
📊 Reports & Analytics
- Sales reports with date range filtering
- Revenue and profit tracking
- Top-selling products analysis
- Customer purchase patterns
- Interactive charts and visualizations (Recharts)
- Export capabilities
📄 Invoice Management
- Automatic invoice number generation
- Detailed invoice view
- Payment status tracking (Paid, Unpaid, Partial)
- Invoice history
- PDF generation for printing/sharing
- Email invoice capability
🛠️ Tech Stack
Frontend
- React 19 - UI library
- Vite - Build tool and dev server
- Redux Toolkit - State management
- React Router v7 - Client-side routing
- TailwindCSS v4 - Utility-first CSS framework
- Recharts - Data visualization
- Axios - HTTP client
Backend
- Node.js - Runtime environment
- Express.js v5 - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM for MongoDB
- JWT - Authentication tokens
- bcryptjs - Password hashing
- PDFKit - PDF generation
- Nodemailer - Email functionality
- Morgan - HTTP request logger
- CORS - Cross-origin resource sharing
Infrastructure & DevOps
- Docker - Containerization
- GitHub Actions - CI/CD Pipeline
- Nginx - Production Web Server (Frontend)
Testing
- Jest - Backend Testing Framework
- Supertest - API Integration Testing
- Vitest - Frontend Switcher
- React Testing Library - Component Testing
📁 Project Structure
BizzAI/
├── backend/
│ ├── config/
│ │ └── db.js # Database connection
│ ├── controllers/
│ │ ├── authController.js # Authentication logic
│ │ ├── customerController.js # Customer operations
│ │ ├── inventoryController.js# Inventory operations
│ │ ├── posController.js # POS/Invoice operations
│ │ └── reportController.js # Analytics & reports
│ ├── middlewares/
│ │ └── authMiddleware.js # JWT verification
│ ├── models/
│ │ ├── User.js # User schema
│ │ ├── Item.js # Inventory item schema
│ │ ├── Customer.js # Customer schema
│ │ ├── Invoice.js # Invoice schema
│ │ ├── Transaction.js # Transaction schema
│ │ └── Notification.js # Notification schema
│ ├── routes/
│ │ ├── authRoutes.js # Auth endpoints
│ │ ├── customerRoutes.js # Customer endpoints
│ │ ├── inventoryRoutes.js # Inventory endpoints
│ │ ├── posRoutes.js # POS endpoints
│ │ └── reportRoutes.js # Report endpoints
│ ├── utils/ # Helper functions
│ ├── invoices/ # Generated PDF invoices
│ ├── .env # Environment variables
│ ├── server.js # Entry point
│ └── package.json
│
└── frontend/
├── src/
│ ├── components/
│ │ ├── Layout.jsx # Main layout wrapper
│ │ └── Sidebar.jsx # Navigation sidebar
│ ├── pages/
│ │ ├── Login.jsx # Login page
│ │ ├── Register.jsx # Registration page
│ │ ├── Dashboard.jsx # Analytics dashboard
│ │ ├── POS.jsx # Point of Sale interface
│ │ ├── Inventory.jsx # Inventory list
│ │ ├── AddItem.jsx # Add new item
│ │ ├── EditItem.jsx # Edit item
│ │ ├── Customers.jsx # Customer list
│ │ ├── AddCustomer.jsx # Add new customer
│ │ ├── EditCustomer.jsx # Edit customer
│ │ ├── CustomerDetail.jsx# Customer details
│ │ ├── Invoice.jsx # Invoice list
│ │ ├── InvoiceDetail.jsx # Invoice details
│ │ └── Reports.jsx # Reports & analytics
│ ├── redux/
│ │ ├── store.js # Redux store
│ │ └── slices/
│ │ ├── authSlice.js # Auth state
│ │ ├── inventorySlice.js
│ │ ├── customerSlice.js
│ │ ├── posSlice.js
│ │ └── reportsSlice.js
│ ├── services/
│ │ └── api.js # API configuration
│ ├── App.jsx # Main app component
│ ├── main.jsx # Entry point
│ └── index.css # Global styles
├── index.html
├── vite.config.js
└── package.json
🚀 Getting Started
Prerequisites
- Node.js (v18 or higher)
- MongoDB (v6 or higher) - Local or Atlas
- npm or yarn
Installation
1. Clone the repository
git clone https://github.com/orion-ai-community/BizzAI.git
cd BizzAI
2. Backend Setup
cd backend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
3. Frontend Setup
cd ../frontend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
4. Database Seed (Optional)
Populate the database with sample data for faster development and testing:
cd backend
npm run seed
This creates a demo account with pre-populated data:
- Email:
demo@bizzai.com - Password:
Demo@123 - 5 sample customers, 20 inventory items, 3 suppliers, and sample invoices
⚠️ Note: This is for development only. Do not run on production databases.
🐳 Running with Docker (Recommended)
- Ensure you have Docker and Docker Compose installed.
- Build and start the containers:
docker-compose up --build
The application will be available at:
- Frontend: http://localhost:80
- Backend: http://localhost:5000
Running the Application
Development Mode
Terminal 1 - Backend:
cd backend
npm run dev
Backend will run on http://localhost:5000
Terminal 2 - Frontend:
cd frontend
npm run dev
Frontend will run on http://localhost:5173
Production Build
Backend:
cd backend
npm start
Frontend:
cd frontend
npm run build
npm run preview
🧪 Testing
We use Jest for backend testing and Vitest for frontend testing.
Backend Tests
cd backend
npm test
Frontend Tests
cd frontend
npm test
📡 API Endpoints
Authentication
| Method | Endpoint | Description | Auth Required |
| ------ | -------------------- | ----------------- | ------------- |
| POST | /api/auth/register | Register new user | No |
| POST | /api/auth/login | Login user | No |
| GET | /api/auth/profile | Get user profile | Yes |
Inventory
| Method | Endpoint | Description | Auth Required |
| ------ | -------------------------- | ------------------- | ------------- |
| POST | /api/inventory | Add new item | Yes |
| GET | /api/inventory | Get all items | Yes |
| GET | /api/inventory/low-stock | Get low stock items | Yes |
| GET | /api/inventory/:id | Get single item | Yes |
| PUT | /api/inventory/:id | Update item | Yes |
| DELETE | /api/inventory/:id | Delete item | Yes |
Customers
| Method | Endpoint | Description | Auth Required |
| ------ | --------------------------------- | ------------------------- | ------------- |
| POST | /api/customers | Add new customer | Yes |
| GET | /api/customers | Get all customers | Yes |
| GET | /api/customers/:id | Get customer details | Yes |
| PUT | /api/customers/:id | Update customer | Yes |
| DELETE | /api/customers/:id | Delete customer | Yes |
| GET | /api/customers/:id/transactions | Get customer transactions | Yes |
POS / Invoices
| Method | Endpoint | Description | Auth Required |
| ------ | ---------------------- | ------------------- | ------------- |
| POST | /api/pos/invoice | Create new invoice | Yes |
| GET | /api/pos/invoices | Get all invoices | Yes
