An open API service indexing awesome lists of open source software.

https://github.com/rafaelmoraes003/store-manager

Sales management system in dropshipping format.
https://github.com/rafaelmoraes003/store-manager

chai express http javascript mocha mysql node nodejs sinon

Last synced: about 2 months ago
JSON representation

Sales management system in dropshipping format.

Awesome Lists containing this project

README

          

Store Manager

###

This project aimed to develop a fully RESTful API using the MSC (model-service-controller) architecture.

The API built was a sales management system in dropshipping format in which it is possible to create, view, delete and update products and sales.

For the construction of the API, Node.js was used with Express and a MySQL database for data management. In the testing part, 100% code coverage was done using Mocha, Chai and Sinon.

###

Technologies used

###


javascript logo
nodejs logo
express logo
mysql logo
mocha logo

###

How to use the application

###

Clone the application using the `git clone` command. After that, enter the project folder using the `cd store-manager` command and run the `npm install` command. After installation, use the `npm start` command and enter port `3000` in your browser.

###

About the database

###
- Create the databse

`npm run migration`

- Populate the database

`npm run seed`

###

Endpoints

###

Products

| Method | Functionality | URL |
|---|---|---|
| `GET` | List all products | http://localhost:3001/products |
| `GET` | List a product whose name includes the string | http://localhost:3001/products?q |
| `GET` | List a product based on its id | http://localhost:3001/products/:id |
| `POST` | Create a new product | http://localhost:3001/products |
| `DELETE` | Delete a product based on its id | http://localhost:3001/products/:id |
| `PUT` | Update a product based on its id | http://localhost:3001/products/:id |

###

Sales

| Method | Functionality | URL |
|---|---|---|
| `GET` | List all sales | http://localhost:3001/sales |
| `GET` | List a sale based on its id | http://localhost:3001/sales/:id |
| `POST` | Create a new sale | http://localhost:3001/sales |
| `DELETE` | Delete a sale based on its id | http://localhost:3001/sales/:id |
| `PUT` | Update a sale based on its id | http://localhost:3001/sales/:id |