- Build and test the backend:
mvn clean install - Start the backend api:
java -jar target/SuperPriceBackend-0.0.1-SNAPSHOT.jar - Access API with curl:
GET request to retrieve all products:
curl -X GET http://localhost:8080/api/booksGET request to retrieve a product by ID (replace 1 with the actual ID):
curl -X GET http://localhost:8080/api/books/1POST request to add a new product:
curl -X POST -H "Content-Type: application/json" -d '{"name": "New Book", "price": 123.45}' http://localhost:8080/api/booksPUT request to update a product (replace 1 with the actual ID):
curl -X PUT -H "Content-Type: application/json" -d '{"name": "Updated Book", "price": 100.50}' http://localhost:8080/api/books/1DELETE request to remove a product (replace 1 with the actual ID):
curl -X DELETE http://localhost:8080/api/books/1GET request to search products by name (replace "Book Name" with the actual name):
curl -X GET "http://localhost:8080/api/books/search/name?name=Book Name"GET request to search products by price range (replace 100 and 200 with actual values):
curl -X GET "http://localhost:8080/api/books/search/price?minPrice=100&maxPrice=200"- Setup MySQL
- Configure MySQL by running
sh mysql_config.sh - Build the backend:
mvn clean install - Start the backend:
java -jar target/SuperPriceBackend-0.0.1-SNAPSHOT.jar - Install Flask with pip:
python -m pip install flask requests - Start the front end:
cd frontend && python app.py - Go to
http://127.0.0.1:5000