Git Product home page Git Product logo

stocking's Introduction

{ Stocking : API } ๐Ÿ“ฆ

Building โš™

You'll need Node.js and i recommend that you have installed the Yarn on your computer. With your setup completed, you will need to instal MySQL, and create an empty database called "stocking".

This API is not ready ๐Ÿšจ

This API can menage a stock system easily, here you can menage (clients, products, providers, sales and supplies). This API can store purchase and sales data of the stock, as well as it can relate the data of buyers and providers with these actions. All the information can be stored and the relations can be done, but... the information is not updated dynamically, e.g. If a purchase is registered, the amount of products that were purchased will not be deducted from the stock, just as the registered supplies do not increase the amounts stored in the product table.

http://localhost:3000/clients/

http://localhost:3000/products/

http://localhost:3000/sales/

http://localhost:3000/providers/

http://localhost:3000/supplies/

This is API is running at port 3000 http://localhost:3000;

Clone

git clone https://github.com/gabriellopes00/Stocking.git

Running with yarn ๐Ÿฟ

$ cd Stocking
$ cd server
$ yarn install
$ yarn dev

Running with npm ๐Ÿ”ง

$ cd Stocking
$ cd server
$ npm install
$ npm run dev

Contact ๐Ÿ“ฑ

Github Badge Linkedin Badge Twitter Badge Gmail Badge

Documentation ๐Ÿ“

Endpoints

Clients endpoints

  • http://localhost:3000/clients/
This route can be accessed using methods get post put delete

-- localhost:3000/clients/

  • In the method get, this route return a list with all of the clients registered in the database.
  • In the method post, this route will create a new client, you just need to pass the clients information.

-- localhost:3000/clients/:id

  • In method get, passing an id as parameter, will return the information of one client, witch have the id, igual the id passed as parameter, including its complete address.
  • In method delete, passing the id of the client, this client will be removed from the database.
  • In method put, you need to pass the id of the client, and the new client's information, and the client will be updated in the database.

Answers

  • This routes will return the information about the clients, in method get, or an error, with the status code 400. And if the clients are deleted, updated or created successfully, will be returned status code 200

Products endpoints

  • http://localhost:3000/products/
This route can be accessed using methods get post put delete

-- http://localhost:3000/products/

  • In the method get, this route return a list with all of the products registered in the database.
  • In the method post, this route will create a new product, you just need to pass the products information.

-- http://localhost:3000/products/:id

  • In method get, passing an id as parameter, will return the information of one product, witch have the id, igual the id passed as parameter.
  • In method delete, passing the id of the product, this product will be removed from the database.
  • In method put, you need to pass the id of the product, and the new product's information, and the product will be updated in the database.

Answers

  • This routes will return the information about the products, in method get, or an error, with the status code 400. And if the products are deleted, updated or created successfully, will be returned status code 200

Providers endpoints

  • http://localhost:3000/providers/
This route can be accessed using methods get post put delete

-- http://localhost:3000/providers/

  • In the method get, this route return a list with all of the providers registered in the database.
  • In the method post, this route will create a new provider, you just need to pass the provider information.

-- http://localhost:3000/providers/:id

  • In method get, passing an id as parameter, will return the information of one providers, witch have the id, igual the id passed as parameter.
  • In method delete, passing the id of the providers, this providers will be removed from the database.
  • In method put, you need to pass the id of the providers, and the new provider's information, and the providers will be updated in the database.

Answers

  • This routes will return the information about the providers, in method get, or an error, with the status code 400. And if the providers are deleted, updated or created successfully, will be returned status code 200.

Relations Endpoints

Sales endpoints

  • http://localhost:3000/sales/
This route can be accessed using methods get post put delete

-- http://localhost:3000/sales/

  • In the method get, this route return a list with all of the sales registered in the database.
  • In the method post, this route will create a new sale, you just need to pass the sale information.

-- http://localhost:3000/sales/:id

  • In method get, passing an id as parameter, will return the information of one sale, witch have the id, igual the id passed as parameter. Including the client the released the sale, and the product that was brought.
  • In method delete, passing the id of the sales, this sale will be removed from the database.
  • In method put, you need to pass the id of the sale, and the new sale's information, and the product will be updated in the database.

Answers

  • This routes will return the information about the sale, in method get, or an error, with the status code 400. And if the sales are deleted, updated or created successfully, will be returned status code 200

Supplies endpoints

  • http://localhost:3000/supplies/
This route can be accessed using methods get post put delete

-- http://localhost:3000/supplies/

  • In the method get, this route return a list with all of the supplies registered in the database.
  • In the method post, this route will create a new supply, you just need to pass the sale information.

-- http://localhost:3000/supplies/:id

  • In method get, passing an id as parameter, will return the information of one supply, witch have the id, igual the id passed as parameter. Including the provider the released the supply, and the product that was supplied.
  • In method delete, passing the id of the supplies, this supply will be removed from the database.
  • In method put, you need to pass the id of the supplies, and the new supply's information, and the supply will be updated in the database.

Answers

  • This routes will return the information about the supply, in method get, or an error, with the status code 400. And if the supplies are deleted, updated or created successfully, will be returned status code 200

stocking's People

Contributors

gabriellopes00 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.