0% found this document useful (0 votes)
7 views

IMS Project Simbu Bro

Uploaded by

Mohan Muddaliar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

IMS Project Simbu Bro

Uploaded by

Mohan Muddaliar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

INVENTORY MANAGEMENT SYSTEM

A Project Report
Submitted to Tamil Nadu Open University, Chennai
In partial fulfilment for
The award of the degree

BACHELOR OF COMPUTER APPLICATIONS

Submitted By
SILAMBARASAN B
Enrolment Number: 221117200230

Under the guidance of


Dr. R. Kalaiarasi, MCA, Ph.D.,
Assistant professor

School of Computer Science


TAMIL NADU OPEN UNIVERSITY
577, Anna Salai, Saidapet,
Chennai 600 015.
June 2024
CERTIFICATE

This is to certify that the Project titled INVENTORY MANAGEMENT SYSTEM

is an original work of Mr. SILAMBARASAN B and is being submitted in partial fulfilment

for the award of the Degree in Computer Applications/ Computer Science of Tamil Nadu Open

University, Chennai 600015. This report or part of this report has not been submitted earlier either to

this University or to any other University / Institution for the fulfilment of the requirement of a

course of study or published / presented for any other purpose.

Signature of the Student Signature of Guide with Seal

Place:

Date:
DECLARATION

I SILAMBARASAN B a Bonafede student at BCA Tamil Nadu Open University,

Chennai would like to declare that the dissertation entitled INVENTORY MANAGEMENT

SYSTEM submitted by me in partial fulfillment of the requirements for the award of the Degree

of BACHELOR OF COMPUTER APPLICATIONS is my original work.

Place:

Date: Signature of the candidate.


INVENTORY MANAGEMENT SYSTEM (IMS)

1. PROJECT DESCRIPTION
The Inventory Management System (IMS) is developed to
assist businesses in managing their inventory effectively and
efficiently. The primary functions of this system include
tracking inventory levels, processing orders, managing sales
and purchases, and generating insightful reports. This
desktop application is designed to provide a user-friendly
interface for users to interact with various functionalities,
ensuring smooth operations in managing stock and
improving overall business productivity.

2. REQUIREMENT SPECIFICATION
Functional Requirements
1. User Management
User Login
• The system shall allow users to log in with a username
and password.
• The system shall authenticate users against stored
credentials.
User Roles
• The system shall support different user roles (e.g.,
Admin, Manager, Staff).
• The system shall restrict access to certain functionalities
based on user roles.

2. Inventory Management
Add Inventory Item
• The system shall allow users to add new inventory items
with details such as name, category, quantity, supplier,
and price.
Update Inventory Item
• The system shall allow users to update details of existing
inventory items.
Delete Inventory Item
• The system shall allow users to delete inventory items.
View Inventory Items
• The system shall display a list of all inventory items with
details.
3. Stock Management
Track Stock Levels
• The system shall track the stock levels of each inventory
item.
• The system shall notify users when stock levels fall
below a predefined threshold.

4. Order Management
Process Orders
• The system shall allow users to create, update, and
delete orders.
• The system shall update inventory stock levels when
orders are processed.
Order History
• The system shall maintain a history of all processed
orders.

5. Supplier Management
Add Supplier
• The system shall allow users to add new suppliers with
details such as name, contact information, and address.
Update Supplier
• The system shall allow users to update details of existing
suppliers.
Delete Supplier
• The system shall allow users to delete suppliers.
View Suppliers
• The system shall display a list of all suppliers with
details.

6. Customer Management
Add Customer
• The system shall allow users to add new customers with
details such as name, contact information, and address.
Update Customer
• The system shall allow users to update details of existing
customers.
Delete Customer
• The system shall allow users to delete customers.
View Customers
• The system shall display a list of all customers with
details.
7. Sales Management:
Record sales transactions.
Generate invoices and receipts.

8. Purchase Management:
Track purchases from suppliers.
Update inventory based on received goods.

