A comprehensive Point of Sale and Inventory Management System with barcode tracking, audit logging, and automated reporting.
- About the Project
- Project Overview
- Key Features
- Tech Stack
- Dependencies
- Installation & Setup
- Folder Structure
- Database Relation Analysis
- System Design Analysis
- Traceability Matrix
- Visual Showcase
- Contributions
- License
- Contact
The Smart Inventory POS & Invoice System is a professional-grade solution designed to streamline retail operations. It integrates product cataloging, real-time inventory tracking, and automated sales processing into a single, cohesive platform. By leveraging barcode scanning and automated reporting, it helps businesses eliminate manual errors and gain real-time insights into their performance.
This project is built using the Laravel Repository + Service Layer architectural pattern to ensure high maintainability and scalability. It provides a robust backend for handling complex financial transactions and stock movements, while the frontend offers a responsive interface for both administrators and cashiers.
Key Metrics & Objectives:
- Accuracy: Real-time stock updates and automated VAT/discount calculations.
- Accountability: Full audit trail for every product change and sale transaction.
- Efficiency: Fast POS checkout workflow with keyboard-wedge barcode scanner support.
- User Authentication: Secure login with role-based access control (Admin, Cashier).
- Inventory Management: Full CRUD for products, categories, subcategories, and suppliers with barcode tracking.
- POS Workflow: Seamless sales process with cart management, invoice generation, and multiple payment methods (Cash, Card, Mobile).
- Customer Ledger: Financial tracking system for managing customer debts, credits, and balance history.
- Stock-In/Out Tracking: Managed through purchase orders and stock adjustments with status tracking.
- Automated Reporting: Daily/Weekly sales reports, top-product analysis, and low-stock alerts via reorder thresholds.
- Export/Import Tools: Bulk product data handling via Excel and barcode label generation to PDF.
Backend: Laravel 12 · PHP 8.2+
Frontend: React.js · Tailwind CSS 4 · Vite
Database: MySQL · PostgreSQL · SQLite
Tools: Git · VS Code · Composer · PNPM · Docker (Sail)
List of major libraries and frameworks used:
{
"php": "^8.2",
"laravel/framework": "^12.0",
"barryvdh/laravel-dompdf": "*",
"maatwebsite/excel": "*",
"picqer/php-barcode-generator": "*",
"tailwindcss": "^4.0.0",
"vite": "^7.0.7"
}- Clone the repository:
git clone <repo-url> pos-management cd pos-management
- Install PHP dependencies:
composer install
- Install frontend dependencies:
pnpm install
- Environment Configuration:
Configure your database credentials in the
cp .env.example .env php artisan key:generate
.envfile. - Database Setup:
php artisan migrate --seed
- Build Frontend Assets:
pnpm run build
- Start the Server:
php artisan serve
app/
├── Http/
│ ├── Controllers/ # Thin controllers
│ ├── Requests/ # Form validations
├── Models/ # Eloquent entities
├── Repositories/ # Data abstraction layer
├── Services/ # Business logic (SaleService, StockService, etc.)
database/
├── migrations/ # Database schema
├── seeders/ # Initial roles and data
resources/
├── js/ # React components and logic
├── views/ # Blade templates
| Entity | Description | Relationships |
|---|---|---|
| User | System users (Admin, Cashier) | HasMany Sales, HasMany AuditLogs |
| Category | Product classifications | HasMany Products |
| Supplier | Product providers | HasMany Products, HasMany Purchases |
| Product | Inventory items | BelongsTo Category, BelongsTo Supplier, HasMany SaleItems, HasMany StockAdjustments |
| Purchase | Stock-in transactions | BelongsTo Supplier, HasMany PurchaseItems |
| PurchaseItem | Individual items in a purchase | BelongsTo Purchase, BelongsTo Product |
| Customer | Clients/Buyers | HasMany Sales, HasMany CustomerLedger |
| Sale | POS transactions (Stock-out) | BelongsTo Customer (nullable), BelongsTo User, HasMany SaleItems |
| SaleItem | Individual products in a sale | BelongsTo Sale, BelongsTo Product |
| CustomerLedger | Financial tracking (Due/Debit/Credit) | BelongsTo Customer |
| StockAdjustment | Manual stock corrections | BelongsTo Product, BelongsTo User |
| AuditLog | System activity tracking | BelongsTo User |
erDiagram
USERS ||--o{ SALES : "processes"
USERS ||--o{ AUDIT_LOGS : "performs"
CATEGORIES ||--o{ PRODUCTS : "contains"
SUPPLIERS ||--o{ PRODUCTS : "supplies"
SUPPLIERS ||--o{ PURCHASES : "provides"
PURCHASES ||--o{ PURCHASE_ITEMS : "includes"
PRODUCTS ||--o{ PURCHASE_ITEMS : "bought_in"
CUSTOMERS ||--o{ SALES : "makes"
CUSTOMERS ||--o{ CUSTOMER_LEDGER : "has_history"
SALES ||--o{ SALE_ITEMS : "contains"
PRODUCTS ||--o{ SALE_ITEMS : "sold_in"
PRODUCTS ||--o{ STOCK_ADJUSTMENTS : "adjusted"
USERS ||--o{ STOCK_ADJUSTMENTS : "authorized"
USERS {
bigint id PK
string name
string username "unique"
string password
enum role "Admin, Cashier"
}
PRODUCTS {
bigint id PK
string name
string barcode "unique"
decimal cost_price
decimal selling_price
integer stock_quantity
integer reorder_level
}
SALES {
bigint id PK
string invoice_number "unique"
decimal total_amount
decimal discount_amount
decimal vat_amount
decimal net_amount
enum payment_method "Cash, Card, Mobile"
}
- Models (Eloquent): Represent the database tables and define relationships.
- Repositories: Abstraction layer for data fetching (e.g., finding products by barcode).
- Service Layer: Handles "Business Logic" (e.g.,
SaleServicemanages transactions, updates stock, and customer ledger in a single DB transaction). - Audit Observers: Automatically record
AuditLogentries whenever sensitive data (Product/Sale) is modified.
- POS Module: Cashier scans barcode -> Frontend fetches details -> Sale finalized ->
SaleServiceupdates stock ->CustomerLedgerupdated ->InvoiceServicegenerates PDF. - Inventory Module: Stock falls below
reorder_level-> System triggers "Low Stock" alert for reporting.
| Feature | Implementation Detail |
|---|---|
| Login + Roles | USERS table with role enums; Middleware for access control. |
| Products (CRUD) | PRODUCTS, CATEGORIES, SUPPLIERS tables + ProductController. |
| Stock In/Out | PURCHASES (In), SALE_ITEMS (Out), STOCK_ADJUSTMENTS. |
| POS Interface | Fast search via barcode; SALES and SALE_ITEMS tracking. |
| VAT & Discounts | Financial fields in SALES table for precise net calculation. |
| Invoice PDF | InvoiceService using Laravel DOMPDF. |
| Customer Ledger | CUSTOMERS table + CUSTOMER_LEDGER debit/credit history. |
| Audit Log | AUDIT_LOGS table with user-to-action mapping. |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Project Maintainer: Md Rafiul Islam
Project Link: https://github.com/Rafiul29/point-of-sale.git










