This is the backend server for the online grocery store. It provides various RESTful APIs for managing items, users, carts, orders, and checkout operations. The backend is built using Spring Boot and MySQL.
Before launching the backend server, make sure you have the following installed:
-
Java (version 11 or higher)
-
Maven
-
MySQL Database
Clone the backend project to your local machine:
git clone <your-repository-url>
cd <your-repository-directory>
Make sure to configure your application.properties or application.yml file with your database credentials.
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
The command line of launching MySQL:
& "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -u root -p
Since the data of items is fetched from eBay, you have to get your ebay API for further work.
Please follow the official instruction: https://developer.ebay.com/develop/get-started
To start the backend server, run the following command in your terminal:
./mvnw spring-boot:run
All API endpoints can be found in the OnlineStore\src\main\java\OnlineStore\controller folder and can be tested via Postman directly.
Please note that the backend, configured with Spring Boot, runs on port 8080 by default.
{
"id": "xxxx",
"name": "xxxx",
"price": xx,
"storage": xx
}
[
{
"user_id": xx,
"item_id": "xxxxx",
"amount": xx
},
{
"user_id": xx,
"item_id": "xxxxx",
"amount": xx
}
]