SmartInventory is a highly polished, responsive, and feature-rich inventory and sales billing application built using Laravel 12, Bootstrap 5, Alpine.js, and MySQL. It is designed to empower businesses to manage stock levels, purchases, customer profiles, sales returns, and professional billing seamlessly.
- 📊 Interactive Dashboard: Track sales revenue, expenses, product stock levels, and daily trends via responsive Chart.js line charts.
- 🔐 Role & Permission Management: Powered by Spatie Laravel Permission. Distinct modules and actions customized for three specific roles:
- Admin: Full access to all modules, user administration, system logs, and settings.
- Staff: Stock management, POS billing creation, and customer/supplier additions.
- Accountant: View financial reports and create/manage sales billing.
- ⚡ Dynamic POS Billing: Real-time invoice generator built with Alpine.js featuring:
- Barcode Scanner Support: Instantly add items to cart by typing the SKU/barcode or scanning physical items.
- Indian GST Compliance: Automated tax splitting into CGST/SGST (Intrastate) or IGST (Interstate) based on destination state.
- Sound feedback: Virtual scanning beep sound on successful product add.
- 📦 Inventory & Stock Adjustments: Stock levels update automatically on sales and purchases. Support for manual stock adjustments (Damage, Expiration, Manual Corrections) with an audit trail log.
- 🔄 Returns System: Process Sales Returns (adds stock back and logs refunds) and Purchase Returns (reduces stock and logs refunds).
- 🧾 Professional PDF & Print Invoices: Clean, printable HTML layouts and automated PDF export functionality (powered by Barryvdh DomPDF).
- 📈 Reports Suite:
- Daily, weekly, and monthly sales graphs.
- Product-wise and supplier-wise purchase reports.
- Stock valuation reports (calculating inventory asset value at cost and potential retail value).
- Profit margin calculators tracking net earnings and profit margins.
- Excel and CSV sheet exports (powered by Laravel Excel).
- 🛡️ Tamper-Proof Audit Logging: Tracks critical user activities ("User created invoice", "Admin updated settings", etc.) alongside dates, IP addresses, and User-Agents.
Below is the relationship diagram of the system tables:
erDiagram
users ||--o{ audit_logs : logs
roles ||--o{ users : has
categories ||--o{ products : has
brands ||--o{ products : has
suppliers ||--o{ purchases : supplies
suppliers ||--o{ purchase_returns : returns_to
customers ||--o{ sales : buys
customers ||--o{ sales_returns : returns_from
products ||--o{ purchase_items : item_of
purchases ||--o{ purchase_items : contains
products ||--o{ sale_items : item_of
sales ||--o{ sale_items : contains
products ||--o{ stock_movements : logs
sales ||--o{ sales_returns : returns
sales_returns ||--o{ sales_return_items : contains
products ||--o{ sales_return_items : item_of
purchases ||--o{ purchase_returns : returns
purchase_returns ||--o{ purchase_return_items : contains
products ||--o{ purchase_return_items : item_of
sales ||--o{ payments : paid_by
purchases ||--o{ payments : paid_by
Follow these steps to set up SmartInventory on your local server environment (e.g., XAMPP):
-
Clone the repository:
git clone https://github.com/yourusername/smartinventory.git cd smartinventory -
Install Composer dependencies:
composer install
-
Configure environment settings:
- Duplicate
.env.exampleas.env. - Update database credentials:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=smartinventory DB_USERNAME=root DB_PASSWORD=
- Duplicate
-
Initialize database & seed data:
- Create a database named
smartinventoryin your MySQL Server. - Run migrations and seeders:
php artisan migrate --seed
- Create a database named
-
Generate application key:
php artisan key:generate
-
Serve the application:
php artisan serve
Or visit
http://localhost/smartinventory/public(or your configured XAMPP VirtualHost).
The database seeder initializes the application with three sample roles and default accounts:
| User Role | Email Username | Default Password | Enabled Permissions |
|---|---|---|---|
| System Admin | admin@inventory.com |
admin123 |
Full administrative control, view audits, configure settings |
| Store Staff | staff@inventory.com |
staff123 |
Create invoices, manage inventory products, process stock items |
| Accountant | accountant@inventory.com |
accountant123 |
POS invoicing billing, view performance reports |
- Framework: Laravel 12 (PHP 8.2+)
- Database: MySQL
- Frontend Styling: Bootstrap 5
- Dynamic Reactivity: Alpine.js
- Key PHP Packages:
spatie/laravel-permission(RBAC authorization)barryvdh/laravel-dompdf(Professional PDF exports)maatwebsite/excel(Excel & CSV reports)picqer/php-barcode-generator(SVG vector barcode creation)