8000 GitHub - luacomacento/store-manager: A Node.js/Express.js RESTful API for a store managing system, where one can create, read, update and delete informations about products and sales in a MySQL database.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A Node.js/Express.js RESTful API for a store managing system, where one can create, read, update and delete informations about products and sales in a MySQL database.

Notifications You must be signed in to change notification settings

luacomacento/store-manager

Repository files navigation

🛍️ Store Manager

About:

A Node.js/Express.js RESTful API for a store managing system, where one can create, read, update and delete informations about products and sales in a MySQL database.

It uses a model-service-controller architecture, and has unit tests coverage, that were made using Mocha, Chai and Sinon.

Data validation on the request side is made using JOI library.

Tools and libraries:

  • Node.js
  • Express.js
  • Express Async Errors
  • JOI
  • Mocha
  • Chai
  • Sinon
  • Docker
  • MySQL

Documentation:

The full API documentation can be accessed through the route /docs

API Routes:

Products:

/products
  • GET: List all products

  • POST: Create a new product in the database

    • It requires a JSON object to be passed to the request, with a name (string with a minimum of 5 characters).
{
  "name": "Product name"
}
/products/search?q=
  • GET: Searches for products with matching name, passed as a query
URL EXAMPLE: /products/search?q=PartOfProductName
/products/:id
  • GET: List product by id

  • PUT: Edit a specific product by its id

    • It expects a JSON object to be passed to the request, with a name (string with a minimum of 5 characters).
{
  "name": "Product name"
}
  • DELETE: Remove a product by its id

Sales:

/sales
  • GET: List all sales

  • POST: Create a new sale in the database

    • It requires an array of objects to be passed to the request, with the following format:
 [
   {
     "productId": 1,
     "quantity": 1
   },
   {
     "productId": 2,
     "quantity": 5
   }
 ]
/sales/:id
  • GET: List a sale by id

  • PUT: Edit a sale in the database by its id

    • It requires an array of objects to be passed to the request, with the following format:
 [
   {
     "productId": 1,
     "quantity": 1
   },
   {
     "productId": 2,
     "quantity": 5
   }
 ]
  • DELETE: Remove a sale by its id

About

A Node.js/Express.js RESTful API for a store managing system, where one can create, read, update and delete informations about products and sales in a MySQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0