GithubHelp home page GithubHelp logo

api-proposal-'s Introduction

API Project

Description

This API allows authenticated users to post their products online for other users to search and find products of needs. This app is meant for users to store any item inside a database

Installation

To install Product API on your local machine, clone the repo, open your terminal, navigate to the directory you just created, and do the following:

npm install

from there, you can start the server by doing one of these:

npm start

Great

Authentication

Register an account

All you'll have to do next is send a POST request to http://localhost:3000/user/signup

First set the header to Key: Content-Type and value: application/json Make sure your Body is JSON Type and selected raw and enter:

email: String,
password: Password

Then we will take care of the rest

Log in

In order to log in, send a POST request to http://localhost:3000/user/login

Use the following headers with the correct data types:

email: String,
password: Password

You should now be authenticated. You can check with the route below.

Log out

The system will log you out with in a hour

Quick Tip

Before grabbing data from the API, all routes are authorized, except for get all proudcts request. In order to have access to all routes: Login and copy the token key Go to Headers enter Key: Authorization For Value: type Bearer and paste your personal token. This will check for user Authorization

Get all Products

Send a GET Request on http://localhost:3000/products/ and all products will be returned in the order they were made.

Get a specific Product

Send a GET Request on http://localhost:3000/products/:enterIdHere to recieve the Product with ID you specified.

Create a new Product

Send a POST request on http://localhost:3000/products/ and refer to following for names and values:

name: String,
price: Number,

Great.

You Can also upload images to your product if you click form-data and enter key and value, for example:

name: String,
price: Number,
productimage: Upload Image

Update a Product

Send a PATCH request to http://localhost:3000/products/ and refer to following for names and values:

id: String,
name: String,
price: Number,

Perfect.

Delete a product

Send a DELETE request to http://localhost:3000/puppies?_method=DELETE and refer to following for names and values:

id: String;

Get all Orders

Send a GET Request on http://localhost:3000/orders/ and all products will be returned in the order they were made.

Get a specific Order

Send a GET Request on http://localhost:3000/orders/:enterIdHere to recieve the order with ID you specified.

Create a new Order

Send a POST request on http://localhost:3000/orders/ and refer to following for names and values:

name: String,
price: Number,

Update a Order

Send a PATCH request to http://localhost:3000/orders/:enterIdHere and refer to following for names and values:

id: String,
name: String,
price: Number,

Perfect.

Delete an Order

Send a DELETE request to http://localhost:3000/orders/:enterIdHere and refer to following for names and values:

id: String;

Thank you

api-proposal-'s People

Contributors

farhan-begg avatar

Stargazers

 avatar

Watchers

 avatar  avatar

api-proposal-'s Issues

Final Project Feedback

Requirements

Functional Requirements

  • At least one nested route or resource: 10/10
  • The ability to CREATE, READ, UPDATE, and DELETE the object(s) in your API: 10/10
  • At least one of each endpoint: GET, POST, PUT, and DELETE: 10/10
  • A database persistence layer (e.g. MongoDB): 10/10
  • The ability to securely provision an API user: 10/10
  • Project contains documentation explaining how to use your API: 10/10
  • Project contains a simple, static single page brochure site: 10/10

Non-Functional Requirements

  • Written using the appropriate application of RESTful techniques: 5/5
  • Follows the MVC pattern: 5/5
  • Hosted in a public GitHub repository: 5/5
  • Does not expose any secrets: 5/5
  • Has a discernible theme or serves a distinct purpose: 5/5
  • Deployed and fully accessible: 0/5
  • Fully documented: 10/10
  • Fully tested: 5/20 (tests not passing)

Notes:

  • No need to have _id as a field on the User object. It gets added automatically.
  • In documentation, could specify instructions for passing the auth token for future requests.

Total: 115/130

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.