Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This project is a Product and Category Manager that helps you easily manage categories and products. It supports all the basic operations like adding, updating, deleting, and fetching data for both categories and products. You can also view all the products linked to a specific category

Notifications You must be signed in to change notification settings

Theyashsawarkar/nimap-machine-test

Repository files navigation

Product and Category Manager πŸ›οΈπŸ“¦

This is a backend Node.js Express application that returns server-rendered HTML files. The HTML files are dynamic in nature, providing a seamless experience for managing products and categories. It supports CRUD (Create, Read, Update, Delete) operations for both categories and products. You can also fetch all the products associated with a specific category, making it simple to manage product-category relationships.

Tech Stack πŸ’»

  • Frontend: HTML, CSS, Vanilla JavaScript
  • Backend: Node.js, Express , Ejs
  • Database: MySQL

Features βš™οΈ

  • Category Management:

    • Add new categories ✏️
    • Update existing categories πŸ”„
    • Delete categories πŸ—‘οΈ
    • Fetch all categories πŸ“‘
    categories.mp4
  • Product Management:

    • Add new products πŸ›’
    • Assign products to categories πŸ“¦
    • Update product details ✏️
    • Delete products πŸ—‘οΈ
    products.mp4
  • Fetch all products for a specific category πŸ”

    products-by-category.mp4
  • Pagination:

    • Navigate through categories and products with pagination πŸ”„

Backend Routes and Functionality

Products Routes

Route HTTP Method Functionality Parameters Source
/api/products GET Fetch all products with pagination Query: page (optional, number), pageSize (optional, number) Query Params
/api/products/:id GET Fetch a specific product by its ID Path: id (required, product ID) Path Param
/api/products POST Add a new product Body: product_name (string), category_id (number) JSON Body
/api/products/:id PUT Update an existing product Path: id (required, product ID)
Body: product_name (string), category_id (number)
Path + JSON
/api/products/:id DELETE Delete a product by its ID Path: id (required, product ID) Path Param

Categories Routes

Route HTTP Method Functionality Parameters Source
/api/categories GET Fetch all categories with pagination Query: page (optional, number), pageSize (optional, number) Query Params
/api/categories/:id GET Fetch a specific category by its ID Path: id (required, category ID) Path Param
/api/categories POST Add a new category Body: category_name (string) JSON Body
/api/categories/:id PUT Update an existing category Path: id (required, category ID)
Body: category_name (string)
Path + JSON
/api/categories/:id DELETE Delete a category by its ID Path: id (required, category ID) Path Param
/api/categories/category/:id GET Fetch all products for a specific category Path: id (required, category ID) Path Param

Notes

  • Pagination: Both products and categories support pagination using optional page and pageSize query parameters.
  • Parameter Handling:
    • Path Parameters: For resource identification, e.g., :id.
    • Query Parameters: For filtering or pagination, e.g., page, pageSize.
    • JSON Body: For creating or updating resources.

About

This project is a Product and Category Manager that helps you easily manage categories and products. It supports all the basic operations like adding, updating, deleting, and fetching data for both categories and products. You can also view all the products linked to a specific category

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /