DO
DorkArn02/Inventory_management_system
Inventory management system project assignment
Inventory management system
About this program
This is an inventory management system written in Spring Boot framework.
You can find a more detailed documentation of this program in the wiki of this repository.
Database layout in MySQL Workbench
API endpoints
Swagger REST API docs:
http://localhost:8080/swagger-ui/index.html#/
Postman file used for testing:
product-controller
- GET all products
:8080/api/products - GET product
:8080/api/products/{productId} - GET product thumbnail
:8080/api/products/thumbnail/{productId} - POST, add new product
:8080/api/products/ - POST, add new thumbnail to product
:8080/api/products/thumbnail/{productId} - PUT, update product details:
:8080/api/products/{productId} - DELETE product:
:8080/api/products/{productId} - PUT, Add category to product
:8080/api/products/{productId}/{categoryId} - DELETE category to product
:8080/api/products/{productId}/{categoryId}
order-controller
- GET all orders
:8080/api/orders - GET order
:8080/api/orders/{orderId} - POST, add new order
:8080/api/orders/ - DELETE order
:8080/api/orders/{orderId} - PUT, edit order status
:8080/api/orders/{orderId} - PUT, add new product to order
:8080/api/orders/{orderId}/{productId} - DELETE product from order
:8080/api/orders/{orderId}/{productId}
category-controller
- GET all categories
:8080/api/category - GET category
:8080/api/category/{categoryId} - POST, add new category
:8080/api/category - DELETE category
:8080/api/category/{categoryId} - PUT, edit category name
:8080/api/category/{categoryId}
storage-controller
- POST, add some product to the storage
:8080/api/storage/{productId} - DELETE, remove some product from storage
:8080/api/storage/{productId} - GET the content of storage
:8080/api/storage/
transaction-controller
- GET all transactions:
:8080/api/transaction - GET transaction by id:
:8080/api/transaction/{transactionId}
Models
- Product
- Category
- Order
- OrderedItems
- Transaction
Example POST requests:
Create new product
{
"name": "string",
"description": "string",
"price": 0
}Create new category
{
"name": "string"
}Create new order
{
"expectedDelivery": "2022-11-11T13:07:13.911Z"
}Thumbnail location
The default folder for thumbnails is set to C:\Users\YOURUSERNAME\Inventory_management_system\public
Go to the application.properties and edit image_location property to change
The thumbnails of the products will be saved in this folder.
Configure mysql database with XAMPP
- Go to phpmyadmin and create a new database
- Configure the following properties in
application.properties spring.datasource.username=YOUR MYSQL USERNAMEspring.datasource.password=YOUR MYSQL PASSWORDspring.datasource.url=jdbc:mysql://localhost:3306/YOUR DATABASE NAME- And you're done because JPA generates the db schema automatically
Configure with H2 in-memory database
- Configure the following properties in
application.properties spring.datasource.url=jdbc:h2:mem:YOURDBNAMEspring.datasource.driverClassName=org.h2.Driverspring.datasource.username=YOUR USERNAMEspring.datasource.password=YOUR PASSWORDspring.jpa.database-platform=org.hibernate.dialect.H2Dialect
How to deploy the application with maven
- maven clean -f pom.xml
- maven package -f pom.xml
.jarfile will be generated in the target directory
How to start the Spring Boot backend:
- Start the database server
- Make a
start.batfile with this linejava -jar <JARNAME.jar> - Logs will be generated in the subdirectory
logs
