Skip to content

dominichubble/computer-accessories-shop-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Accessories Shop System

A comprehensive Java Swing application for managing a computer accessories retail store, featuring role-based access control, inventory management, and e-commerce functionality.

🚀 Quick Start

Prerequisites

  • Java Development Kit (JDK) 8 or higher
  • Any Java IDE or command line tools

Running the Application

  1. Compile the project:

    mkdir bin
    javac -d bin src/*.java
  2. Run the application:

    java -cp bin MainFrame
  3. Login with default credentials:

    • Admin: ID: 101, Username: user1, Role: admin
    • Customer: ID: 102, Username: user2, Role: customer

📋 Features

🔐 Authentication System

  • Role-based login (Admin/Customer)
  • Secure user management
  • Session handling

👨‍💼 Admin Features

  • Product Management: Add, update, view inventory
  • Inventory Control: Monitor stock levels
  • Data Validation: Comprehensive input validation

🛒 Customer Features

  • Product Browsing: View available products
  • Shopping Cart: Add/remove items with quantities
  • Search: Find products by barcode or criteria
  • Checkout: PayPal and Credit Card payments
  • Receipts: Transaction records

🖥️ Product Types

  • Keyboards: Gaming, Standard, Flexible layouts
  • Mice: Gaming and standard with button configurations
  • Connectivity: Wired and wireless options
  • Brands: Logitech, Corsair, Razer, Microsoft, Apple, etc.

🏗️ Architecture

Core Classes

  • MainFrame: Login interface and entry point
  • AdminFrame: Administrative interface
  • CustomerFrame: Customer shopping interface
  • Product: Abstract base class
  • Keyboard & Mouse: Product implementations
  • User: Authentication and user management
  • StockManager: Inventory management
  • BasketManager: Shopping cart functionality

Design Patterns

  • Abstract Factory: Product hierarchy
  • Strategy: Payment methods
  • Observer: GUI event handling
  • Singleton: Utility classes

📁 Project Structure

├── src/                    # Java source files
│   ├── MainFrame.java     # Application entry point
│   ├── AdminFrame.java    # Admin interface
│   ├── CustomerFrame.java  # Customer interface
│   ├── Product.java       # Abstract product class
│   ├── Keyboard.java      # Keyboard implementation
│   ├── Mouse.java         # Mouse implementation
│   └── [Other classes]    # Supporting classes
├── data/                  # Data files
│   ├── UserAccounts.txt   # User credentials
│   └── Stock.txt         # Product inventory
├── README.md             # This file
├── BUILD.md              # Build instructions
├── DOCUMENTATION.md      # Detailed documentation
└── .gitignore           # Git ignore rules

🎯 Key Learning Outcomes

This project demonstrates:

  • Object-Oriented Programming: Inheritance, polymorphism, encapsulation
  • GUI Development: Java Swing, event-driven programming
  • File I/O: Data persistence and management
  • Business Logic: E-commerce functionality
  • Error Handling: Input validation and user feedback
  • Software Architecture: Clean code and separation of concerns

📊 Sample Data

The system includes pre-loaded products:

  • Various keyboards from Logitech, Corsair, Microsoft, Apple
  • Gaming and standard mice from Logitech, Razer, Anker
  • Price ranges from budget (£4.99) to premium (£85.50)
  • Mixed connectivity options

🔧 Customization

Adding New Product Types

  1. Extend the Product abstract class
  2. Implement required methods
  3. Update StockManager parsing logic
  4. Add validation rules

Modifying UI

  • All GUI components are in respective Frame classes
  • Adjust bounds and components for layout changes
  • Add tabs to existing TabbedPanes

📄 Documentation

  • README.md: Overview and quick start guide
  • BUILD.md: Detailed build instructions
  • DOCUMENTATION.md: Comprehensive technical documentation

🎓 Educational Value

Perfect for demonstrating:

  • Java programming fundamentals
  • Object-oriented design principles
  • GUI development skills
  • Software engineering practices
  • Business logic implementation

This system showcases a complete e-commerce solution with proper architecture, user management, and business logic implementation.

About

A comprehensive Java Swing e-commerce application for computer accessories retail management with role-based authentication, inventory control, and shopping cart functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages