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.
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
-
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
- 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
- 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
- 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
- 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
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
- C++ Compiler (GCC, Clang, or MSVC)
- Windows/Linux/macOS environment
- 50MB disk space for data files
Using GCC:
g++ -o usman Project.cpp Admin.cpp Customer.cpp Employee.cpp User.cpp StringUtils.cppUsing MSVC:
cl Project.cpp Admin.cpp Customer.cpp Employee.cpp User.cpp StringUtils.cpp./usman # Linux/Mac
usman.exe # Windows***** WELCOME TO SECURE SHOP *****
[1] Home Page
[2] Login
[3] About
[4] Contact
[5] Exit
LOGIN OPTIONS:
[1] Admin Login (with OTP verification)
[2] Employee Login
[3] Customer Login
[4] View Announcements
[5] Go Back
- Create/manage user accounts
- Add and edit product catalog
- Generate comprehensive sales reports
- Monitor activity logs
- Review security alerts
- Broadcast announcements
- View current inventory
- Update stock levels
- Record sales transactions
- Manage customer support
- Review customer feedback
- Generate performance reports
- Browse product catalog
- Search products by category/price
- Add items to cart
- Manage wishlist
- Place orders
- View order history
- Submit feedback
- Create support tickets
- 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
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 |
- Language: C++
- Data Storage: File I/O (text-based persistence)
- Architecture: Object-Oriented Programming (Classes & Inheritance)
- User Interface: Console-based menu system
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
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: 6Customer β Registration β Verification β Catalog Access β Shopping
Browse Catalog β Add to Cart β Review Cart β Checkout β Order Confirmation β Order History
Admin Login β OTP Verification β User Management β Analytics β Report Generation
Login β Inventory Review β Stock Updates β Support Management β Performance Reports
- 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
- 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)
- 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
For issues, questions, or contributions, please refer to the project documentation or contact me directly.
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)