Java Inventory Management System

Created by Glabay | Added on Jun 16, 2026
0 reviews

Overview

The goal of this project is to build a command-line inventory management application using Java 25.

You will practice designing classes, organizing code, working with files, handling user input, managing application state, and applying object-oriented programming principles.

The application will simulate a small inventory system with:

  • User authentication
  • Role-based permissions
  • Inventory management
  • Category management
  • JSON file persistence

The application should run entirely from the command line.


Technical Requirements

Required Technologies

  • Java 25
  • Maven or Gradle
  • Jackson ObjectMapper
  • JSON file persistence

Additional libraries may be used when appropriate.


Learning Objectives

By completing this project, you should practice:

Object-Oriented Programming

  • Creating classes and objects
  • Encapsulation
  • Composition
  • Separation of responsibilities
  • Designing maintainable code

Enums

Use Java Enums to represent application constants.

Example:

public enum Role {
    OWNER,
    MANAGER,
    EMPLOYEE
}

Roles should determine what actions a user is allowed to perform.


JSON Serialization

Use Jackson ObjectMapper to store and retrieve application data.

You should practice:

  • Java Object → JSON
  • JSON → Java Object
  • Reading files
  • Writing files

User Input

The application should:

  • Display menus
  • Accept user input
  • Validate input
  • Handle invalid choices safely

Security

Passwords should never be stored as plain text.

Users must:

  • Create an account with a password
  • Have their password securely hashed
  • Validate login attempts against the stored password hash

Suggested libraries:

  • BCrypt
  • Argon2

Application Requirements

User System

Users should be stored in:

users.json

The file should contain an array of users. The first account created should be made Owner

Example:

[
  {
    "id": 1,
    "username": "admin",
    "passwordHash": "$2a$10$...",
    "role": "OWNER"
  }
]

Users should have:

  • Unique ID
  • Username
  • Password hash
  • Role

Roles:

________________________________________________________
|       Role	|     Permissions			|
|---------------|---------------------------------------|
|  OWNER	|      Full access			|
|  MANAGER 	|  Manage inventory and categories	|
|  EMPLOYEE	|  View inventory and update stock 	|
--------------------------------------------------------|

Authentication

When starting the application:

Users should be presented with:

1. Login
2. Exit

Login should:

  1. Ask for username
  2. Ask for password
  3. Find the user
  4. Validate the password
  5. Load the application with the user's permissions

Invalid credentials should be handled gracefully.


Category Management

Categories must exist before items can be created.

Categories are stored in:

categories.json

Example:

[
  {
    "id": 1,
    "name": "Weapons"
  },
  {
    "id": 2,
    "name": "Armor"
  }
]

Users with permission should be able to:

  • Create categories
  • View categories

Inventory Management

Items should be stored in:

items.json

The file should contain an array of items.

Example:

[
  {
    "id": 1,
    "name": "Iron Sword",
    "categoryId": 1,
    "quantity": 25
  }
]

Items should contain:

  • ID
  • Name
  • Category reference
  • Quantity

Required Features

Owner Features

The Owner can:

  • Login
  • View inventory
  • Add categories
  • Add items
  • Edit items
  • Remove items
  • Manage users

Manager Features

Managers can:

  • Login
  • View inventory
  • Add categories
  • Add items
  • Edit items
  • Remove items
  • Update stock

Managers cannot manage users.


Employee Features

Employees can:

  • Login
  • View inventory
  • Search inventory
  • Update stock quantities

Employees cannot:

  • Create categories
  • Create items
  • Manage users

Suggested Project Structure

Your project should avoid placing all logic inside Main.java.

A suggested structure:

src
 └── main
     └── java
         └── inventory

             ├── Main.java

             ├── model
             │   ├── User.java
             │   ├── Item.java
             │   ├── Category.java
             │   └── Role.java

             ├── service
             │   ├── AuthenticationService.java
             │   ├── InventoryService.java
             │   └── UserService.java

             ├── repository
             │   ├── UserRepository.java
             │   ├── ItemRepository.java
             │   └── CategoryRepository.java

             └── util
                 └── JsonManager.java

This structure is not required, but your application should have clear separation between:

  • Models
  • Business logic
  • Data storage
  • User interface

Bonus Challenges

Bonus 1 — Inventory Search

Add advanced searching.

Examples:

  • Search by item name
  • Search by category
  • Find items with low quantity

Consider using:

  • Streams
  • Filters
  • Predicates

Bonus 2 — Audit Logging

Create:

logs.json

Record important actions:

Example:

{
  "user": "bob",
  "action": "Added Item",
  "timestamp": "2026-06-15T14:30:00"
}

Track:

  • Logins
  • Item creation
  • Item updates
  • Category creation

Bonus 3 — Low Stock Notifications

Allow items to have a minimum quantity.

Example:

Iron Sword
Current Stock: 3

WARNING:
Stock is below minimum level.

Bonus 4 — Automated Tests

Create JUnit tests for:

  • Authentication
  • Permission checks
  • Inventory operations
  • JSON loading/saving

Bonus 5 — Inventory Reports

Generate a report:

Example:

Inventory Report

Total Categories: 5
Total Items: 120
Low Stock Items: 8

Export to:

report.txt