This is an ecommerce website that sells streetwear clothes, inspired by ILSN.
- Languages: Java, TypeScript, HTML, CSS
- Frameworks & Libraries: Spring Boot, ReactJS, Bootstrap
- Testing: Postman
- API Documentation: Swagger UI
- Database Management System: MySQL
This website creates an admin account upon the first run. The admin has full access to all features of the website.
This project uses JWT for user authentication.
How it works:
-
Registering:
-
Logging In:
- Users fill in their username and password.
- The client sends a request to verify the information. If valid, the server responds with an access token and a refresh token.
- Both tokens have unique IDs that are saved in the database. These IDs are used to invalidate the tokens after refreshing or logging out.
-
Refresh Token:
- When the access token expires (valid for 3600 seconds), the client sends a refresh request containing the refresh token.
- The server checks the validity of the refresh token. If valid, it saves the IDs of both the refresh token and the access token in the database, generates new tokens, and sends them back to the client.
There are two ways to search for a product:
-
Search by Product Name:
- Users can type a keyword to search for products, without needing to know the full name.
-
Search by Product ID:
- This feature is only available to the admin.
Users can pay for their orders using two methods:
-
User Order Page:
-
Admin Order Management Page:
These pages are for admin use only.
- The server automatically cleans up orders after every season (quarterly).
- Expired tokens are cleaned up automatically after 24 hours.
HTTP Status | Error Side (Developer, Client, Undefined) | Error Code |
---|---|---|
Internal Server Error | Undefined | 9999 |
Internal Server Error | Developer | 1xxx |
Bad Request | Client | 2xxx |
Unauthorized | Client | 3xxx |
Forbidden | Client | 4xxx |
Not Found | Client | 5xxx |
- Java 17
- NodeJS
- MySQL
Run the database_creation.sql
file to create the database.
Ensure NodeJS is installed by checking the version with npm --version
.
- Navigate to the
/Espada-Store-main/frontend/espada-streetwear-store
directory in the terminal. - Run
npm install
. Once thenode_modules
directory is created, proceed to the next step. - Run
npm start
. Ensure port 3000 is available.
The static website should now be visible.
Ensure Java 17 is installed by checking the version with java --version
.
- Navigate to the
/Espada-Store-main/backend/spring-boot-espada-store
directory in the terminal. - Run
./mvnw clean package -DskipTests
. Once thetarget
directory is created, proceed to the next step. - Navigate to the
target
directory in the terminal. - Run
java -jar spring-boot-espada-store-0.0.1-SNAPSHOT.jar
. Ensure port 8080 is available.
- Navigate to the
target
directory of the backend in the terminal. - Run
java -jar spring-boot-espada-store-0.0.1-SNAPSHOT.jar
. Ensure port 8080 is available. - Open a browser and go to:
http://localhost:8080/api/swagger-ui/index.html#/