The SmartCart Project is a Java-based application designed to optimize shopping by determining the supermarket with the lowest total price for a selected list of products. The application utilizes SQLite for data storage and integrates essential functionality for database handling and optimization.
To compile the project:
- Ensure Maven is installed on your system.
- Run the following command in the root directory of the project:
mvn clean package
There might occur a test failure in the first compilation, because the database can't get recognised as it's being built while compiling. It gets fixed if you try to compile the program again.
- Ensure that you have compiled the program.
- Run the following command in the root directory of the project, where
pom.xml
is located:mvn exec:java
- Check the boxes of the products you are interested in (please select at least 2).
- Scroll down to the bottom of the page and select your desired location from the dropdown menu.
- Press the button Find Best Supermarket.
- The result page will appear to inform you for your selected produts and location, what is the best supermarket and the district where it's located in, and your total price.
- Press close to terminate the program.
project-root/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/smartcart/
│ │ │ ├── SQLFileExecutor.java
│ │ │ ├── OptimizationEngine.java
│ │ │ ├── SmartCartUI.java
│ │ │ └── ResultPage.java
│ │ └── resources/
│ │ ├── SmartCartDB.sql
│ │ ├── ClearDatabase.sql
│ │ ├── fonts/
│ │ │ └── Lobster-Regular.ttf
│ │ └── images/
│ │ └── supermarket.jpg
│ ├── test/
│ ├── java/
│ │ └── com/smartcart/
│ │ ├── SQLFileExecutorTest.java
│ │ ├── OptimizationEngineTest.java
│ │ └── ResultPageTest.java
├── pom.xml
├── README.md
├── SmartCart.sql
├── UML_diagram.png
├── LICENSE.txt
- SQLite database for storing product, supermarket, and pricing data.
- Java
Lists
for handling user inputs (product lists).
- SQL query for calculating the total price for selected products at each supermarket.
- Dynamic SQL placeholders for secure and efficient input handling.
- Robust error handling for missing data (selection of less than 2 products).
Georgios Symeon Dionysopoulos, Karakatsanis Emmanouil, Katsoulis Dimitrios, Mpelogiannis Vasileios, Mpinatsis Marios, Sotiropoulos Evangelos, Tsagkaropoulou Aspasia
Pull requests are welcome. Please make sure to update tests as appropriate.
This project is licensed under the MIT License - click here for details.