9. Reporting
Generate Reports
• The system shall generate reports on inventory levels,
order history, and supplier details.

Export Reports
• The system shall allow users to export reports in various
formats (e.g., PDF, Excel).
Non-Functional Requirements:
1. Usability:
- User-friendly interface with intuitive navigation.
- Responsive design for different screen resolutions.

2. Performance:
- Fast data retrieval and processing.
- Handle concurrent users efficiently.

3. Security:
- Secure login with encrypted passwords.
- Data integrity and confidentiality.

4. Maintainability:
- Modular code structure for easy maintenance and
updates.
- Well-documented code and user manual.
3. ARCHITECTURAL DESIGN

1. System Architecture

The architecture of the inventory management system is


divided into several layers:

• Presentation Layer

• Business Logic Layer

• Data Access Layer

• Database Layer

2. Presentation Layer

This layer is responsible for the user interface (UI) and user
experience (UX). It can be a web-based interface or a desktop
application. For a web-based UI, you might use:

• HTML, CSS, and JavaScript for basic structure and


styling.

• JavaScript frameworks like Angular, React, or Vue.js for


dynamic and interactive UI components.
• JavaFX for a desktop application.

The presentation layer communicates with the business logic


layer through RESTful APIs.

3. Business Logic Layer

This layer contains the core functionality of the system. It


includes:

• Service Classes: These handle the business logic and are


implemented using Java classes.

• RESTful APIs: Implemented using frameworks like Spring


Boot, these APIs provide endpoints for the presentation
layer to interact with the system.

• Security: Implemented using Spring Security to handle


authentication and authorization.
4. Data Access Layer

This layer handles interactions with the database. It includes:

• Repositories: Interfaces that extend JpaRepository or


CrudRepository in Spring Data JPA.

• Data Transfer Objects (DTOs): These are used to


transfer data between different layers of the
application.

5. Database Layer

This layer consists of the actual database where all inventory


data is stored. You can use:

• Relational Database Management System (RDBMS):


Such as MySQL or PostgreSQL.

• Schema Design: Tables for products, categories,


suppliers, customers, orders, and transactions.
6. Detailed Component Design

6.1 Presentation Layer

• Login Page: For user authentication.

• Dashboard: Displays a summary of inventory status.

• Product Management: Add, update, delete, and view


product details.

• Order Management: Create, process, and track orders.

• Reports: Generate various reports like stock levels,


sales, and purchase orders.

6.2 Business Logic Layer

• ProductService: Manages product-related operations.

• OrderService: Handles order processing and


management.

• InventoryService: Keeps track of stock levels and


inventory movements.

• UserService: Manages user authentication and


authorization.
6.3 Data Access Layer

• ProductRepository: Interface for CRUD operations on


products.

• OrderRepository: Interface for CRUD operations on


orders.

• InventoryRepository: Interface for CRUD operations on


inventory data.

• UserRepository: Interface for CRUD operations on user


data.

6.4 Database Layer

• Products Table: Stores product information.

• Categories Table: Stores product categories.

• Suppliers Table: Stores supplier information.

• Customers Table: Stores customer information.

• Orders Table: Stores order information.

• Transactions Table: Stores inventory transactions.


4. PROGRAM DESIGN

Class Diagram:

+--------------------+ +--------------------+ +--------------------+

| InventoryManager | | DatabaseManager | | ReportGenerator


|

+--------------------+ +--------------------+ +--------------------+

| - items: List<Item>| | - connection: Conn | | - reports: List<Re>|

+--------------------+ +--------------------+ +--------------------+

| + addItem(Item): void | + authenticateUser | | + generateReport |

| + updateItem(Item): void | + addItem(Item): voi| | + exportReport


|

| + deleteItem(int): void | + getItem(int): Item| +--------------------+

| + getItem(int): Item | + updateItem(Item): v|

| + getAllItems(): List<Itm| + deleteItem(int): |

+--------------------------+ + getAllItems(): List<I

+--------------------+
Key Classes:

1. InventoryManagementSystem: The main class to initialize


and start the application.

2. LoginForm: Handles user authentication.

3. Dashboard: Main interface after login, providing access to


different modules.

4. InventoryManager: Manages inventory operations.

5. DatabaseManager: Manages database connections and


CRUD operations.

6. ReportGenerator: Generates various reports.


Main Class: InventoryManagementSystem

public class InventoryManagementSystem {


public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
new LoginForm().setVisible(true);
});
}
}

LoginForm Class

import javax.swing.;
import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class LoginForm extends JFrame {

private JTextField usernameField;


private JPasswordField passwordField;

private JButton loginButton;

public LoginForm() {

setTitle("Inventory Management System - Login");

setSize(300, 150);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLocationRelativeTo(null);

JPanel panel = new JPanel();

add(panel);

placeComponents(panel);

loginButton.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

authenticateUser();
}
});
}

private void placeComponents(JPanel panel) {

panel.setLayout(null);

JLabel userLabel = new JLabel("Username:");

userLabel.setBounds(10, 10, 80, 25);

panel.add(userLabel);

usernameField = new JTextField(20);

usernameField.setBounds(100, 10, 160, 25);

panel.add(usernameField);

JLabel passwordLabel = new JLabel("Password:");

passwordLabel.setBounds(10, 40, 80, 25);

panel.add(passwordLabel);
passwordField = new JPasswordField(20);

passwordField.setBounds(100, 40, 160, 25);

panel.add(passwordField);

loginButton = new JButton("Login");

loginButton.setBounds(10, 80, 250, 25);

panel.add(loginButton);

private void authenticateUser() {

String username = usernameField.getText();

String password = new


String(passwordField.getPassword());

if (DatabaseManager.authenticate(username,
password)) {

new Dashboard().setVisible(true);
this.dispose();

} else {

JOptionPane.showMessageDialog(this, "Invalid
credentials!");

DatabaseManager Class

import java.sql.;

public class DatabaseManager {


private static final String DB_URL =
"jdbc:mysql://localhost:3306/inventory_db";

private static final String DB_USER = "root";

private static final String DB_PASSWORD = "password";

public static Connection getConnection() throws


SQLException {

return DriverManager.getConnection(DB_URL, DB_USER,


DB_PASSWORD);

public static boolean authenticate(String username, String


password) {

try (Connection connection = getConnection();

PreparedStatement ps =
connection.prepareStatement("SELECT FROM users WHERE
username = ? AND password = ?")) {

ps.setString(1, username);
ps.setString(2, password);

try (ResultSet rs = ps.executeQuery()) {

return rs.next();

} catch (SQLException e) {

e.printStackTrace();

return false;

public static void addItem(Item item) {

try (Connection connection = getConnection();

PreparedStatement ps =
connection.prepareStatement("INSERT INTO items (name,
quantity, price) VALUES (?, ?, ?)")) {

ps.setString(1, item.getName());

ps.setInt(2, item.getQuantity());
ps.setDouble(3, item.getPrice());

ps.executeUpdate();

} catch (SQLException e) {

e.printStackTrace();

public static void updateItem(Item item) {

try (Connection connection = getConnection();

PreparedStatement ps =
connection.prepareStatement("UPDATE items SET name = ?,
quantity = ?, price = ? WHERE id = ?")) {

ps.setString(1, item.getName());

ps.setInt(2, item.getQuantity());

ps.setDouble(3, item.getPrice());

ps.setInt(4, item.getId());
ps.executeUpdate();

} catch (SQLException e) {

e.printStackTrace();

public static void deleteItem(int id) {

try (Connection connection = getConnection();

PreparedStatement ps =
connection.prepareStatement("DELETE FROM items WHERE
id = ?")) {

ps.setInt(1, id);

ps.executeUpdate();

} catch (SQLException e) {

e.printStackTrace();

}
public static Item getItem(int id) {

try (Connection connection = getConnection();

PreparedStatement ps =
connection.prepareStatement("SELECT FROM items WHERE
id = ?")) {

ps.setInt(1, id);

try (ResultSet rs = ps.executeQuery()) {

if (rs.next()) {

return new Item(rs.getInt("id"),


rs.getString("name"), rs.getInt("quantity"),
rs.getDouble("price"));

} catch (SQLException e) {

e.printStackTrace();

return null;
}

public static List<Item> getAllItems() {

List<Item> items = new ArrayList<>();

try (Connection connection = getConnection();

Statement stmt = connection.createStatement();

ResultSet rs = stmt.executeQuery("SELECT FROM


items")) {

while (rs.next()) {

items.add(new Item(rs.getInt("id"),
rs.getString("name"), rs.getInt("quantity"),
rs.getDouble("price")));

} catch (SQLException e) {

e.printStackTrace();

return items;

}
}

Item Class

public class Item {

private int id;

private String name;

private int quantity;

private double price;

public Item(int id, String name, int quantity, double price) {

this.id = id;

this.name = name;

this.quantity = quantity;

this.price = price;

public int getId() {


return id;
}

public String getName() {


return name;
}

public int getQuantity() {


return quantity;
}

public double getPrice() {


return price;
}

public void setId(int id) {


this.id = id;
}

public void setName(String name) {


this.name = name;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}

public void setPrice(double price) {


this.price = price;
}
}

Dashboard Class

import javax.swing.;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class Dashboard extends JFrame {

private JMenuBar menuBar;

private JMenu inventoryMenu;


private JMenuItem addItemMenuItem,
viewItemsMenuItem;

public Dashboard() {

setTitle("Inventory Management System - Dashboard");

setSize(800, 600);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLocationRelativeTo(null);

menuBar = new JMenuBar();

inventoryMenu = new JMenu("Inventory");

addItemMenuItem = new JMenuItem("Add Item");

viewItemsMenuItem = new JMenuItem("View Items");

inventoryMenu.add(addItemMenuItem);

inventoryMenu.add(viewItemsMenuItem);
menuBar.add(inventoryMenu);

setJMenuBar(menuBar);

addItemMenuItem.addActionListener(new
ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

new AddItemForm().setVisible(true);

});

viewItemsMenuItem.addActionListener(new
ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

new ViewItemsForm().setVisible(true);

}
});

AddItemForm Class

import javax.swing.;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class AddItemForm extends JFrame {

private JTextField nameField;

private JTextField quantityField;

private JTextField priceField;

private JButton addButton;

public AddItemForm() {
setTitle("Add New Item");

setSize(300, 200);

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

setLocationRelativeTo(null);

JPanel panel = new JPanel();

add(panel);

placeComponents(panel);

addButton.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

addItem();

});

}
private void placeComponents(JPanel panel) {

panel.setLayout(null);

JLabel nameLabel = new JLabel("Name:");

nameLabel.setBounds(10, 10, 80, 25);

panel.add(nameLabel);

nameField = new JTextField(20);

nameField.setBounds(100, 10, 160, 25);

panel.add(nameField);

JLabel quantityLabel = new JLabel("Quantity:");

quantityLabel.setBounds(10, 40, 80, 25);

panel.add(quantityLabel);

quantityField = new JTextField(20);

quantityField.setBounds(100, 40, 160, 25);


panel.add(quantityField);

JLabel priceLabel = new JLabel("Price:");

priceLabel.setBounds(10, 70, 80, 25);

panel.add(priceLabel);

priceField = new JTextField(20);

priceField.setBounds(100, 70, 160, 25);

panel.add(priceField);

addButton = new JButton("Add");

addButton.setBounds(10, 110, 250, 25);

panel.add(addButton);

private void addItem() {

String name = nameField.getText();


int quantity = Integer.parseInt(quantityField.getText());

double price = Double.parseDouble(priceField.getText());

Item item = new Item(0, name, quantity, price);

DatabaseManager.addItem(item);

JOptionPane.showMessageDialog(this, "Item added


successfully!");

this.dispose();

ViewItemsForm Class

import javax.swing.;

import javax.swing.table.DefaultTableModel;

import java.util.List;
public class ViewItemsForm extends JFrame {

private JTable itemsTable;

public ViewItemsForm() {

setTitle("View Items");

setSize(500, 400);

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

setLocationRelativeTo(null);

String[] columnNames = {"ID", "Name", "Quantity",


"Price"};

DefaultTableModel tableModel = new


DefaultTableModel(columnNames, 0);

itemsTable = new JTable(tableModel);

List<Item> items = DatabaseManager.getAllItems();

for (Item item : items) {


Object[] rowData = {item.getId(), item.getName(),
item.getQuantity(), item.getPrice()};

tableModel.addRow(rowData);

JScrollPane scrollPane = new JScrollPane(itemsTable);

add(scrollPane);

}
5. Testing Procedures

Unit Testing

Unit testing will be conducted using JUnit to test individual


methods and classes. Sample unit test for
`DatabaseManager` class:

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.;

public class DatabaseManagerTest {

@Test

public void testAddItem() {

Item item = new Item(0, "Test Item", 10, 99.99);

DatabaseManager.addItem(item);
Item retrievedItem =
DatabaseManager.getItem(item.getId());

assertEquals("Test Item", retrievedItem.getName());

assertEquals(10, retrievedItem.getQuantity());

assertEquals(99.99, retrievedItem.getPrice(), 0.01);

@Test

public void testUpdateItem() {

Item item = new Item(0, "Test Item", 10, 99.99);

DatabaseManager.addItem(item);

item.setName("Updated Item");

DatabaseManager.updateItem(item);

Item retrievedItem =
DatabaseManager.getItem(item.getId());

assertEquals("Updated Item", retrievedItem.getName());


}

@Test

public void testDeleteItem() {

Item item = new Item(0, "Test Item", 10, 99.99);

DatabaseManager.addItem(item);

DatabaseManager.deleteItem(item.getId());

Item retrievedItem =
DatabaseManager.getItem(item.getId());

assertNull(retrievedItem);

}
Integration Testing

Integration testing will ensure that different modules work


together seamlessly. This includes testing interactions
between the GUI components and the database operations.

System Testing

System testing will involve end-to-end testing of the entire


application to verify all requirements are met. Test cases will
cover all functional requirements, including user
authentication, inventory management, sales and purchase
tracking, and report generation.
OUTPUT:

The expected output of the system includes a fully functional


inventory management application with the following
features:

1. User Authentication
When the user runs the application, the login form
appears. The user enters their credentials and logs in.

Inventory Management System - Login


------------------------------------
Username: admin
Password:

Login successful!

2. Adding a New Item


After logging in, the user is taken to the dashboard.
From here, they can choose to add a new item to the
inventory.

Inventory Management System - Dashboard


----------------------------------------
1. Add Item
2. View Items
3. Generate Report
4. Logout

Choose an option: 1

Add New Item


-------------
Name: Widget A
Quantity: 50
Price: 19.99

Item added successfully!

3. Viewing Items
Next, the user decides to view all items in the inventory.

Inventory Management System - Dashboard


----------------------------------------
1. Add Item
2. View Items
3. Generate Report
4. Logout

Choose an option: 2

View Items
----------
ID | Name | Quantity | Price
-----------------------------------
1 | Widget A | 50 | Rs.19.99

4. Generating a Report
The user then generates a report to see the current
inventory status.

Inventory Management System - Dashboard


----------------------------------------
1. Add Item
2. View Items
3. Generate Report
4. Logout

Choose an option: 3

Generating Report...
---------------------
Inventory Report
-----------------
ID | Name | Quantity | Price
-----------------------------------
1 | Widget A | 50 | $19.99

Report generated successfully!

5. Logging Out
Finally, the user logs out of the system.

Inventory Management System - Dashboard


----------------------------------------
1. Add Item
2. View Items
3. Generate Report
4. Logout
Choose an option: 4
Logout successful! Goodbye.
6. CONCLUSION

The Inventory Management System (IMS) developed in Java


provides an efficient solution for businesses to manage their
inventory. The structured development approach ensures a
robust and maintainable application. The system's modular
architecture allows for easy updates and enhancements.
Future enhancements may include support for barcode
scanning, integration with e-commerce platforms, and
development of a mobile version. Overall, the IMS
significantly improves inventory control and operational
efficiency for businesses, helping them make data-driven
decisions and streamline their operations.
7. REFERENCES

1. Java Language and Programming


- Oracle Java Documentation:
https://docs.oracle.com/javase/8/docs/
- Java Tutorials by Oracle:
https://docs.oracle.com/javase/tutorial/
- "Java: The Complete Reference" by Herbert Schildt

2. Java Swing for GUI Development


- Oracle Swing Documentation:
https://docs.oracle.com/javase/8/docs/technotes/guides/swi
ng/
- Java Swing Tutorial: https://www.javatpoint.com/java-
swing
- "Swing: A Beginner's Guide" by Herbert Schildt

3. JDBC for Database Connectivity


- Oracle JDBC Documentation:
https://docs.oracle.com/javase/8/docs/technotes/guides/jdb
c/
- JDBC Tutorial: https://www.tutorialspoint.com/jdbc/
- "JDBC API Tutorial and Reference" by Maydene Fisher, Jon
Ellis, and Jonathan Bruce

4. Database Design and SQL


- "Database System Concepts" by Abraham Silberschatz,
Henry F. Korth, and S. Sudarshan
- "SQL for Dummies" by Allen G. Taylor
- MySQL Documentation: https://dev.mysql.com/doc/

5. Software Design and Architecture


- "Design Patterns: Elements of Reusable Object-Oriented
Software" by Erich Gamma, Richard Helm, Ralph Johnson,
and John Vlissides
- "Clean Architecture: A Craftsman's Guide to Software
Structure and Design" by Robert C. Martin
- "Patterns of Enterprise Application Architecture" by
Martin Fowler

6. Unit Testing and Test-Driven Development


- "Test-Driven Development: By Example" by Kent Beck
- JUnit Documentation:
https://junit.org/junit5/docs/current/user-guide/
- "Pragmatic Unit Testing in Java 8 with JUnit" by Jeff Langr
7. Best Practices and Guidelines
- "Effective Java" by Joshua Bloch
- "Java Concurrency in Practice" by Brian Goetz
- Oracle's Code Conventions for the Java Programming
Language:
https://www.oracle.com/java/technologies/javase/codeconv
entions-contents.html

8. Online Courses and Tutorials


- Coursera: Java Programming and Software Engineering
Fundamentals Specialization by Duke University
- Udemy: "Java Programming Masterclass for Software
Developers" by Tim Buchalka
- Pluralsight: "Java Fundamentals: The Java Language" by
Jim Wilson

9. Code Examples and Open Source Projects


- GitHub: Explore open-source projects related to inventory
management systems and Java applications
(https://github.com/)
- Stack Overflow: Community-driven Q&A for coding
problems and solutions (https://stackoverflow.com/)

10. Inventory Management Systems


- "Inventory Management Explained: A focus on
forecasting, lot sizing, safety stock, and ordering systems" by
David J. Piasecki
- "Essentials of Inventory Management" by Max Muller
- Research papers and case studies on inventory
management systems (available through academic databases
like IEEE Xplore, Google Scholar, etc.)

These references provide a broad range of resources to


support the development of an Inventory Management
System in Java, from language fundamentals and GUI
development to database connectivity and best practices in
software design.

You might also like