Skip to content

sn123686-dev/inventory-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ InvenPro β€” Professional Inventory Management System

PHP MySQL HTML5 CSS3

A fully-featured, professional Inventory Management System built with pure PHP, MySQL, HTML, and CSS β€” no frameworks. Designed to demonstrate real-world web development skills including authentication, API integration, responsive design, and business logic.


🌟 Live Demo

Guest Access: Visit any page without login to browse Admin Access: Register an account to unlock full features


✨ Features

πŸ” Authentication

  • User Registration & Login
  • Session-based authentication
  • Guest mode β€” browse without login
  • Role-based access control
  • Secure password hashing (bcrypt)

πŸ“¦ Product Management

  • Add, Edit, Delete products
  • SKU auto-generation system
  • Product image upload
  • Category management
  • Supplier linking

πŸ“Š Dashboard & Analytics

  • Real-time stats cards (Total Products, Total Value, Low Stock, Categories)
  • Low stock alerts panel
  • Recently added products panel

πŸ”„ Stock Management

  • Stock In / Stock Out tracking
  • Stock movement history
  • Automatic quantity updates
  • Low stock warnings (≀5 units)

🏭 Supplier Management

  • Add and manage suppliers
  • Link products to suppliers
  • Track supplier contact info

🏷️ Category Management

  • Add, Edit, Delete categories
  • Product count per category
  • Protected deletion (can't delete if products exist)

πŸ“‹ Reports

  • Inventory by category with value share bars
  • Most valuable products
  • Most/least stocked products
  • Stock movement summary

πŸ” Search & Filter

  • Search by product name or SKU
  • Filter by category
  • Real-time results

πŸ“₯ Export & Print

  • Export to CSV
  • Print-friendly layout
  • Bulk delete products

πŸ“„ Pagination

  • 10 products per page
  • Dynamic page navigation

🌐 API Integrations

  • ExchangeRate API β€” Real-time currency conversion (USD to PKR, EUR, GBP, AED, SAR, and more)
  • Barcode API β€” Auto-generated barcodes for every product SKU (downloadable + printable)
  • Gmail SMTP (PHPMailer) β€” Automated low stock alert emails

πŸ“± Responsive Design

  • Mobile-friendly hamburger menu
  • Tablet and desktop optimized
  • Print stylesheet included

πŸ“œ Activity Log

  • Tracks every user action
  • Timestamps for all events
  • Clearable log history

πŸ› οΈ Tech Stack

Technology Usage
PHP 8.2 Backend logic, sessions, file handling
MySQL Database (mysqli with prepared statements)
HTML5 Structure and markup
CSS3 Custom styling, responsive design, animations
PHPMailer Email alerts via Gmail SMTP
ExchangeRate API Live currency conversion
Barcode API Product barcode generation
Composer PHP dependency management

πŸ”’ Security Features

  • Prepared statements (SQL injection prevention)
  • Password hashing with password_hash() (bcrypt)
  • Session-based authentication
  • XSS prevention with htmlspecialchars()
  • File upload validation (type + size)
  • CSRF-safe form handling
  • Input sanitization on all forms

πŸ“ Project Structure

inventory-system/
β”œβ”€β”€ auth.php              # Session authentication guard
β”œβ”€β”€ dashboard.php         # Main dashboard with stats
β”œβ”€β”€ products.php          # Product listing, search, filter, export
β”œβ”€β”€ add.php               # Add new product with image upload
β”œβ”€β”€ edit.php              # Edit existing product
β”œβ”€β”€ delete.php            # Delete product
β”œβ”€β”€ stock.php             # Stock In/Out management
β”œβ”€β”€ suppliers.php         # Supplier management
β”œβ”€β”€ categories.php        # Category management
β”œβ”€β”€ currency.php          # Currency conversion (API)
β”œβ”€β”€ barcode.php           # Barcode generator (API)
β”œβ”€β”€ email_alerts.php      # Low stock email alerts (API)
β”œβ”€β”€ reports.php           # Inventory reports
β”œβ”€β”€ activity.php          # Activity log
β”œβ”€β”€ login.php             # User login
β”œβ”€β”€ register.php          # User registration
β”œβ”€β”€ logout.php            # Session logout
β”œβ”€β”€ sidebar.php           # Shared navigation component
β”œβ”€β”€ style.css             # Complete stylesheet
β”œβ”€β”€ db.php                # Database connection (excluded from repo)
└── uploads/              # Product images (excluded from repo)

βš™οΈ Installation & Setup

Prerequisites

  • XAMPP (Apache + MySQL + PHP 8.x)
  • Composer
  • Gmail account with App Password (for email alerts)

Steps

1. Clone the repository

git clone https://github.com/sn123686-dev/inventory-system.git
cd inventory-system

2. Install dependencies

composer install

3. Create the database

Open phpMyAdmin and run:

CREATE DATABASE inventory_db;
USE inventory_db;

CREATE TABLE products (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    sku VARCHAR(50) UNIQUE,
    category VARCHAR(100) NOT NULL,
    supplier_id INT NULL,
    quantity INT NOT NULL,
    price DECIMAL(10,2) NOT NULL,
    image VARCHAR(255) NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE categories (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL UNIQUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE suppliers (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(100),
    phone VARCHAR(20),
    address TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE stock_movements (
    id INT AUTO_INCREMENT PRIMARY KEY,
    product_id INT NOT NULL,
    type ENUM('in', 'out') NOT NULL,
    quantity INT NOT NULL,
    note VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE CASCADE
);

CREATE TABLE activity_log (
    id INT AUTO_INCREMENT PRIMARY KEY,
    action VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(100) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    role ENUM('admin', 'user') DEFAULT 'user',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

4. Create db.php

Create a file called db.php in the project root:

<?php
$host     = "localhost";
$username = "root";
$password = "";
$database = "inventory_db";

$conn = mysqli_connect($host, $username, $password, $database);

if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
?>

5. Create uploads folder

mkdir uploads

6. Run on localhost

Place the project in C:\xampp\htdocs\inventory-system\ and visit:

http://localhost/inventory-system/login.php

🌐 API Setup

Currency Conversion

Barcode Generator

Email Alerts (Gmail SMTP)

  • Enable 2-Step Verification on your Gmail
  • Go to Google Account β†’ Security β†’ App Passwords
  • Create an App Password
  • Enter it in the Email Alerts page when sending

πŸ“Έ Screenshots

Dashboard

Dashboard

Products

Products

Reports

Reports

Mobile View

Mobile


πŸ‘©β€πŸ’» Author

Saima Nadeem


πŸ“„ License

This project is open source and available under the MIT License.

About

Professional Inventory Management System built with PHP & MySQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors