The Simple Inventory Tracker is a basic application built using Spring Boot that allows users to manage a small set of products. The system includes features such as adding and displaying products, searching for products by name, and displaying products that need restocking (quantity below a specified threshold).
Inventory.Application.mp4
- Add Products: Add new products to the inventory.
- Display Products: View the list of all products.
- Search Products: Search for products by name.
- Low Stock Alert: Display products that need restocking.
- Programming Language: Java
- Framework: Spring Boot
- Database: MySQL Database
- User Interface: Swagger-UI for API documentation and interaction
- Java 11 or higher
- Maven
-
Clone the repository:
git clone https://github.com/yourusername/simple-inventory-tracker.git cd simple-inventory-tracker
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
Access the application:
- Swagger UI:
http://localhost:8080/swagger-ui.html
- Swagger UI:
- URL:
/api/products
- Method:
POST
- Request Body:
{ "name": "Product Name", "quantity": 10 }
- Response: The added product
- URL:
/api/products
- Method:
GET
- Response: List of all products
- URL:
/api/products/search
- Method:
GET
- Parameters:
name
(string) - Response: The product with the given name
- URL:
/api/products/low-stock
- Method:
GET
- Parameters:
threshold
(integer) - Response: List of products with quantity below the threshold
The application uses an MySQL in-memory database. The configuration is specified in src/main/resources/application.properties
:
spring.datasource.url=jdbc:mysql://localhost:3306/avidb
spring.datasource.username=root
spring.datasource.password=Anynomous
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.hibernate.ddl-auto=update