Skip to content

The CRUD system with REST API manages product categories and products efficiently, with intuitive API endpoints for seamless integration. It includes pagination for smoother navigation through large datasets, enhancing performance and user experience.

Notifications You must be signed in to change notification settings

adityakalambe01/Product-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Product Management System

Tech Stack Used

Java   Spring   SpringBoot   Hibernate  

Tools Used

Intellij Idea Ultimate   Postman  


Running the Application

To run the application, locate the file ProductsApplication.java in the directory src/main/java/com/products and execute it.

  1. If you are using Eclipse IDE / Intellij Idea with Postman then follow this document.

  1. If you are using Intellij Idea + Restful Tool(Intellij Idea Plugin) then follow this readme.

CRUD Operations on Categories

  1. Add Category (POST)
    URL: http://localhost:8080/api/categories
    Body:

    {
        "categoryId": 0,
        "categoryName": "String",
        "categoryDescription": "String",
        "products": []
    }
  2. Update Category (PUT)
    URL: http://localhost:8080/api/categories/{id}
    Body:

    {
        "id": 0,
        "categoryId": 0,
        "categoryName": "String",
        "categoryDescription": "String",
        "products": []
    }
  3. Get All Categories (GET)
    a. URL: http://localhost:8080/api/categories
    Description: Using this you will get first 5 categories

    b. URL: http://localhost:8080/api/categories?page=pageNumber
    Description: Using this you will get 5 categories of page 0 and you can change page like http://localhost:8080/api/categories?page=1

    c. URL: http://localhost:8080/api/categories?page=pageNumber&size=pageSize
    Description: Using this you will get 5 categories of page 0 with default page size 5 and you can change page and size like http://localhost:8080/api/categories?page=1&size=10 and you will get page 1 and 10 categories will be displayed

  4. Get Category by Id (GET)
    URL: http://localhost:8080/api/categories/{id}
    Body:

    { 
       "id": 0 
    }
  5. Delete Category by Id (DELETE)
    a. URL: http://localhost:8080/api/categories/{id}
    Body:

    { 
        "id": 0 
    }

    Description: Deletes the category with the specified ID if the product table does not contain entries associated with this category. If products exist, the category will not be deleted.

    b. URL: http://localhost:8080/api/categories/{id}?force=true
    Body:

    { 
        "id": 0 
    }

    Description: Deletes the category with the specified ID along with associated products, regardless of whether products exist or not.


CRUD Operations on Products

  1. Add Default Products (GET)
    URL: http://localhost:8080/api/products/addDefault

  2. Add New Product (POST)
    URL: http://localhost:8080/api/products
    Body:

    {
        "id": 0,
        "name": "Product Name",
        "cost": 0.0,
        "category": {
            "categoryId": 0,
            "categoryName": "Category Name",
            "categoryDescription": "Category Description",
            "products": []
        }
    }

    or

    {
         "id": 0,
         "name": "Product Name",
         "cost": 1542.0,
         "category": {
              "categoryId": 1
         }
    }

    Note: category id is mandatory

  3. Get Product by Id (GET)
    URL: http://localhost:8080/api/products/{id}
    Body:

    { 
       "id": 0 
    }
  4. Get All Products (GET)
    a. URL: http://localhost:8080/api/products
    Description: Using this you will get first 5 products

    b. URL: http://localhost:8080/api/products?page=pageNumber
    Description: Using this you will get 5 products of page 0 and you can change page like http://localhost:8080/api/products?page=1

    c. URL: http://localhost:8080/api/categories?page=pageNumber&size=pageSize
    Description: Using this you will get 5 products of page 0 with default page size 5 and you can change page and size like http://localhost:8080/api/products?page=1&size=10 and you will get page 1 and 10 products will be displayed

  5. Delete Product by Id (DELETE)
    URL: http://localhost:8080/api/products/{id}
    Body:

    { 
       "id": 0 
    }
  6. Update Product by Id (PUT)
    URL: http://localhost:8080/api/products/{id}
    Body:

    {
        "id": 0,
        "name": "String",
        "cost": 0.0,
        "category": {
            "categoryId": 0,
            "categoryName": "String",
            "categoryDescription": "String",
            "products": []
        }
    }

This documentation provides a comprehensive overview of the endpoints and operations available in the Product Management System.


Below Links shows results of each request's send from postman/restfulTool

  1. Category Documentation
  2. Product Documentation

About

The CRUD system with REST API manages product categories and products efficiently, with intuitive API endpoints for seamless integration. It includes pagination for smoother navigation through large datasets, enhancing performance and user experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages