You are on page 1of 63

A Project Report on

Car Accessories E commerce


By

Vishwajeet Bhagwan Kamble

MCA – I, SEM – I

2023-24

To

Savitribai Phule Pune University,Pune

In Partial Fulfillment of the Degree of

Master in Computer Application (M. C. A.)

Under The Guidance Of

Dr. Anagha Vaidya

Suryadatta Group of Institutes, Pune

Suryadatta Institute of Management and Mass Communication (SIMMC)


Date:-

CERTIFICATE

This is to certify that Mr. / Ms. _________________________________, has successfully completed his/her

project work entitled “________________________” in partial fulfillment of MCA – I Semester-I program

for the year A.Y. 2023-24 . He / She have worked under our guidance and direction.

Prof.(Name of Project Guide)

(Dr. Anagha Vaidya) HoD-MCA,SGI

Examiner 1 Examiner 2

Date :

Place :
Acknowledgment

We are the student of MCA first year. Here by we express our thanks to our project guide for

allowing us to do the project on “Car Accessories E-commerce”. This project work has been
the most exciting part of our learning experience which would be an asset for our future carrier. We
would especially like to thank our guide and mentor Dr.Anagha Vaidya , who constantly guided us
in developing, pushing us to search for more answers to her numerous questions. Also I would like
to thank our project coordinators Dr.Anagha Vaidya, for their support. As a building block of MCA
Department, I thank Dr. Manisha Kumbhar, HOD, MCA Department for her continuous support and
help. We are grateful to many classmates who contributed their suggestions. Their hard work and
examples push us to limits of our capability and encourage us daily.

Thank You

Vishwajeet Bhagwan Kamble


INDEX

Sr. No. Chapter Page No.


1 CHAPTER 1: INTRODUCTION
1.1 Abstract
1.2 Existing System and Need for System
1.3 Scope of System
1.4 Operating Environment Hardware and Software
1.5 Brief Description of Technology Used
2 CHAPTER 2: PROPOSED SYSTEM
2.1 Feasibility Study
2.2 Objectives of the proposed system
2.3 Users of the system
3 CHAPTER 3: ANALYSIS AND DESIGN
3.1 Entity Relationship Diagram (ERD)
3.2 Class Diagram
3.3 Use Case Diagrams
3.4 Activity Diagram
3.5 Sequence Diagram
3.6 Component Diagram
3.7 Module and Hierarchy Diagram
3.8 Table Design
3.9 Data Dictionary
3.10 Sample Input and Output Screens
4 CHAPTER 4: CODING Sample code
5 CHAPTER 5: LIMITATIONS OF SYSTEM
6 CHAPTER 6: PROPOSED ENHANCEMENTS
7 CHAPTER 7: CONCLUSION
8 CHAPTER 8: BIBLIOGRAPHY
1: INTRODUCTION

1.1 Abstract

Electricity consumers are often faced with


the problem of inaccuracy and delay in
monthly billing
due to the drawback in reading pattern
and human
errors. Thus, it is essential to have an
efficient system for
such purposes via electronic platform with
consideration
to proximity. The proposed system
automates the
conventional process of paying
electricity bill by visiting
the Electricity Board which is tiresome
and time
consuming. It is also designed to automate
the electricity
bill calculation and payment for user
convenience. The
system is developed with Microsoft
Visual Studio using
C# as the base programming language
which can be used
to develop websites, web applications
and web services.
The Microsoft Structured Query Language
(SQL) server
is also used for creating back-end
database. The system
would be having two logins: the
administrative and user
login. The administrator can view the
user’s account
details and can add or update the
customer’s information
of consuming units of energy of the
current month in
their account. The Admin has to feed the
system with the
electricity usage data into respective
users account. The
system then calculates the electricity bill
for every user
and updates the information into their
account every
month. Users can then view their
electricity bill and pay
before the month end.
Electricity consumers are often faced with
the problem of inaccuracy and delay in
monthly billing
due to the drawback in reading pattern
and human
errors. Thus, it is essential to have an
efficient system for
such purposes via electronic platform with
consideration
to proximity. The proposed system
automates the
conventional process of paying
electricity bill by visiting
the Electricity Board which is tiresome
and time
consuming. It is also designed to automate
the electricity
bill calculation and payment for user
convenience. The
system is developed with Microsoft
Visual Studio using
C# as the base programming language
which can be used
to develop websites, web applications
and web services.
The Microsoft Structured Query Language
(SQL) server
is also used for creating back-end
database. The system
would be having two logins: the
administrative and user
login. The administrator can view the
user’s account
details and can add or update the
customer’s information
of consuming units of energy of the
current month in
their account. The Admin has to feed the
system with the
electricity usage data into respective
users account. The
system then calculates the electricity bill
for every user
and updates the information into their
account every
month. Users can then view their
electricity bill and pay
before the month end.
Electricity consumers are often faced with the problem of inaccuracy and delay in
monthly billing due to the drawback in reading pattern and human errors. Thus, it
is essential to have an efficient system for such purposes via electronic platform with
consideration to proximity. The proposed system automates the conventional
process of paying electricity bill by visiting the Electricity Board which is
tiresome and time consuming. It is also designed to automate the electricity bill
calculation and payment for user convenience. The Microsoft Structured Query
Language (SQL) server is also used for creating back-end database. The system
would be having two logins: the administrative and user login. The administrator can
view the user’s account details and can add or update the customer’s information of
consuming units of energy of the current month in their account. The Admin has
to feed the system with the electricity usage data into respective users account. The
system then calculates the electricity bill for every user and updates the
information into their account every month. Users can then view their electricity bill
and pay before the month end.
1.2 Existing System and Need for System

Existing System:
In existing system following are key point:
 Limited Accessibility: Traditional stores and physical suppliers often have limited
geographical reach. Customers may need to travel long distances to access a diverse
range of car accessories, which can be time-consuming and costly.

 Limited Product Information: Physical stores may provide limited information


about car accessories and auto parts, making it challenging for customers to make
informed purchasing decisions. Comprehensive product details, specifications, and
customer reviews are often lacking.
Need for System:

The need for a new system arises from several factors:

 Enhanced Accessibility: The e-commerce platform provides a global reach, allo


wing customers from various locations to access an extensive catalog of car
accessories and auto parts, eliminating the need for physical travel.

 Comprehensive Product Information: Detailed product descriptions, specification


s, high-quality images, and customer reviews empower customers with the infor
mation they need to make informed purchasing decisions.

 Efficient Ordering: The system streamlines the ordering process by enabling cust
omers to place orders online, reducing manual intervention, errors, and processin
g time.

 Secure Transactions: A secure payment gateway ensures the confidentiality of cu


stomer data and financial information, mitigating security concerns associated wi
th traditional payment methods.
1.3 Scope of System:

• Product Catalog: The system will include an extensive product catalog showcasing a
variety of car accessories and autoparts , with detailed product information.

• User Management: Users will be able to create accounts, log in, and manage their
profiles. Registered users will have access to personalized features like order history
and saved preferences.

• Secure Transactions: The system will implement a secure payment gateway to enable
users to make transactions confidently while protecting their financial information.

• Search and Filter: Robust search and filtering capabilities will allow users to easily
find the cr accessories and auto parts they need based on criteria such as tool type, size,
material, and price.

• Responsive Design: The system will be responsive, ensuring optimal user experiences
on various devices, including desktops, tablets, and mobile phones.
1.4 Operating Environment Hardware and Software

Server side requirement

1.Hardware Requirements
Processor: AMD Ryzen 3

RAM: 4GB
HDD: 256GB

2. Software Requirements:
Operating System: Windows 10
Database: MySQL
Front End: JSP , SEVELET, SpringBoot .
Server Side Script: JAVA, Tomcat
Software Development Tool : Java 11 , Intellij idea

Client-side requirement

1.Hardware Requirements:
Processor AMD Ryzen 3
RAM: 4GB

2.Software Requirements:
Operating System : Windows 10
Browser : Crome , Brave
1.5 Brief Description of Technology Used JAVA:

Java is one of the most popular and widely used programming language and
platform. A platform is an environment that helps to develop and run pro- grams
written in any programming language. Java is fast, reliable and secure. From desktop to
web applications, scientific supercomputers to gaming consoles, cell phones to the
Internet, Java is used in every nook and corner. Java is a programming language and
computing platform first released by Sun Microsystems in 1995. There are lots of
applications and websites that will not work unless you have Java installed, and more
are created every day. Java is fast, secure, and reliable. From laptops to datacenters,
game consoles to scientific supercomputers, cell phones to the Internet, Java is
everywhere! Java is a general-purpose, concurrent, object-oriented, classbased, and the
run- time environment (JRE) which consists of JVM which is the cornerstone of the
Java platform. This blog on what is Java will clear all your doubts about why to learn
java, features and how it works.

JDK:
The Java Development Kit (JDK) is an implementation of either one of the Java
Platform, Standard Edition, Java Platform, Enterprise Edition, or Java Platform, Micro
Edition platforms released by Oracle Corporation in the form of a binary product aimed
at Java developers on Solaris, Linux, macOS or Windows. The JDK includes a private
JVM and a few other resources to finish the development of a Java Application. Since
the introduction of the Java platform, it has been by far the most widely used Software
Development Kit (SDK). On 17 November 2006, Sun announced that they would
release it under the GNU General Public License (GPL), thus making it free software.
This happened in large part on 8 May 2007, when Sun contributed the source code to
the OpenJDK.
2. PROPOSED SYSTEM

Proposed System:
Key Components of the Proposed System:

• User Registration and Authentication: The system will allow users to create
accounts, providing essential information such as name, contact details, and
shipping address. Account creation ensures a personalized experience and the ability
to track orders.

• Product Catalog: A comprehensive catalog of carbide tools will be featured on the


website, complete with product descriptions, specifications, high-resolution images,
and pricing information. Products will be organized into categories and
subcategories for easy navigation.

• Search and Filter Functionality: Users can search for specific car accessory by
name, size, length, diameter, category, or material. Advanced filtering options will
enable users to refine their searches based on criteria like price range, brand, and
specifications.

• Product Details: Detailed product pages will provide in-depth information about
each car accessory, including material, dimensions, applications, and customer
reviews. Users can add items to their shopping carts directly from these pages.

• Shopping Cart: A user-friendly shopping cart system will allow customers to


review, modify, and finalize their orders. The cart will display the total cost,
including taxes and shipping fees, before checkout.

• Secure Checkout: The system will integrate a secure payment gateway to facilitate
smooth and secure transactions. Multiple payment options, including credit/debit
cards and digital wallets, will be supported.

• Order Management: Registered users can track their order status and history. They
will receive email notifications at various stages of the order processing, from order
confirmation to shipment tracking.

• User Reviews and Ratings: Customers can leave reviews and ratings for products
they have purchased, helping others make informed decisions.

• Responsive Design: The website will be responsive, ensuring a seamless user


experience across devices, including desktops, tablets, and smartphones.

• Admin Panel: An admin panel will be provided for site administrators to manage
products, user accounts, orders, and site content. Administrators can also generate
reports to gain insights into site performance.

• Customer Support: The system will offer multiple customer support channels,
including live chat and email, to address customer inquiries and concerns promptly.
2.1 Feasibility Study:

 Technical Feasibility
•Java: Java is a mature and widely used programming language known for its portabilit
y, scalability, and robustness. Leveraging Java as the core programming language for th
e e-commerce site ensures platform independence, allowing it to run on various operati
ng systems.

•JSP (Java Server Pages) and Servlets: JSP and Servlets are fundamental components o
f the Java EE (Enterprise Edition) stack, specializing in dynamic web page creation and
handling user interactions. They enable the development of responsive and interactive
web interfaces, making them suitable for building an e-commerce site with rich feature
s.

•Hibernate: Hibernate is an Object-Relational Mapping (ORM) framework that simplifi


es database interactions by mapping Java objects to database tables. Its use in this proje
ct streamlines data management, enhancing data integrity and performance.

•Relational Database: An e-commerce site for carbide tools requires efficient data stora
ge and retrieval. Hibernate, in combination with a relational database management syst
em (RDBMS) such as MySQL or PostgreSQL, ensures organized and structured data st
orage. This choice supports complex queries, relationships, and transactions.

•Payment Gateways: Integrating secure and reliable payment gateways, such as PayPal
or Stripe, is crucial for processing online transactions securely.

 Economic Feasibility
• Cost Analysis: The economic feasibility analysis begins with a comprehensive cost as
sessment. This includes the initial development costs, which involve hiring skilled Java
developers, web designers, and database administrators to build and launch the platfor
m. Additionally, ongoing operational costs such as hosting, maintenance, and marketin
g expenses need to be factored in.

• Revenue Projections: Revenue generation is a central aspect of economic feasibility.


Projections are made based on the expected sales volume, average order value, and pric
ing strategy for car accessories . Market research and competitive analysis are instrume
ntal in estimating the potential market share and revenue growth.

• Return on Investment (ROI): Calculating the ROI involves comparing the expected re
turns from the e-commerce site to the initial investment. This metric helps stakeholders
determine how long it will take to recoup the development and operational expenses an
d start generating profit.

• Scalability and Growth Potential: Economic feasibility also involves assessing the sca
lability of the e-commerce site. Can it handle an increase in traffic and transactions wit
hout a proportionate increase in costs? Identifying opportunities for growth, such as ex
panding product offerings or entering new markets, is crucial.
 Operational Feasibility

• User-Friendly Interface: The operational feasibility of our e-commerce site begins


with its user-friendly interface. The Java, JSP, Servlet, and Hibernate technologies a
llow for the creation of an intuitive and responsive website, making it easy for users
to navigate, search for products, and complete transactions. This user-friendliness en
sures that both tech-savvy and non-technical users can interact with the platform co
mfortably.

• Scalability: One of the key operational aspects is the platform's ability to scale wit
h the growth of the business. Using Java and Hibernate, our e-commerce site can ac
commodate an expanding product catalog, increased user traffic, and additional feat
ures without compromising performance. This scalability is essential for adapting to
changing business requirements.

• Maintenance and Updates: The operational feasibility study also considers the ease
of maintaining and updating the system. Java, JSP, Servlet, and Hibernate offer a str
uctured and modular approach to development, making it relatively straightforward
to add new features, fix bugs, and apply security patches. This ensures that the e-co
mmerce platform can be efficiently maintained over time.
2.2 Objectives of the proposed system:
The objectives of the e-commerce system for car accessories are to create a robust and
feature-rich platform that serves the needs of both customers and administrators. The
following are the primary objectives:

• User-Friendly Interface: Design a user-friendly and intuitive interface that encourages


easy navigation and product discovery.

• Comprehensive Product Listings: Ensure an extensive and up-to-date product catalog,


including detailed descriptions and images for each car accessory

• Security: Implement robust security measures to protect user data and financial
information during transactions.

• Personalization: Provide registered users with personalized features, such as order


history, saved preferences, and recommendations based on their browsing and purchase
history.
2.3 Users of the system:
There are 2 Users present in the application:
1. Admin 2. Customer

Admin :
The administrator is the master user of this application
Responsibility of admin includes:

• Creating new customers


• View Customers Details
• inserting product and update product
• Update Status of payment
• Calculating bill

Customer :

Customer’ Functionality includes:

• New Customer can register


• Login using username and password
• View and choose the product
• add product to cart
• do payment
• check status of order
• do quotation of product
3. ANALYSIS AND DESIGN

3.1 Entity Relationship Diagram (ERD):


3.2 Class Diagram :

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static
structure diagram that describes the structure of a system by showing the system's classes, their attributes,
operations (or methods), and the relationships among objects.

The class diagram is the main building block of object-oriented modeling. It is used for general conceptual
modeling of the structure of the application, and for detailed modeling, translating the models into
programming code. Class diagrams can also be used for data modeling.[1] The classes in a class diagram
represent both the main elements, interactions in the application, and the classes to be programmed.

In the diagram, classes are represented with boxes that contain three compartments:

 The top compartment contains the name of the class. It is printed in bold and centered, and the first
letter is capitalized.

 The middle compartment contains the attributes of the class. They are left-aligned and the first letter is
lowercase.

 The bottom compartment contains the operations the class can execute. They are also left-aligned and
the first letter is lowercase.

In the design of a system, a number of classes are identified and grouped together in a class diagram that
helps to determine the static relations between them. In detailed modeling, the classes of the conceptual
design are often split into subclasses.

In order to further describe the behavior of systems, these class diagrams can be complemented by a state
diagram or UML state machine.
3.3 Use Case Diagram :
To model a system, the most important aspect is to capture the dynamic behavior.

Dynamic behavior means the behavior of the system when it is running/operating.

Only static behavior is not sufficient to model a system rather dynamic behavior is more important than
static behavior. In UML, there are five diagrams available to model the dynamic nature and use case
diagram is one of them. Now as we have to discuss that the use case diagram is dynamic in nature, there
should be some internal or external factors for making the interaction.

These internal and external agents are known as actors. Use case diagrams consists of actors, use cases
and their relationships. The diagram is used to model the system/subsystem of an application. A single
use case diagram captures a particular functionality of a system.

Hence to model the entire system, a number of use case diagrams are used.
 Purpose of use case diagram

The purpose of use case diagram is to capture the dynamic aspect of a system. However, this definition
is too generic to describe the purpose, as other four diagrams (activity, sequence, collaboration, and
Statechart) also have the same purpose. We will look into some specific purpose, which will distinguish
it from other four diagrams.

Use case diagrams are used to gather the requirements of a system including internal and external
influences. These requirements are mostly design requirements. Hence, when a system is analyzed to
gather its functionalities, use cases are prepared and actors are identified.

When the initial task is complete, use case diagrams are modelled to present the outside view.

In brief, the purposes of use case diagrams can be said to be as follows

 Used to gather the requirements of a system.

 Used to get an outside view of a system.

 Identify the external and internal factors influencing the system.

 Show the interaction among the requirements are actors.


User:
Admin:
Activity Diagram :

An activity diagram is a type of Unified Modeling Language (UML) flowchart that shows the flow from
one activity to another in a system or process. It's used to describe the different dynamic aspects of a
system and is referred to as a 'behavior diagram' because it describes what should happen in the modeled
system.
Even very complex systems can be visualized by activity diagrams. As a result, activity diagrams are
often used in business process modeling or to describe the steps of a use case diagram within
organizations. They show the individual steps in an activity and the order in which they are presented.
They can also show the flow of data between activities.
Activity diagrams show the process from the start (the initial state) to the end (the final state). Each
activity diagram includes an action, decision node, control flows, start node, and end node.

Benefits of activity diagrams :

 Here are some of the key benefits of using activity diagrams to show the flow of activities in a
system or process within your organization:
Shows the progress of workflow amongst the users, and the system

 Activity diagrams clearly show the progress of workflow between the users. This makes it easier for
managers to see what's working well and where the bottlenecks are within the system to make
relevant changes.
Demonstrates the logic of an algorithm

 Activity diagrams provide a clear visualization of the logic of an algorithm. This provides a clear
view of what's happening behind the scenes and makes it easy to identify what's working well and
needs improvement. Vividly shows the steps taken when performing a UML use case.

 A use case diagram is designed to show the different ways a user may interact with a system. An
activity diagram vividly shows every single step taken within this use case diagram. This helps
business managers to visualize business processes within the organization fully.

 Models the software architecture elements, including the method, operation, and function

 Activity diagrams can be used to model software architecture elements within a system by showing
the relationships between the components and the constraints for assembling these components.
This can provide a better understanding of how the system works.

 Simplifies the majority of the UML processes by clarifying complicated use cases
 Use cases can either be sequential or concurrent. Concurrent use cases can be tough to describe, as
many different processes are happening simultaneously. Activity diagrams provide a clear
visualization of these processes, making them easier to understand.
User:
Order:
Admin:
3. Sequence Diagram

Admin
3.6 Sequence Diagram :
User
3.6 Table Design :
 Table:
The given below table is a snapshot of backend view of the localhost and the structures
of the tables present in Car Acessories Ecomerce. The tables present are Login,
customer, bill , meter , tax

Product Details
Field name Data Type constraint Description

Cart_item_id BigInt Primary key Cart item id

Our_price Float Not Null Our price

quantity BigInt Not Null quantity

Total_price Float Not Null Total Price

Product_id BIgInt Primary key Product id

Shopping_cart_id BigInt Primary key Shopping Cart Id

Category
Field name Data Type constraint Description

Category_id BIGINT Primary key Category id

Description VARCHAR(255) Not Null Description

Is_active BIT(1) Not Null Is active

Is_deleted BIT(1) Not Null Is deleted

name VARCHAR(255) Not Null name

Customer
Field name Data Type constraint Description
customer_id BIGINT Primary key Customer id
address1 VARCHAR(255) Not Null address1
address2 VARCHAR(255) Not Null address2
city VARCHAR(255) Not Null city
company VARCHAR(255) Not Null company
first_name VARCHAR(255) Not Null First name
is_deleted BIT(1) Not Null Is deleted
last_name VARCHAR(255) Not Null Last name
password VARCHAR(255) Not Null password
phone VARCHAR(255) foreign key phone
postal_code VARCHAR(255) Not Null Postal code
state VARCHAR(255) Not Null state
username VARCHAR(255) Not Null username
country_id BIGINT Primary key Country id

Order
Field name Data Type constraint Description
order_id BIGINT Primary key order id
delivery_date DATETIME Not Null Delivery date
description VARCHAR(255) Not Null description
grand_total FLOAT Not Null Grand total
is_deleted BIT(1) Not Null Is deleted
order_date VARCHAR(255) Not Null Order date
order_status VARCHAR(255) Not Null Order status
payment_method VARCHAR(255) Not Null Payment
method
shipping_method VARCHAR(255) Not Null Shipping
method
shipping_total FLOAT foreign key Shipping total
sub_total FLOAT Not Null Sub total
tax_rate FLOAT Not Null Tax rate
tax_total FLOAT Not Null Tax total
customer_id BIGINT Primary key customer id

Product
Field name Data Type constraint Description
Product_id BIGINT Primary key Product id
code DATETIME Not Null Code
cost_price FLOAT Not Null Cost price
description VARCHAR(255) Not Null description
image1 VARCHAR(255) Not Null image1
Image2 VARCHAR(255) Not Null Image2
Image3 VARCHAR(255) Not Null Image3
is_active BIT(1) Not Null Is active
is_deleted BIT(1) Not Null Is deleted
name FLOAT Not Null name
our_price FLOAT Not Null Our price
sale_price FLOAT Not Null Sale price
stock_qty Int Not Null Stock qty
customer_id BIGINT Primary key customer id

Shopping cart
Field name Data Type constraint Description

shopping_cart_id BIGINT Primary key Shopping cart id

Description VARCHAR(255) Not Null Description

grand_total FLOAT Not Null Grand total

payment_method VARCHAR(255) Not Null Payment


method

shipping_method VARCHAR(255) Not Null Shipping


method

shipping_total FLOAT Not Null Shipping total

sub_total FLOAT Not Null Sub total

tax_rate FLOAT Not Null Tax rate

tax_total FLOAT Not Null Tax total

customer_id BIGINT Primary key Customer id

User
Field name Data Type constraint Description
user_id BIGINT Primary key User id
first_name VARCHAR(255) Not Null First name
is_active BIT(1) Not Null Is active
is_deleted BIT(1) Not Null Is deleted
last_name VARCHAR(255) Not Null Last name
password VARCHAR(255) Not Null Password
username VARCHAR(255) Not Null Username

Quotation
Field name Data Type constraint Description
Quote_id BIGINT Primary key Quote id
Name VARCHAR(255) Not Null name
company VARCHAR(255) Not Null company
Contact INT Foreign key contact
Tool_name VARCHAR(255) Not Null Tool name
Description VARCHAR(255) Not Null Description
Price FLOAT Not Null Price
Date DATETIME Not Null Date

3.10 Sample Input and Output Screens :


Frontend:

Login Page

Home Page
Categories Pages
Admin Login Page
Admin Control Panel
4 : CODING Sample Code :
import javax.validation.Valid;
import nazeem.autoparts.library.model.Category;
import nazeem.autoparts.library.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping("/category")
public class CategoryController {
@Autowired
private CategoryService categoryService;
private String add_edit_template="/category/add-edit-category";
private String list_template="/category/list-category";
private String list_redirect="redirect:/category/list";
@GetMapping("/add")
public String addCategory(Category category, Model model){
model.addAttribute("category", category);
return add_edit_template;
}
@GetMapping("/edit/{id}")
public String editCategory(@PathVariable("id") int id, Model model){
Category category = categoryService.get(id); model.addAttribute("category",
category);
return add_edit_template;
}
@PostMapping("/save")
public String saveCategory(@Valid @ModelAttribute("category") Category
category, BindingResult result, Model model){
model.addAttribute("category", category);
if(result.hasErrors()){
return add_edit_template;
}
categoryService.save(category);
return list_redirect+"?success";
}
/*@GetMapping("/delete/{id}")
public String deleteCategory(@PathVariable("id") int id, Model model) {
categoryService.delete(id);
return list_redirect+"?deleted";
}*/
@GetMapping("/list")
public String listCategory(Model model) {
List<Category> listCategories = categoryService.findAll();
model.addAttribute("listCategories", listCategories);
return list_template;
}
}
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class DashboardController {
@RequestMapping("/")
public String index() {
return "/dashboard/index";
}
// Added to test 500 page
@RequestMapping(path = "/tigger-error", produces =
MediaType.APPLICATION_JSON_VALUE)
public void error500() throws Exception {
throw new Exception();
}
}
import nazeem.autoparts.library.model.User;
import nazeem.autoparts.library.service.UserService;
import nazeem.autoparts.library.web.dto.UserRegistrationDto;
import org.springframework.beans.factory.annotation.Autowired;import
org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import javax.validation.Valid;
@Controller
public class LoginController {
@Autowired
private UserService userService;
@GetMapping("/login")
public String login(Model model) {
return "/auth/login";
}
@GetMapping("/register")
public String register(Model model) {
UserRegistrationDto userRegistrationDto = new
UserRegistrationDto();
model.addAttribute("userRegistrationDto", userRegistrationDto);
return "/auth/register";
}
@PostMapping("/register")
public String registerUserAccount(@Valid
@ModelAttribute("userRegistrationDto") UserRegistrationDto
userRegistrationDto, BindingResult result, Model model) {
model.addAttribute("userRegistrationDto", userRegistrationDto);
User userExists =
userService.findByUsername(userRegistrationDto.getUsername());
//System.out.println("user-->"+userRegistrationDto.getUserName());
//System.out.println("userExists-->"+userExists);
if (userExists != null) {
return "redirect:/register?username";
}
if(result.hasErrors()){
return "/auth/register";
}
userService.save(userRegistrationDto);
return "redirect:/register?success";
}
}

Frontend:
import nazeem.autoparts.library.model.*;
import nazeem.autoparts.library.service.*;
import nazeem.autoparts.library.util.Utility;
import org.springframework.beans.factory.annotation.Autowired;import
org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@Controller
public class HomeController {
@Autowired
private MakeService makeService;
@Autowired
private ModelService modelService;
@Autowired
private Utility utility;
@Autowired
ProductService productService;
@RequestMapping("/")
public String index(Model model) {
model.addAttribute("classActiveHome", "home active ");
List<Make> listMake = makeService.findAll();
model.addAttribute("listMake", listMake);
List<nazeem.autoparts.library.model.Model> listModel =
modelService.getModels(listMake.get(0).getId());
model.addAttribute("listModel", listModel);
List<Integer> listYear = utility.getYears();
model.addAttribute("listYear", listYear);
List<Product> productList = productService.findAllByActive();
model.addAttribute("productList", productList);
//Getting top 4
List<Product> productList2 =
productService.topMostOrderedProducts(8);
model.addAttribute("productList2", productList2);
return "/client/home";
}
@RequestMapping("/about-us")
public String aboutUs(Model model) {
model.addAttribute("classActivePages", "home active ");
return "/client/about-us";
}
@RequestMapping("/contact-us")
public String contactUs(Model model) {
model.addAttribute("classActivePages", "home active "); return "/client/contact-us";
}
@RequestMapping("/faq")
public String faq(Model model) {
model.addAttribute("classActivePages", "home active ");
return "/client/faq";
}
@RequestMapping("/privacy-policy")
public String privacyPolicy(Model model) {
model.addAttribute("classActivePages", "home active ");
return "/client/privacy-policy";
}
@RequestMapping("/return-policy")
public String returnPolicy(Model model) {
model.addAttribute("classActivePages", "home active ");
return "/client/return-policy";
}
@RequestMapping("/terms-and-conditions")
public String termsAndConditions(Model model) {
model.addAttribute("classActivePages", "home active ");
return "/client/terms-and-conditions";
}
@RequestMapping(value = "/models")
@ResponseBody
public List<Dropdown> getModels(@RequestParam Long make) {
List<nazeem.autoparts.library.model.Model> modelList =
modelService.getModels(make);
List<Dropdown> dropdownList=new ArrayList<>();
for (nazeem.autoparts.library.model.Model model: modelList) {
dropdownList.add(new Dropdown(model.getId(), model.getName()));
}
return dropdownList;
}
// Added to test 500 page
@RequestMapping(path = "/tigger-error", produces =
MediaType.APPLICATION_JSON_VALUE)
public void error500() throws Exception {
throw new Exception();
}
}
import nazeem.autoparts.library.model.Category;
import nazeem.autoparts.library.model.Make;
import nazeem.autoparts.library.service.CategoryService;
import nazeem.autoparts.library.service.MakeService;
import nazeem.autoparts.library.service.ModelService;
import nazeem.autoparts.library.service.ProductService;
import nazeem.autoparts.library.model.Product;
import nazeem.autoparts.library.util.Utility;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller;import
org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@Controller
public class PartController {
@Autowired
CategoryService categoryService;
@Autowired
private ProductService productService;
@Autowired
private MakeService makeService;
@Autowired
private ModelService modelService;
@Autowired
private Utility utility;
private final Integer PAGE_SIZE=2;
@RequestMapping("/category")
public String category(@RequestParam("id") Optional<Long> id
, Model model
, @RequestParam("page") Optional<Integer> page
, @RequestParam("size") Optional<Integer> size) {
int currentPage = page.orElse(1);
int pageSize = size.orElse(PAGE_SIZE);
model.addAttribute("classActiveCategory", "home active ");
//Get all categories
List<Category> categoryList = categoryService.findAll();
model.addAttribute("categories", categoryList);
//Get selected product & category
Page<Product> productList;
Category category;
if (id.isPresent()) {
productList = productService.searchResults("",
id.get().toString(), "1", "1", "", PageRequest.of(currentPage-1,
pageSize));
//productList = productService.findAllByCategoryId(id.get(),
PageRequest.of(currentPage-1, pageSize));
category = categoryService.get(id.get());
} else {
productList = productService.searchResults("", "", "1", "1",
"", PageRequest.of(currentPage-1, pageSize));
//productList = productService.findPaginated("",
PageRequest.of(currentPage-1, pageSize));
category = new Category();
category.setName("All Categories");
}

5 : Limitations of System:
Limited scalability: The system may struggle to handle sudden spikes in
traffic or increased demand during peak periods.
• Security vulnerabilities: It might be prone to cybersecurity threats like
data breaches or hacking due to potential loopholes in security measures.
• Lack of personalization: Inadequate customization options may restrict
the ability to tailor the user experience for individual customers.
• Compatibility issues: It could face challenges in integrating with newer
technologies or software updates, potentially causing functionality issues.
• Performance bottlenecks: Slow loading times or processing delays may
hinder the overall user experience, impacting customer satisfaction

6 : Proposed Enhancement

• Diverse Payment Options: Integrate various payment gateways


(credit/debit cards, PayPal, digital wallets) to offer customers flexibility
in their payment methods.
• Customized Quotation System: Implement a quoting system where
customers can request custom quotes for bulk orders or specific tool
configurations. This could involve a form where they input quantities,
specifications, and receive tailored pricing.
• Payment Security Measures: Strengthen the site's security protocols by
using SSL certificates, encryption, and two-factor authentication to
safeguard sensitive payment information and build customer trust.

7 : Conclusion
In conclusion, while the ecommerce site for car accessories e commerce offers a
valuable
platform, its success hinges on addressing key areas like scalability, security,
personalization, compatibility, and performance. Investing in these aspects can
significantly enhance user experience, security measures, and adaptability,
ensuring sustained growth and customer satisfaction within the competitive
market of car accessories and tools.

8: Bibliography

• https://autoparts.nz/
• https://www.youtube.com/watch?v=jdBYwqmMMxU&list=PL0zysOflR
CekMr91amXBNwWku4PmeFaFD
• https://www.autopartscorner.com/

You might also like