Auto Mods is an e-commerce website that specializes in high-performance aftermarket car parts. The website contains a feature-rich store page that allows the user to filter items by category, max price, car make/model and search products by any keyword such as name, description, category, and sort the items from low-high and high-low price. There is also an Admin section of the website only accessible by admin users which allows the admin to add/edit products, view/update orders and much more! The website has been built to scale up, as all the features are built using OOP principles and have been extensively tested through Unit tests and Integration tests.
The website is built with Java, Spring Boot, Thymeleaf, MySQL, HTML5, CSS, JavaScript, Bootstrap 5
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
- You need to have a Java jdk installed on your machine.
- You also need Maven, install it from https://maven.apache.org/install.html
- You also need a MySQL server
- You can download and install XAMPP which includes a MySQL server from https://www.apachefriends.org/download.html
- Or you can download and install MySQL Workbench from https://www.apachefriends.org/download.html
Follow these instructions to set up this project on your local machine
-
Clone the repo
git clone https://github.com/FrodoWood/mods.git
-
Ensure you have latest Java jdk (such as version 17.0.1) by running the following command in your terminal
java -version
-
Start your MySQL server
-
You can either:
- Create a new database called 'mods'.
- Or import the mods.sql file provided in the home directory of this repository
- In both cases ensure your spring.datasource username and password match the ones defined in the application.properties file found here: "src/main/resources/application.properties"
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/mods
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql: true
spring.flyway.url=jdbc:mysql://localhost:3306/mods
spring.flyway.user=root
spring.flyway.password=
spring.thymeleaf.mode=DEBUG
spring.servlet.multipart.max-file-size=1MB
- If using VsCode, then install the Spring Boot and Java official extensions
- Run the application through your IDE's graphical user interface, or
- Run via Maven (this requires Maven to be installed on your machine)
mvn spring-boot:run
- Open your website by entering the address http://localhost:8080/ in your preferred browser
Once your website is running, you can navigate the home, store, product, about, and contact pages without needing an account. Whereas you would need to create an account, by clicking on the Register link the navbar, to add items to the basket, checkout and view order history.
If you have created a new database, then you will have to create a new user who will have the ROLE_USER by default and modify the record to ROLE_ADMIN, from that point on, you don't have to open the database at all.
If you have imported the given database, then simply use the following credentials to access the admin panel:
- Username = admin
- Password = Mods@admin23
All the admin actions such as the following can be performed from the admin panel:
- adding a new product
- updating product details (name, stock, image, etc.)
- changing user roles
- updating order status
- hiding review