This project is a Product Management System API built with Node.js, Express, and MySQL.
The Product Management System API provides functionalities for managing products, including listing all products, getting product details, creating, updating, and deleting products.
- Get a list of all products with pagination and filtering options.
- Get details of a specific product by ID.
- Create new products.
- Update existing products.
- Delete products.
Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/sanketpotphode/Product-Management-System-Node.js-MySQ cd product-management-api
DB_HOST= DB_USER= DB_PASSWORD= DB_NAME=
npm install
-> Product endpoints
- to get all products (GET Method)
-
http://localhost:3000/products/:id -get product by id (GET Method)
-
http://localhost:3000/products/ -add product (POST Method)
-
http://localhost:3000/products/:id -Update product by id (PUT Method)
5 . http://localhost:3000/products/:id -Delete product by id (DELETE Method)
-> Users endpoints
-
http://localhost:3000/users/:id
- Get user information with the given id(GET Method).
-
- Add a new user (POST Method), expects {username, password} in the request body
-
- Update User information with the given username(PUT Method), expects {password} in the request body
-
http://localhost:3000/users/:id
- Delete a user using his id(DELETE Method)
-
http://localhost:3000/users/profile -Get logged-in users profile information(GET Method)
-
http://localhost:3000/users/register -Register a new user and return jwt token(POST Method), expects{username, password, role } in the request body
-
http://localhost:3000/users/login
- Logs in an existing user and returns jwt token if successful(POST Method)