This is a simple e-commerce website implemented using the Spring Boot
framework in Java, by a group of five members, namely Spring Spartans
. This group project is assigned under Information Processing for Web
in 5th semester of BTech (IT), University of Calcutta
- Folder structure & configuration
- Basic Web Design
- Model classes for Product, Customer & CartItem
- Repository classes for Product, Customer & CartItem
- Service classes for Product, Customer & CartItem
- Controller classes for Product, Customer & CartItem
- Exception handling & Custom HTTP Error pages
- Classes for SecurityConfig & PasswordEncoder
- Rebranding the website with a cooler design
- Utility for password validation
- Admin to get its login page & dashboard
- Customers now can place orders and view their summary & history
- Introducing site map for customers
- Model classes for Order and Admin
- Repository classes for Order and Admin
- Consequent changes to existing view pages
- Service classes for Order and Admin
- Controller classes for Order and Admin
- Consequent changes to existing Service & Controller classes
Before you begin, ensure that you have met the following requirements:
- Java Development Kit (JDK): Download from Oracle's official website or use OpenJDK.
- Maven: Download from Maven's official website.
- MySQL: Download from MySQL's official website.
- IDE: An Integrated Development Environment (IDE) such as
IntelliJ IDEA
orEclipse IDE
. - STS Plugin (If you're using Eclipse): Install STS Plugin.
To clone the repository, follow these steps:
-
Open your terminal (Command Prompt, PowerShell, or any terminal emulator).
-
Navigate to the directory where you want to clone the project.
-
Run the following command:
git clone https://github.com/Swarnotaj003/ShopKart-E-commerce-Website.git
-
Navigate into the project directory:
cd ShopKart-E-commerce-Website
-
Setup your Database: Open MySQL Command Line Client or Workbench and create a new database for the project.
DROP DATABASE IF EXISTS shopkart; CREATE DATABASE shopkart;
Note: You may follow this step anytime to reset your database
-
Configure Database Connection Settings: Open the
application.properties
file & update the database connection settings.# Database connection settings spring.datasource.url=jdbc:mysql://localhost:3306/shopkart spring.datasource.username=<your_mysql_username> spring.datasource.password=<your_mysql_password>
Replace your_mysql_username and your_mysql_password with your MySQL credentials.
-
Setup your Project Path: Open the
application.properties
file & update the project path.# Settings for uploading files spring.servlet.multipart.enabled=true file.project-path=<your_project_path> file.image-path=src\\main\\resources\\static\\images
The Maven Wrapper allows you to run Maven commands without needing to install Maven on your machine. Follow these steps to run the Spring Boot application using the Maven Wrapper:
-
Open your terminal: Make sure you have your terminal (Command Prompt, PowerShell, or any terminal emulator) open.
-
Navigate to the project directory: If you are not already in the project directory, use the
cd
command to navigate to it. For example:cd path/to/your/ShopKart-E-commerce-Website
-
Run the application using the Maven Wrapper: Use the following command to build and start the application:
./mvnw spring-boot:run
On Windows, use:
mvnw spring-boot:run
-
Wait for the application to start. You should see output in the terminal indicating that the application is running, along with the port number (default is 8080).
-
Once the application starts, open your web browser and navigate to:
http://localhost:8080
You can also run the Spring Boot application directly from your IDE. Follow these steps based on your preferred IDE:
-
Launch the IDE & import the project.
-
Locate the main application class named
ShopkartApplication.java
in thesrc/main/java
directory.- Right-click on the main class file and select
Run As
>Spring Boot Application
.
- Right-click on the main class file and select
-
Once the application starts, open your web browser and navigate to:
http://localhost:8080