Skip to content

shehanD2004/StockManagementSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Stock Management System

A scalable and maintainable Stock Management System built using Spring Boot with RESTful API architecture to manage inventory lifecycle operations including product creation, updates, filtering, retrieval, and deletion.

The project follows a clean layered architecture and demonstrates enterprise-grade backend development practices using Java and Spring Boot.


πŸš€ Project Status

Status Backend Language Frontend


πŸ“‘ Table of Contents


πŸ“– Project Overview

The Stock Management System is a RESTful web application designed to manage stock and inventory operations efficiently.

The application supports:

  • Product inventory management
  • CRUD operations for stock lifecycle
  • Product filtering and retrieval
  • REST API communication
  • Layered backend architecture
  • API testing and validation

The system was developed using Spring Boot following industry-standard backend development practices for scalability and maintainability.


✨ Key Features

πŸ“¦ Inventory Management

  • Create stock items
  • Update inventory records
  • Delete stock entries
  • Retrieve product details
  • Manage stock lifecycle operations

πŸ” Filtering & Search

  • Product filtering APIs
  • Search-based inventory retrieval
  • Category and stock-based querying

πŸ— Backend Architecture

  • Layered architecture implementation
  • Controller-Service-Repository pattern
  • Separation of concerns
  • Scalable backend structure

🌐 RESTful API Development

  • REST-compliant endpoint design
  • JSON request/response handling
  • HTTP status code management
  • Exception handling mechanisms

πŸ§ͺ API Testing

  • Postman API testing
  • Edge-case validation
  • Response verification
  • Error response testing

πŸ›  Technology Stack

Technology Purpose
Java Core Programming Language
Spring Boot Backend Framework
Spring Web REST API Development
HTML Frontend Structure
CSS Styling
JavaScript Frontend Interactivity
Postman API Testing

πŸ— System Architecture

Client (HTML/CSS/JS)
        β”‚
        β–Ό
REST API Layer (Spring Boot Controllers)
        β”‚
        β–Ό
Service Layer (Business Logic)
        β”‚
        β–Ό
Repository Layer (Data Access)
        β”‚
        β–Ό
Database

πŸ“‚ Project Structure

stock-management-system/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   └── com/example/stockmanagement/
β”‚   β”‚   β”‚       β”œβ”€β”€ controller/
β”‚   β”‚   β”‚       β”œβ”€β”€ service/
β”‚   β”‚   β”‚       β”œβ”€β”€ repository/
β”‚   β”‚   β”‚       β”œβ”€β”€ model/
β”‚   β”‚   β”‚       └── StockManagementApplication.java
β”‚   β”‚   β”‚
β”‚   β”‚   └── resources/
β”‚   β”‚       └── application.properties
β”‚   β”‚
β”‚   └── test/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ style.css
β”‚   └── script.js
β”‚
β”œβ”€β”€ pom.xml
└── README.md

πŸ”Œ API Endpoints

Base URL

http://localhost:8080/api

Stock Endpoints

Method Endpoint Description
GET /stocks Retrieve all stock items
GET /stocks/{id} Retrieve stock item by ID
POST /stocks Create new stock item
PUT /stocks/{id} Update stock item
DELETE /stocks/{id} Delete stock item

Example Request

Create Stock Item

POST /api/stocks
{
  "productName": "Wireless Mouse",
  "category": "Electronics",
  "quantity": 50,
  "price": 25.99
}

Example Response

{
  "id": 1,
  "productName": "Wireless Mouse",
  "category": "Electronics",
  "quantity": 50,
  "price": 25.99
}

βš™οΈ Installation & Setup

Prerequisites

Ensure the following are installed:

  • Java JDK 17+
  • Maven
  • IDE (IntelliJ IDEA / VS Code / Eclipse)
  • Postman

▢️ Running the Application

Clone Repository

git clone https://github.com/your-username/stock-management-system.git
cd stock-management-system

Run Backend Server

mvn spring-boot:run

Application will start on:

http://localhost:8080

Build Project

mvn clean install

πŸ§ͺ API Testing

The APIs were tested using Postman to validate:

  • CRUD functionality
  • HTTP response codes
  • Error handling
  • Invalid request scenarios
  • Edge cases

Example HTTP Status Codes

Status Code Meaning
200 Success
201 Resource Created
400 Bad Request
404 Resource Not Found
500 Internal Server Error

⚠️ Error Handling

The application includes structured exception handling for:

  • Invalid input data
  • Missing resources
  • Server-side failures
  • Invalid API requests

Example:

{
  "timestamp": "2026-05-12T10:30:00",
  "status": 404,
  "error": "Not Found",
  "message": "Stock item not found"
}

⚑ Performance & Scalability

Scalability Features

  • Layered architecture design
  • Modular service structure
  • Separation of business logic
  • Maintainable code organization

Performance Practices

  • Efficient API routing
  • Structured request handling
  • Reusable service methods
  • Lightweight REST communication

πŸ”’ Security Considerations

Recommended production enhancements:

  • JWT Authentication
  • Role-Based Access Control (RBAC)
  • Input validation & sanitization
  • HTTPS enforcement
  • Environment-based configurations

πŸ“Š Project Highlights

βœ… RESTful API Development βœ… Spring Boot Backend Architecture βœ… CRUD Operations βœ… Layered Architecture βœ… API Testing with Postman βœ… Error Handling & Validation βœ… Maintainable & Scalable Design


πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Developed as a backend-focused inventory and stock lifecycle management system using Spring Boot and RESTful architecture principles.


⭐ Final Notes

This project demonstrates:

  • Enterprise-level backend structuring
  • REST API engineering best practices
  • Scalable Spring Boot architecture
  • Maintainable Java application design
  • Professional API testing workflows

About

Web Based Stock Management System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors