Skip to content

UsmanPrime/SecureShop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SecureShop - E-Commerce Management System

A comprehensive C++ e-commerce platform designed for teaching and implementing cybersecurity concepts, role-based access control, inventory management, and user authentication in a practical context.

πŸ“‹ Overview

SecureShop is a simulated e-commerce system that combines secure authentication mechanisms, file-based data management, and multi-role user access control. The platform integrates practical concepts of system security, user management, and data persistence suitable for educational and professional environments.

Project ID: 24i-2038_B

✨ Key Features

User Management

  • Role-Based Access Control (RBAC) - Three user roles:

    • πŸ‘‘ Admin - System administration and reporting
    • πŸ‘¨β€πŸ’Ό Employee - Inventory and customer support management
    • πŸ›οΈ Customer - Shopping and order management
  • Secure Authentication

    • Username and password-based login
    • OTP (One-Time Password) verification for admin operations
    • Session management

Admin Features

  • User Management - Add, remove, and modify user roles
  • Product Catalog Management - Add products with pricing, stock levels, and categories
  • Inventory Tracking - Monitor stock quantities and low-stock alerts
  • Advanced Search - Search products by various criteria
  • Sales Analytics & Reports
    • Daily revenue calculations
    • Monthly sales reports
    • Top-selling products identification
    • Sales trend analysis
    • Category-wise revenue reports
  • Activity Logging - Monitor all system activities and security events
  • Security Monitoring - Track and log potential security threats
  • Announcements - Broadcast system messages to users

Employee Features

  • Inventory Management - View and update product inventory
  • Stock Management - Add new products and update stock quantities
  • Low Stock Alerts - Get notified about items running low
  • Sales Contributions - Record personal sales activities
  • Support Management - Handle customer support requests
  • Feedback Review - View and manage customer feedback
  • Performance Reports - Generate individual sales reports

Customer Features

  • Product Catalog - Browse and search available products
  • Shopping Cart - Add items to cart and manage quantities
  • Wishlist - Save products for future purchase
  • Order Placement - Complete purchases from cart
  • Order History - Track previous purchases
  • Advanced Search - Find products by category, price, or name
  • Feedback System - Submit reviews and ratings
  • Support Requests - Create and track customer support tickets

Data Management

  • File-Based Persistence - Secure data storage in text files
  • Data Loading/Saving - Automatic catalog and user data synchronization
  • Sales Records - Complete transaction history tracking
  • Activity Logs - Comprehensive audit trails
  • Wishlist Storage - User preference management

πŸ“ Project Structure

SecureShop/
β”œβ”€β”€ Project.h                 # Main project header with includes
β”œβ”€β”€ Project.cpp              # Main entry point with menu system
β”œβ”€β”€ Admin.h / Admin.cpp       # Admin functionality and user management
β”œβ”€β”€ Employee.h / Employee.cpp # Employee operations and inventory
β”œβ”€β”€ Customer.h / Customer.cpp # Customer shopping and order management
β”œβ”€β”€ User.h / User.cpp         # Base User class for inheritance
β”œβ”€β”€ StringUtils.h / StringUtils.cpp # Utility string functions
β”œβ”€β”€
β”œβ”€β”€ Data Files (File-based persistence):
β”‚   β”œβ”€β”€ catalog.txt          # Product catalog data
β”‚   β”œβ”€β”€ users.txt            # User accounts and roles
β”‚   β”œβ”€β”€ customers.txt        # Customer profiles
β”‚   β”œβ”€β”€ Employees.txt        # Employee records
β”‚   β”œβ”€β”€ orderhistory.txt     # Customer order history
β”‚   β”œβ”€β”€ wishlist.txt         # Customer wishlists
β”‚   β”œβ”€β”€ feedback.txt         # Customer feedback and reviews
β”‚   β”œβ”€β”€ support.txt          # Support request tickets
β”‚   β”œβ”€β”€ EmployeeSales.txt    # Employee sales records
β”‚   β”œβ”€β”€ SalesReport.txt      # Sales analytics reports
β”‚   β”œβ”€β”€ ActivityLogs.txt     # System activity logs
β”‚   β”œβ”€β”€ admin_otp.txt        # OTP storage for admin verification
β”‚   β”œβ”€β”€ announcements.txt    # System announcements
β”‚   β”œβ”€β”€ records.txt          # Sales transaction records
β”‚   └── sessions.txt         # Active session management

└── usman.exe                # Compiled executable

πŸš€ Getting Started

Prerequisites

  • C++ Compiler (GCC, Clang, or MSVC)
  • Windows/Linux/macOS environment
  • 50MB disk space for data files

Compilation

Using GCC:

g++ -o usman Project.cpp Admin.cpp Customer.cpp Employee.cpp User.cpp StringUtils.cpp

Using MSVC:

cl Project.cpp Admin.cpp Customer.cpp Employee.cpp User.cpp StringUtils.cpp

Running the Application

./usman          # Linux/Mac
usman.exe        # Windows

πŸ“– Usage Guide

Main Menu

***** WELCOME TO SECURE SHOP *****
[1] Home Page
[2] Login
[3] About
[4] Contact
[5] Exit

Login Portal

LOGIN OPTIONS:
[1] Admin Login (with OTP verification)
[2] Employee Login
[3] Customer Login
[4] View Announcements
[5] Go Back

Admin Portal

  • Create/manage user accounts
  • Add and edit product catalog
  • Generate comprehensive sales reports
  • Monitor activity logs
  • Review security alerts
  • Broadcast announcements

Employee Portal

  • View current inventory
  • Update stock levels
  • Record sales transactions
  • Manage customer support
  • Review customer feedback
  • Generate performance reports

Customer Portal

  • Browse product catalog
  • Search products by category/price
  • Add items to cart
  • Manage wishlist
  • Place orders
  • View order history
  • Submit feedback
  • Create support tickets

πŸ” Security Features

  • Authentication - Password-based user login with session validation
  • Authorization - Role-based access control restricting features by user type
  • OTP Verification - Additional security layer for admin operations
  • Activity Audit Trail - Complete logging of all system activities
  • Threat Monitoring - Security event detection and logging
  • Data Persistence - Encrypted file storage for sensitive data

πŸ’Ύ Data Storage

All application data is stored in plain text files for simplicity. Files include:

File Purpose
catalog.txt Product inventory and pricing
users.txt User accounts with role assignments
customers.txt Customer profile information
orderhistory.txt Transaction records
ActivityLogs.txt System audit trail
admin_otp.txt OTP verification codes
EmployeeSales.txt Employee performance metrics
SalesReport.txt Analytics and reports

πŸ› οΈ Technical Stack

  • Language: C++
  • Data Storage: File I/O (text-based persistence)
  • Architecture: Object-Oriented Programming (Classes & Inheritance)
  • User Interface: Console-based menu system

πŸŽ“ Educational Value

This project demonstrates:

  • Object-oriented programming principles (inheritance, encapsulation)
  • File I/O and data persistence
  • Role-based access control implementation
  • User authentication and authorization
  • Sales analytics and reporting
  • Audit logging and security monitoring
  • Menu-driven application design
  • Data structure management

πŸ“Š System Constants

MAX_CUSTOMERS: 100
MAX_USERS: 200
MAX_PRODUCTS: 100
MAX_CATEGORIES: 10
MAX_SALES_RECORDS: 1000
MAX_ACTIVITY_LOGS: 1000
MAX_ANNOUNCEMENTS: 50
OTP_LENGTH: 6

πŸ”„ Main Workflows

User Registration (Customer)

Customer β†’ Registration β†’ Verification β†’ Catalog Access β†’ Shopping

Purchase Flow

Browse Catalog β†’ Add to Cart β†’ Review Cart β†’ Checkout β†’ Order Confirmation β†’ Order History

Admin Operations

Admin Login β†’ OTP Verification β†’ User Management β†’ Analytics β†’ Report Generation

Employee Workflow

Login β†’ Inventory Review β†’ Stock Updates β†’ Support Management β†’ Performance Reports

πŸ“ File Operations

  • Load Operations: Retrieve data from persistent storage at startup
  • Save Operations: Persist changes to files after modifications
  • Append Operations: Add new records (sales, feedback, logs)
  • Query Operations: Search and filter data based on criteria

πŸ› Known Limitations

  • Text-based file storage (not suitable for large datasets)
  • Single-threaded operation
  • No network/remote access capability
  • Limited concurrent user support
  • Basic encryption (data stored in plain text)

🚧 Future Enhancements

  • Database integration (MySQL/SQLite)
  • Network connectivity for remote users
  • Advanced encryption for sensitive data
  • Mobile application client
  • Payment gateway integration
  • Real-time inventory synchronization
  • Multi-language support
  • Advanced analytics dashboard

πŸ“ž Support

For issues, questions, or contributions, please refer to the project documentation or contact me directly.

πŸ“„ License

This project is developed as an educational exercise for programming fundamentals.


Developed by: FAST-NUCES Student
Student ID: 24i-2038_B
Date: December 2024
Course: Programming Fundamentals (Semester 1)

About

A Simulated Secure Shopping Platform built in C++ as a Programming Fundamentals project. Implements secure user authentication, product management, and transaction processing with data validation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors