The goal of this project is to create a streamlined and user-friendly Inventory Management System (IMS) to assist businesses in efficiently managing their inventory, tracking stock levels, and optimizing inventory-related processes. The scope encompasses functionalities such as adding, updating, and removing products, as well as search Inventory.
- Run the application
- Open your browser and enter http://localhost:8080
- Enter Username & Password (See them from Below)
There are two types of users in this system: Admin and User.
- Username: admin
- Password: admin
Admin has full access to all features including adding, updating, deleting, and viewing products.
- Username: user
- Password: user
User has limited access and can only view and search the products in the inventory.
-
Add Inventory:
- Admin can add new products to the inventory, specifying details like product name, category, quantity, and unit price.
-
Update Inventory:
- Capability to modify inventory details, such as quantity, price, or category.
-
Remove Inventory:
- Admin can remove products that are no longer part of the inventory.
-
View Inventory:
- Display a comprehensive list of all products in the inventory, including their details.
-
Search Inventory:
- Users can search for inventories by case-insensitive name.
-
View Inventory:
- Display a comprehensive list of all products in the inventory, including their details.
The basic login screen is as below:
Dashboard Page
View Inventory
Add Inventory
Update Inventory
Remove Inventory
Dashboard Page
View Inventory
Seach Inventory
The program is essentially categorized into two user roles: Admin and User.
The invoked functionality depends on the user logging into the system.
- View Inventory
- Add Inventory
- Remove Inventory
- Update Inventory
- View Inventory
- Search Inventory
- Filter Chain
- CustomAuthenticationSuccessHandler (Role-Based Redirect)
- User Details Service (Create two default users username and password)
- Password Encoder
The basic classes needed for application are
- InventoryController Class:
- Description: Controller class for handling inventory-related requests
- Attributes: inventoryService
- Methods: viewInventory(), showAddProductForm(), addInventory(), showRemoveInventoryForm(), removeInventory(), showUpdateInventoryForm(), updateInventory(), showSearchInventoryForm(), searchInventory()
- Inventory Class:
- Description: Model class for the inventory table
- Attributes: id, name, category, quantity, price
- Methods: Constructors, Getters and setters
- InventoryService Class:
- Description: Service class for handling inventory-related requests
- Attributes: inventoryRepository
- Methods: addInventory(), getAllInventories(), removeInventory(), updateInventory(), getInventoryById(), searchInventory()
- InventoryRepository Interface:
- Description: Repository interface for the inventory table
- Methods: findByNameContainingIgnoreCase()
- InventoryNotFoundException Class:
- Description: Exception thrown when an inventory is not found
- Attributes: None
- Methods: InventoryNotFoundException()
- LoginController Class:
- Description: Controller class for handling login-related requests
- Attributes: None
- Methods: login(), adminDashboard(), userDashboard()
- SecurityConfiguration Class
- Description: Configuration class for security-related beans
- Attributes: passwordEncoder
- Methods: filterChain(), userDetailsService(), passwordEncoder()
- CustomAuthenticationSuccessHandler Class
- Description: Redirects the user to the appropriate dashboard based on their role
- Attributes: redirectStrategy
- Methods: onAuthenticationSuccess()
-
Backend:
- Language: Java.
- Framework: Spring Boot, Spring Security
-
Frontend:
- UI: HTML generated by Thymeleaf
-
Database:
- H2 database for storing inventory data.
The backend will handle the logic for adding, updating, and removing products. The frontend will provide an intuitive interface for users to interact with the inventory management system.