Skip to content

A comprehensive desktop e-commerce application built with Java and JavaFX, featuring a modern UI and complete shopping functionality for multiple user roles.

Notifications You must be signed in to change notification settings

Mahmoud7111/E-Commerce-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ E-Commerce Application

A comprehensive desktop e-commerce application built with Java and JavaFX, featuring a modern UI and complete shopping functionality for multiple user roles.

Java JavaFX


πŸ“‹ Table of Contents


🌟 Overview

This E-Commerce Application is a full-featured desktop shopping platform that supports three distinct user roles: Admin, Seller, and Customer. The application provides a complete e-commerce experience including product browsing, shopping cart management, order processing, and comprehensive reporting features.

The application uses file-based persistence to store data locally, making it easy to deploy and run without requiring a database server.


✨ Features

πŸ” Authentication & User Management

  • User registration with role selection (Admin/Seller/Customer)
  • Secure login system with password validation
  • Default admin account creation on first run
  • User profile management and updates

πŸ›οΈ Shopping Features

  • Browse products with search and filter capabilities
  • Add products to shopping cart
  • Adjust quantities in cart
  • Checkout and place orders
  • View order history and status
  • Payment processing

πŸ‘¨β€πŸ’Ό Admin Features

  • Complete product management (CRUD operations)
  • User management and oversight
  • Product reports and analytics
  • View all orders across the platform
  • Supplier management and pricing reports

πŸͺ Seller Features

  • Add and manage own products
  • View and manage inventory
  • Track product sales
  • Revenue reports and analytics
  • Date-range based revenue calculations
  • View orders for their products

πŸ‘€ Customer Features

  • Browse product catalog
  • Shopping cart management
  • Place orders
  • View order history
  • Update profile information

πŸ“Š Reporting & Analytics

  • Product stock reports
  • Out-of-stock product alerts
  • Revenue tracking (total and average)
  • Supplier pricing reports
  • Date-range based analytics

πŸ—οΈ Architecture

The application follows a layered architecture pattern:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         UI Layer (JavaFX)           β”‚
β”‚  - Login/Register                   β”‚
β”‚  - Dashboards (Admin/Seller/Customer)β”‚
β”‚  - Product Management               β”‚
β”‚  - Order Views                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Domain/Business Logic         β”‚
β”‚  - User Management                  β”‚
β”‚  - Product Management               β”‚
β”‚  - Shopping Cart                    β”‚
β”‚  - Order Processing                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Data Layer                  β”‚
β”‚  - DataStore (Singleton)            β”‚
β”‚  - FileManager                      β”‚
β”‚  - Serialization                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Design Patterns Used:

  • Singleton Pattern: DataStore ensures single instance for data management
  • Factory Pattern: ID generation for users, products, and orders
  • Strategy Pattern: Different dashboards for different user roles

πŸ“ Class Diagram

The following UML class diagram illustrates the structure and relationships between all classes in the application:

Class Diagram

πŸ“„ [View Full Class Diagram (PDF)](E-Com (FINAL).drawio.pdf )

Key Components:

Domain Layer

  • User Hierarchy: Abstract User class with Admin, Seller, and Customer subclasses
  • Shopping System: Product, Cart, Order, Item, and Supplier classes
  • Relationships:
    • Customer has-a Cart
    • Cart contains multiple Items
    • Order contains multiple Products
    • Seller manages multiple Products

Data Layer

  • DataStore: Singleton pattern for centralized data management
  • FileManager: Handles serialization and file I/O operations

UI Layer

  • MainApp: Application entry point
  • Role-specific Dashboards: AdminDashboard, SellerDashboard, CustomerDashboard
  • Management Views: Product management, order management, reports

Utilities

  • IDGenerator: Atomic ID generation for entities
  • UIStyles: Centralized styling constants

πŸ‘₯ User Roles

1. Admin πŸ‘¨β€πŸ’Ό

  • Full system access
  • Manage all products across all sellers
  • View and manage all users
  • Access comprehensive reports
  • Supplier management
  • Default Credentials:
    • Username: admin
    • Password: admin

2. Seller πŸͺ

  • Manage own products
  • View sales analytics
  • Track revenue
  • Update inventory
  • View orders for their products

3. Customer πŸ›οΈ

  • Browse and search products
  • Manage shopping cart
  • Place and track orders
  • Update profile
  • View order history

πŸ“Έ Screenshots

Login Screen

The modern login interface with role selection

Login Screen


Admin Dashboard

Admin dashboard showing product management and analytics

Admin Dashboard


Product Catalog

Product browsing interface with search functionality

Product Catalog


Shopping Cart

Shopping cart with items and checkout option

Shopping Cart


Seller Dashboard

Seller's product management and revenue analytics

Seller Dashboard


Order Management

Order history and tracking interface

Order Management


πŸŽ₯ Demo Video

A comprehensive walkthrough of the application

E-Commerce Application Demo

What's in the Demo:

  • User registration and login process
  • Admin product management
  • Seller adding products
  • Customer browsing and shopping
  • Cart management and checkout
  • Order processing and tracking
  • Revenue reports and analytics

πŸš€ Installation

Prerequisites

  • Java JDK 11 or higher
  • JavaFX SDK (if not bundled with your JDK)
  • IDE (NetBeans, IntelliJ IDEA, or Eclipse recommended)

Steps

  1. Clone the repository

    git clone https://github.com/Mahmoud7111/E-Commerce-Application.git
    cd E-Commerce-Application
  2. Set up JavaFX (if needed)

    • Download JavaFX SDK from openjfx.io
    • Configure your IDE to include JavaFX libraries
  3. Open in your IDE

    • Open the project folder in your Java IDE
    • Ensure all dependencies are resolved
  4. Build the project

    # Using Maven (if configured)
    mvn clean install
    
    # Or build through your IDE
  5. Run the application

    • Run the MainApp.java file located in ecommerce/UI/
    • Or use:
    java -jar E-Commerce-Application.jar
  6. First Run

    • The application will automatically create a dataFolder directory
    • A default admin account will be created automatically:
      • Username: admin
      • Password: admin

πŸ’» Usage

For Admins:

  1. Log in with admin credentials
  2. Navigate to Product Management to add/edit/delete products
  3. View reports for analytics
  4. Manage users and suppliers

For Sellers:

  1. Register as a seller with store name
  2. Add your products through the product management interface
  3. Monitor your revenue and sales
  4. Update product inventory

For Customers:

  1. Register as a customer with shipping details
  2. Browse the product catalog
  3. Add items to cart
  4. Proceed to checkout
  5. Track your orders

πŸ“ Project Structure

E-Commerce-Application/
β”‚
β”œβ”€β”€ ecommerce/
β”‚   β”œβ”€β”€ UI/                           # JavaFX User Interface
β”‚   β”‚   β”œβ”€β”€ MainApp.java              # Application entry point
β”‚   β”‚   β”œβ”€β”€ LoginMenu.java            # Login interface
β”‚   β”‚   β”œβ”€β”€ RegisterMenu.java         # Registration interface
β”‚   β”‚   β”œβ”€β”€ UIStyles.java             # Centralized styling
β”‚   β”‚   └── dashboards/               # Role-specific dashboards
β”‚   β”‚       β”œβ”€β”€ Admin/
β”‚   β”‚       β”‚   β”œβ”€β”€ AdminDashboard.java
β”‚   β”‚       β”‚   β”œβ”€β”€ AdminProductManagement.java
β”‚   β”‚       β”‚   └── AdminProductReports.java
β”‚   β”‚       β”œβ”€β”€ Seller/
β”‚   β”‚       β”‚   β”œβ”€β”€ SellerDashboard.java
β”‚   β”‚       β”‚   └── SellerOrderReports.java
β”‚   β”‚       └── CustomerDashboard.java
β”‚   β”‚
β”‚   β”œβ”€β”€ domain/                       # Business logic layer
β”‚   β”‚   β”œβ”€β”€ users/                    # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ User.java            # Abstract user class
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin.java
β”‚   β”‚   β”‚   β”œβ”€β”€ Seller.java
β”‚   β”‚   β”‚   └── Customer.java
β”‚   β”‚   └── Shopping/                 # Shopping functionality
β”‚   β”‚       β”œβ”€β”€ Product.java
β”‚   β”‚       β”œβ”€β”€ Cart.java
β”‚   β”‚       β”œβ”€β”€ Order.java
β”‚   β”‚       β”œβ”€β”€ Item.java
β”‚   β”‚       └── Supplier.java
β”‚   β”‚
β”‚   β”œβ”€β”€ data/                         # Data persistence layer
β”‚   β”‚   β”œβ”€β”€ DataStore.java           # Singleton data manager
β”‚   β”‚   └── FileManager.java         # File I/O operations
β”‚   β”‚
β”‚   └── util/                         # Utility classes
β”‚       └── IDGenerator.java         # ID generation utility
β”‚
└── dataFolder/                       # Generated at runtime
    β”œβ”€β”€ users.dat                     # Serialized user data
    β”œβ”€β”€ products.dat                  # Serialized product data
    β”œβ”€β”€ carts.dat                     # Serialized cart data
    └── orders.dat                    # Serialized order data

πŸ› οΈ Technologies Used

  • Java 11+: Core programming language
  • JavaFX: Modern UI framework for desktop applications
  • Java Serialization: Data persistence mechanism
  • File I/O: Local data storage
  • Atomic Operations: Thread-safe ID generation
  • Observer Pattern: UI updates and event handling

🎨 UI Features

  • Modern Material Design inspired interface
  • Color-coded buttons and actions
    • Primary: Blue (#2196F3)
    • Success: Green (#4CAF50)
    • Warning: Orange (#FF9800)
    • Error: Red (#F44336)
  • Responsive layouts
  • Hover effects and visual feedback
  • Card-based design for content organization
  • Search and filter functionality
  • Table views with sortable columns

πŸ”„ Data Persistence

The application uses Java Serialization for data persistence:

  • All data is stored in the dataFolder directory
  • Data is automatically saved on every modification
  • Singleton pattern ensures data consistency
  • Automatic initialization on first run

Data Files:

  • users.dat: Stores all user accounts
  • products.dat: Stores product catalog
  • carts.dat: Stores shopping carts
  • orders.dat: Stores order history

πŸ” Security Features

  • Password validation (minimum 4 characters)
  • Role-based access control
  • Input validation for all forms
  • Email format validation
  • Safe type casting for user roles
  • Automatic data persistence

πŸ› Known Issues

  • No issues reported yet! This is a newly created repository.

🚧 Future Enhancements

  • Add database support (MySQL/PostgreSQL)
  • Implement payment gateway integration
  • Add product images
  • Email notifications for orders
  • Advanced search with filters
  • Product categories and subcategories
  • Wishlist functionality
  • Product reviews and ratings
  • Export reports to PDF/Excel
  • Multi-language support

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is currently unlicensed. Please contact the repository owner for usage permissions.


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

Mahmoud7111


πŸ“ž Contact & Support

If you have any questions or need support, please:

  • Open an issue on GitHub
  • Contact the repository owner

⭐ Show Your Support

If you found this project helpful, please give it a ⭐️!


πŸ“ Changelog

Version 1.0.0 (2026-01-31)

  • Initial release
  • Complete e-commerce functionality
  • Admin, Seller, and Customer roles
  • Product and order management
  • Shopping cart system
  • Revenue reporting
  • File-based persistence

About

A comprehensive desktop e-commerce application built with Java and JavaFX, featuring a modern UI and complete shopping functionality for multiple user roles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages