A comprehensive desktop e-commerce application built with Java and JavaFX, featuring a modern UI and complete shopping functionality for multiple user roles.
- Overview
- Features
- Architecture
- Class Diagram
- User Roles
- Screenshots
- Demo Video
- Installation
- Usage
- Project Structure
- Technologies Used
- Contributing
- License
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.
- 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
- 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
- Complete product management (CRUD operations)
- User management and oversight
- Product reports and analytics
- View all orders across the platform
- Supplier management and pricing reports
- 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
- Browse product catalog
- Shopping cart management
- Place orders
- View order history
- Update profile information
- Product stock reports
- Out-of-stock product alerts
- Revenue tracking (total and average)
- Supplier pricing reports
- Date-range based analytics
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 β
βββββββββββββββββββββββββββββββββββββββ
- 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
The following UML class diagram illustrates the structure and relationships between all classes in the application:
π [View Full Class Diagram (PDF)](E-Com (FINAL).drawio.pdf )
- User Hierarchy: Abstract
Userclass withAdmin,Seller, andCustomersubclasses - Shopping System:
Product,Cart,Order,Item, andSupplierclasses - Relationships:
- Customer has-a Cart
- Cart contains multiple Items
- Order contains multiple Products
- Seller manages multiple Products
- DataStore: Singleton pattern for centralized data management
- FileManager: Handles serialization and file I/O operations
- MainApp: Application entry point
- Role-specific Dashboards: AdminDashboard, SellerDashboard, CustomerDashboard
- Management Views: Product management, order management, reports
- IDGenerator: Atomic ID generation for entities
- UIStyles: Centralized styling constants
- 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
- Username:
- Manage own products
- View sales analytics
- Track revenue
- Update inventory
- View orders for their products
- Browse and search products
- Manage shopping cart
- Place and track orders
- Update profile
- View order history
The modern login interface with role selection
Admin dashboard showing product management and analytics
Product browsing interface with search functionality
Shopping cart with items and checkout option
Seller's product management and revenue analytics
Order history and tracking interface
A comprehensive walkthrough of the application
- 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
- Java JDK 11 or higher
- JavaFX SDK (if not bundled with your JDK)
- IDE (NetBeans, IntelliJ IDEA, or Eclipse recommended)
-
Clone the repository
git clone https://github.com/Mahmoud7111/E-Commerce-Application.git cd E-Commerce-Application -
Set up JavaFX (if needed)
- Download JavaFX SDK from openjfx.io
- Configure your IDE to include JavaFX libraries
-
Open in your IDE
- Open the project folder in your Java IDE
- Ensure all dependencies are resolved
-
Build the project
# Using Maven (if configured) mvn clean install # Or build through your IDE
-
Run the application
- Run the
MainApp.javafile located inecommerce/UI/ - Or use:
java -jar E-Commerce-Application.jar
- Run the
-
First Run
- The application will automatically create a
dataFolderdirectory - A default admin account will be created automatically:
- Username:
admin - Password:
admin
- Username:
- The application will automatically create a
- Log in with admin credentials
- Navigate to Product Management to add/edit/delete products
- View reports for analytics
- Manage users and suppliers
- Register as a seller with store name
- Add your products through the product management interface
- Monitor your revenue and sales
- Update product inventory
- Register as a customer with shipping details
- Browse the product catalog
- Add items to cart
- Proceed to checkout
- Track your orders
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
- 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
- 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
The application uses Java Serialization for data persistence:
- All data is stored in the
dataFolderdirectory - Data is automatically saved on every modification
- Singleton pattern ensures data consistency
- Automatic initialization on first run
users.dat: Stores all user accountsproducts.dat: Stores product catalogcarts.dat: Stores shopping cartsorders.dat: Stores order history
- 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
- No issues reported yet! This is a newly created repository.
- 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
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is currently unlicensed. Please contact the repository owner for usage permissions.
Mahmoud7111
- GitHub: @Mahmoud7111
If you have any questions or need support, please:
- Open an issue on GitHub
- Contact the repository owner
If you found this project helpful, please give it a βοΈ!
- Initial release
- Complete e-commerce functionality
- Admin, Seller, and Customer roles
- Product and order management
- Shopping cart system
- Revenue reporting
- File-based persistence





