Skip to content

KrunalValvi/Ecommerce-Java-Swing-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Electronics - E-Commerce Platform

License: MIT Java Maven MySQL Status

A full-featured e-commerce platform built with Java, JSP, Servlets, and MySQL. Supports customer shopping, product management, order processing, and admin controls.


🎯 Problem Statement

Managing an online electronics store requires a robust system to handle:

  • Product Catalog Management - Add, update, and remove products with images
  • Shopping Cart Operations - Add/remove items, manage quantities
  • Order Processing - Create orders, track shipments, manage transactions
  • User Authentication - Secure login/registration for customers and admins
  • Inventory Management - Track stock levels and demand

This project provides a complete solution for these requirements.


✨ Features

  • User Management

    • Customer registration and login
    • Admin authentication
    • Session-based security
    • Password encryption
  • Product Management

    • Browse all products with search functionality
    • Filter products by category/type
    • Product images and details
    • Admin product CRUD operations
    • Stock management
  • Shopping Cart

    • Add/remove items from cart
    • Update quantities
    • Real-time cart calculations
    • Persistent cart storage
  • Order Management

    • Create and process orders
    • Order tracking and history
    • Shipment management
    • Transaction records
  • Admin Dashboard

    • View all products
    • Manage inventory
    • Process orders
    • Track shipments
  • Email Notifications

    • Order confirmation emails
    • Shipment notifications
    • User registration confirmation

πŸ“Έ Demo

Home Page

Home Page

Product Catalog

Product Catalog

Shopping Cart

Shopping Cart

Admin Dashboard

Admin Dashboard


πŸš€ Installation

Prerequisites

  • Java 8+ installed
  • Maven 3.6+ installed
  • MySQL 8.0+ running
  • Tomcat 9+ (or any servlet container)

Step 1: Clone the Repository

git clone https://github.com/yourusername/ajt-ecommerce.git cd AJT_E-commerce

Step 2: Configure Database

  1. Create a MySQL database:
CREATE DATABASE `shopping-cart`;
  1. Import the database schema:
mysql -u root -p shopping-cart < databases/schema.sql

Step 3: Configure Environment Variables

  1. Copy .env.example to .env:
cp .env.example .env
  1. Edit .env with your database and email credentials:
DB_CONNECTION_STRING=jdbc:mysql://localhost:3306/shopping-cart DB_USERNAME=root DB_PASSWORD=your_password MAILER_EMAIL=your-email@gmail.com MAILER_PASSWORD=your-app-specific-password

Step 4: Build the Project

mvn clean install

Step 5: Deploy to Tomcat

  1. Copy the generated WAR file to Tomcat's webapps directory:
cp target/shopping-cart.war $CATALINA_HOME/webapps/
  1. Start Tomcat:
$CATALINA_HOME/bin/startup.sh
  1. Access the application:
http://localhost:8080/shopping-cart 

πŸ“– Usage Examples

Customer Workflow

  1. Register - Create a new account
  2. Browse Products - Search or filter by category
  3. Add to Cart - Select items and quantities
  4. Checkout - Review cart and place order
  5. Track Order - View order status and shipment

Admin Workflow

  1. Login - Access admin dashboard
  2. Manage Products - Add/edit/delete products
  3. View Orders - Process customer orders
  4. Update Shipments - Track and update delivery status
  5. View Analytics - Monitor sales and inventory

πŸ“š Documentation

All documentation is organized in the docs/ folder:


πŸ”Œ API Endpoints

Authentication

  • POST /shopping-cart/login - User login
  • POST /shopping-cart/register - User registration
  • GET /shopping-cart/logout - User logout

Products

  • GET /shopping-cart/index.jsp - View all products
  • GET /shopping-cart/index.jsp?search=keyword - Search products
  • GET /shopping-cart/index.jsp?type=category - Filter by category
  • POST /shopping-cart/AddProductSrv - Add product (Admin)
  • POST /shopping-cart/UpdateProductSrv - Update product (Admin)
  • POST /shopping-cart/RemoveProductSrv - Delete product (Admin)

Shopping Cart

  • POST /shopping-cart/AddtoCart - Add item to cart
  • GET /shopping-cart/cartDetails.jsp - View cart
  • POST /shopping-cart/UpdateToCart - Update cart item

Orders

  • POST /shopping-cart/OrderServlet - Create order
  • POST /shopping-cart/ShipmentServlet - Update shipment

Images

  • GET /shopping-cart/ShowImage?id=productId - Retrieve product image

πŸ—οΈ Tech Stack

Layer Technology
Frontend JSP, HTML5, CSS3, Bootstrap 3, jQuery
Backend Java 8, Servlets, JSP
Database MySQL 8.0
Build Tool Maven 3.6+
Server Apache Tomcat 9+
Email Jakarta Mail API
Security Apache Commons Codec

πŸ“ Project Structure

AJT_E-commerce/ β”œβ”€β”€ src/ β”‚ └── com/shashi/ β”‚ β”œβ”€β”€ beans/ # Data models (ProductBean, UserBean, etc.) β”‚ β”œβ”€β”€ service/ # Service interfaces β”‚ β”œβ”€β”€ service/impl/ # Service implementations β”‚ β”œβ”€β”€ srv/ # Servlet controllers β”‚ β”œβ”€β”€ utility/ # Utility classes (DBUtil, MailUtil, etc.) β”‚ └── constants/ # Application constants β”œβ”€β”€ WebContent/ β”‚ β”œβ”€β”€ css/ # Stylesheets β”‚ β”œβ”€β”€ js/ # JavaScript files β”‚ β”œβ”€β”€ images/ # Product images β”‚ β”œβ”€β”€ WEB-INF/ β”‚ β”‚ β”œβ”€β”€ web.xml # Servlet configuration β”‚ β”‚ └── lib/ # JAR dependencies β”‚ β”œβ”€β”€ index.jsp # Home page β”‚ β”œβ”€β”€ header.jsp # Header component β”‚ β”œβ”€β”€ footer.html # Footer component β”‚ β”œβ”€β”€ cartDetails.jsp # Shopping cart β”‚ β”œβ”€β”€ adminHome.jsp # Admin dashboard β”‚ └── ... # Other JSP pages β”œβ”€β”€ databases/ β”‚ └── schema.sql # Database schema β”œβ”€β”€ pom.xml # Maven configuration β”œβ”€β”€ .env.example # Environment variables template β”œβ”€β”€ .gitignore # Git ignore rules β”œβ”€β”€ .gitattributes # Git attributes β”œβ”€β”€ LICENSE # MIT License └── README.md # This file 

πŸ”§ Configuration

Database Configuration

Edit src/application.properties:

db.driverName=com.mysql.cj.jdbc.Driver db.connectionString=jdbc:mysql://localhost:3306/shopping-cart db.username=root db.password=your_password

Email Configuration

Update mailer credentials in src/application.properties:

mailer.email=your-email@gmail.com mailer.password=your-app-specific-password

Note: For Gmail, use an App-Specific Password.


πŸ§ͺ Testing

Build and Test

mvn clean test

Run Locally

mvn clean install # Deploy to Tomcat as described in Installation section

πŸ” Security Considerations

  • βœ… Password encryption using Apache Commons Codec
  • βœ… Session-based authentication
  • βœ… SQL injection prevention with PreparedStatements
  • ⚠️ TODO: Add CSRF tokens
  • ⚠️ TODO: Implement HTTPS enforcement
  • ⚠️ TODO: Add input validation framework

🚧 Future Improvements

  • Payment Gateway Integration - Stripe/PayPal integration
  • Advanced Search - Elasticsearch integration
  • User Reviews & Ratings - Product feedback system
  • Wishlist Feature - Save favorite products
  • Recommendation Engine - ML-based product suggestions
  • Mobile App - React Native mobile client
  • API Modernization - RESTful API with Spring Boot
  • Analytics Dashboard - Sales and traffic analytics
  • Multi-language Support - i18n implementation
  • Performance Optimization - Caching and CDN integration

πŸ“ Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a 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

See docs/CONTRIBUTING.md for detailed guidelines.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘₯ Authors


🀝 Support

For support, email support@ellison-electronics.com or open an issue on GitHub.


πŸ” SEO Keywords

java e-commerce, shopping cart application, jsp servlet project, mysql database, java web application, e-commerce platform github, shopping cart github, java project example, servlet tutorial, jsp tutorial, maven project, tomcat deployment, java backend, web development java, full-stack java, electronics store, online shopping, inventory management, order processing, user authentication java


Last Updated: December 2024
Version: 1.0.0

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published