Skip to content

Grocery Store Management System is a DBMS project developed using PHP and MySQL. It manages grocery store operations like product inventory, customer records, orders, and sales reports through a web-based interface with HTML, CSS, and and javascript

Notifications You must be signed in to change notification settings

bhavyasri466/Grocerystore_management

Repository files navigation

πŸ›’ Grocery Store Management System

A complete web-based grocery store management system built with PHP, MySQL, HTML, CSS, and JavaScript. Features inventory management, customer tracking, order processing, and sales reporting.

PHP MySQL Bootstrap

πŸ“‹ Table of Contents

✨ Features

πŸ” Authentication System

  • User registration and login
  • Password hashing with bcrypt
  • Session management
  • User role management

πŸ“¦ Inventory Management

  • Add, edit, delete products
  • Stock quantity tracking
  • Product categorization
  • Low stock alerts

πŸ‘₯ Customer Management

  • Customer profiles
  • Purchase history
  • Contact information
  • Order tracking

πŸ›’ Order Processing

  • Shopping cart functionality
  • Order creation and management
  • Invoice generation
  • Sales reporting

πŸ“Š Reporting & Analytics

  • Sales reports
  • Inventory reports
  • Customer analytics
  • Revenue tracking

πŸ›  Technology Stack

Frontend:

  • HTML5
  • CSS3 (with Bootstrap 5)
  • JavaScript (ES6+)
  • Font Awesome Icons

Backend:

  • PHP 8.0+
  • MySQL 8.0
  • RESTful API Architecture

Security:

  • Prepared statements (SQL injection prevention)
  • Password hashing
  • Input sanitization
  • CSRF protection

πŸ“₯ Installation

Prerequisites

  • XAMPP/WAMP/LAMP stack
  • PHP 8.0 or higher
  • MySQL 8.0 or higher
  • Web browser with JavaScript enabled

Step-by-Step Setup

  1. Clone the Repository

    git clone https://github.com/yourusername/grocery-store-management.git
    cd grocery-store-management
  2. Setup Database

    # Import database schema
    mysql -u root -p grocery_store < database/schema.sql
  3. Configure Database Connection Edit config/database.php:

    define('DB_HOST', 'localhost');
    define('DB_USER', 'your_username');
    define('DB_PASS', 'your_password');
    define('DB_NAME', 'grocery_store');
  4. Start Server

    # Using XAMPP/WAMP:
    # Start Apache and MySQL services
    
    # Or using PHP built-in server:
    php -S localhost:8000
  5. Access Application Open browser and navigate to:

    http://localhost/grocery-store-management/
    

πŸ—„ Database Schema

Entity Relationship Diagram

erDiagram
    CUSTOMERS ||--o{ ORDERS : "places"
    ORDERS ||--|{ ORDER_ITEMS : "contains"
    PRODUCTS ||--o{ ORDER_ITEMS : "includes"
    CATEGORIES ||--o{ PRODUCTS : "categorizes"
    USERS ||--o{ SESSIONS : "has"

    CUSTOMERS {
        int customer_id PK
        varchar name
        varchar email UK
        varchar phone
        text address
    }
    
    PRODUCTS {
        int product_id PK
        varchar name
        text description
        decimal price
        int quantity
        int category_id FK
    }
Loading

Key Tables

  • users: User authentication (user_id, username, password_hash, email)
  • products: Inventory management (product_id, name, price, quantity)
  • customers: Customer data (customer_id, name, email, phone)
  • orders: Order records (order_id, customer_id, total_amount, status)
  • order_items: Order details (order_item_id, order_id, product_id, quantity)

πŸ–₯ Usage

Admin Login

  1. Navigate to login page
  2. Use default credentials:
    • Username: admin
    • Password: admin123
  3. Change password after first login

Managing Products

  1. Go to Products section
  2. Click "Add Product" to add new items
  3. Use edit/delete buttons for management
  4. Set stock quantities and prices

Processing Orders

  1. Select customer from database
  2. Add products to cart
  3. Set quantities
  4. Complete checkout process
  5. Generate invoice

Generating Reports

  1. Navigate to Reports section
  2. Select report type (Sales, Inventory, Customers)
  3. Set date range filters
  4. Export reports as needed

πŸ“ Project Structure

grocery-store-management/
β”œβ”€β”€ index.php                 # Main dashboard
β”œβ”€β”€ config/
β”‚   └── database.php          # Database configuration
β”œβ”€β”€ api/                      # REST API endpoints
β”‚   β”œβ”€β”€ products.php
β”‚   β”œβ”€β”€ customers.php
β”‚   β”œβ”€β”€ orders.php
β”‚   └── auth.php
β”œβ”€β”€ includes/                 # PHP classes and functions
β”‚   β”œβ”€β”€ Database.php
β”‚   β”œβ”€β”€ Product.php
β”‚   β”œβ”€β”€ Customer.php
β”‚   └── Order.php
β”œβ”€β”€ css/                      # Stylesheets
β”‚   β”œβ”€β”€ style.css
β”‚   └── bootstrap.min.css
β”œβ”€β”€ js/                       # JavaScript files
β”‚   └── script.js
β”œβ”€β”€ database/                 # Database schema and seeds
β”‚   β”œβ”€β”€ schema.sql
β”‚   └── sample_data.sql
└── images/                   # Product images and assets
    └── products/

Development Setup

# Install PHP dependencies (if any)
composer install

# Set up development environment
cp config/database.example.php config/database.php

# Run tests
phpunit tests/
  • Bootstrap for responsive UI components
  • Font Awesome for icons
  • PHP community for excellent documentation
  • MySQL for robust database management

πŸ›’ Grocery Store Management System

πŸš€ Quick Start (5-Minute Setup)

Step 1: Install XAMPP

Step 2: Start Services

  • Open XAMPP Control Panel
  • Start Apache and MySQL

Step 3: Setup Project

  1. Download project files
  2. Extract to: C:\xampp\htdocs\grocery_store\

Step 4: Create Database

  1. Go to http://localhost/phpmyadmin/
  2. Create database: grocery_store
  3. Import database/schema.sql

Step 5: Access Application

  • URL: http://localhost/grocery_store/
  • Login: admin / admin123

πŸ“‹ Features

  • πŸ“¦ Product Management
  • πŸ‘₯ Customer Management
  • πŸ›’ Order Processing
  • πŸ“Š Sales Reports

About

Grocery Store Management System is a DBMS project developed using PHP and MySQL. It manages grocery store operations like product inventory, customer records, orders, and sales reports through a web-based interface with HTML, CSS, and and javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors