Online Fruit and Vegetable Shop Project in Java using JSP, Servlet, and MySQL is an e-commerce web application that allows customers to browse fruits and vegetables, manage their shopping cart, and place orders online.
The project is developed using Java web technologies and follows the MVC (Model-View-Controller) architecture. JSP is used to manage the View layer, Servlet handles server-side requests, and MySQL is used as the backend database. Maven is used to manage the project dependencies.
The Online Fruit and Vegetable Shop performs CRUD (Create, Read, Update, and Delete) operations for managing products. The Admin or shop owner can manage product details, prices, images, customer information, orders, and transaction records, while customers can browse products and purchase them online.

Fruit and Vegetable Shop Project in Java
The main objective of the Online Fruit and Vegetable Shop is to provide an online e-commerce platform where customers can conveniently buy fruits and vegetables according to their requirements.
Instead of visiting a physical shop, customers can log in to the application, view available products and prices, add products to their shopping cart, and place an order.
The application also provides the shop owner with a centralized system to manage products, customers, orders, and transaction history.
Objectives of Online Fruit and Vegetable Shop
The major objectives of the application are:
- To provide a simple and user-friendly online shopping platform.
- To allow customers to browse available fruits and vegetables.
- To provide online payment functionality for customers.
- To provide an online platform for customers to purchase fruits and vegetables.
- To make the shopping process convenient and easy to manage.
- To maintain customer order and transaction history.
- To allow the shop owner to manage product information and prices.
- To reduce the dependency on manual order management.
How the Online Fruit and Vegetable Shop Works
The application has two main actors:
- Admin/Shop Owner
- User/Customer
The basic shopping workflow is:
- The customer registers on the application by providing the required details.
- The customer logs into the system.
- The customer views the available fruits and vegetables.
- The customer checks product prices and selects the required products.
- Products can be added to the shopping cart.
- The customer places the order.
- The customer completes the payment process.
- The customer can view the invoice or bill.
- The customer can check previous transactions and order history.
- The Admin manages products, customers, orders, and transaction information.
Modules and Functionalities of Fruit and Vegetable Shop
There are two main modules in the application:
- Admin/Shop Owner Module
- User/Customer Module
Admin/Shop Owner Module
The Admin or shop owner can manage the products and other information available in the online shop.
Admin functionalities include:
- Add products.
- View product information.
- Update product information.
- Delete products.
- Upload product images.
- Update product prices.
- View customer records.
- View order history.
- View transaction information.
- Check pending orders.
- Check placed orders.
- Manage available products in the shop.
The Admin can update product information whenever required, helping keep the online product catalog up to date.
User/Customer Module
The customer is the main shopping user of the application. Customers can browse products, add items to their cart, and place orders online.
Customer functionalities include:
- View available products.
- Register in the application.
- Provide details such as name, email, phone, and address during registration.
- Log in to the application.
- Add products to the shopping cart.
- Manage the shopping cart.
- Place orders.
- Complete online payment.
- View the invoice or shopping bill.
- View transaction history.
Customers need to log in to the application before placing an order.
Product Management
Product management is an important part of the Online Fruit and Vegetable Shop.
The Admin can add new fruits and vegetables to the shop and manage their information. The Admin can also update product prices, upload product images, and delete products that are no longer available.
Customers can view the available products and their prices through the online shopping interface.
Shopping Cart
The shopping cart allows customers to manage the products they want to purchase before placing an order.
Customers can select products according to their requirements and manage the items in the cart before completing the purchase.
This makes the online shopping process more convenient and organized.
Order and Invoice Management
After selecting the required products, customers can place an order through the application.
The system maintains order-related information so that the Admin can view the order history and transaction details. Customers can also view the invoice or bill for their shopping.
Payment and Transaction History
The application provides online payment functionality for customers.
After completing an order, customers can view their transaction history after logging into the system. The Admin can also view transaction information and identify pending or placed orders.
CRUD Operations
The Online Fruit and Vegetable Shop supports CRUD operations for product management.
CRUD stands for:
- Create – Add new products.
- Read – View product and other records.
- Update – Modify product information and prices.
- Delete – Remove products from the system.
CRUD operations make it easier for the shop owner to maintain the online product catalog.
MVC Architecture
The project follows the MVC (Model-View-Controller) architecture.
Model
The Model layer is responsible for application data and database-related operations. MySQL is used to store product, customer, order, and transaction information.
View
JSP, HTML, CSS, and JavaScript are used to create the user interface. Customers and Admins interact with the application through these pages.
Controller
Servlet is used as the Controller. It handles client requests, processes the required operations, and communicates between the View and Model layers.
The MVC architecture helps keep the application organized and makes the project easier to maintain.
Database Management
MySQL is used as the backend database for the project.
The database is used to maintain important information such as:
- Customer details
- Product information
- Product prices
- Orders
- Transaction information
- Shopping-related records
The Java application communicates with MySQL to perform database operations such as adding, retrieving, updating, and deleting records.
Maven Dependency Management
Maven is used in the project to manage dependencies and simplify the Java project configuration.
Using Maven helps manage the libraries required by the application and makes the project structure easier to maintain.
Key Features of Online Fruit and Vegetable Shop
- Online fruit and vegetable shopping.
- Separate Admin and Customer modules.
- Product management.
- Product image upload.
- Product price management.
- Customer registration and login.
- Shopping cart.
- Online order placement.
- Online payment functionality.
- Invoice or bill generation/viewing.
- Order history.
- Transaction history.
- Pending and placed order information.
- CRUD operations.
- MVC architecture.
- MySQL database.
- Maven dependency management.
- JSP and Servlet-based web application.
Technologies Used in Fruit and Vegetable Shop Project
Frontend: JSP, HTML, CSS, JavaScript
Server-side: Servlet
Backend: MySQL
Architecture: MVC
Dependency Management: Maven
Server: Apache Tomcat 8.5
Project Suitability for Students
The Online Fruit and Vegetable Shop is suitable for CS and IT students who want to develop an e-commerce project using Java web technologies.
It can be used as a minor or major project depending on the requirements of the college or course.
Students can learn practical concepts such as:
- Java web application development
- JSP
- Servlet
- MySQL
- MVC architecture
- CRUD operations
- Maven
- User authentication
- Shopping cart functionality
- Order management
- Database-driven applications
- Running Java web projects on Apache Tomcat
The project can also be useful for students preparing their project reports, demonstrations, and viva.
Project Demo
Watch the Online Fruit and Vegetable Shop project demonstration:
Java Web Project Configuration Tutorial
To learn how to configure and run a Java web project using JSP, Servlet, MySQL, Maven, and Tomcat, check the complete Java Web Project Configuration Tutorial:
https://codebun.com/java-web-project-configuration/
Viva Questions and Answers for Java Project
Students preparing for their Java project viva can also refer to:
https://codebun.com/viva-questions-and-answer-for-java-project/
Free Project Source Code and Project Report
You can get the Free Project Source Code for the Online Fruit and Vegetable Shop from GitHub:
https://github.com/jcodebun/Fruit-Shop.git
The source code can help students understand how JSP, Servlet, MySQL, Maven, MVC architecture, CRUD operations, shopping cart, orders, and customer management are implemented in a Java e-commerce web application.
Project-related resources such as the database, project report, ER diagrams, and DFD diagrams can also be useful while preparing the project documentation.
Check More Java Projects with Source Code
Explore more Java projects with source code:
https://codebun.com/category/complete-java-project-with-source-code/