This project is a simple e-commerce website built using Java servlets, Apache Tomcat, Apache Maven, and MySQL. Users can log in, navigate through available items, add them to their cart, and view their cart's summary.
- Java Development Kit (JDK)
- Apache Tomcat
- Apache Maven
- MySQL Server (Preferably, WAMP)
- MySQL Workbench or phpMyAdmin
- Clone or download the project repository.
- Run the provided SQL script
src/main/java/config/conf.sql
in your MySQL database using MySQL Workbench or phpMyAdmin to create the necessary database schema and insert dummy data. - Open a terminal and navigate to the project directory.
- Run the following Maven command to build the project:
mvn install -f "/Directory/of/pom.xml"
- After successfully building the project, deploy the generated WAR file located in the target folder (
shop.war
) to your Apache Tomcat server. You can do this by deploying it via the Tomcat Manager web interface. - Start or restart your Apache Tomcat server.
- Open a web browser and navigate to
http://localhost:9090/shop/
(by default, 8080 is the tomcat port) to access the shopping website.
- User Authentication: Users can log in with their username and password. If they don't have an account, they can register for one.
- Home Page: After logging in, users are directed to the home page where they can view available items.
- Item Details: Users can view details of each item, including its name, description, and price.
- Adding Items to Cart: Users can add items to their cart by clicking the "Add to Cart" button.
- Viewing Cart: Users can view their cart summary by clicking the "View Cart" button. The cart summary includes a list of items in the cart and the total price.
- Checkout: Users can proceed to checkout by clicking the "Checkout" button. This feature is under development.
- Java
- Java Servlets
- Apache Tomcat
- Apache Maven
- MySQL
The project follows a standard Maven project structure:
src/main/java
: Contains Java source files.src/main/webapp
: Contains web resources such as HTML, JSP, CSS, and JavaScript files.pom.xml
: Maven project configuration file.
Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests.