Schema and Backend Routes - Sparky338/FlyingFox-Capstone GitHub Wiki

Database Schema

image

Backend Routes

Users

GET /api/users/

  • Returns the information of all users

GET /api/users/:id

  • Returns the information of one user

Session

GET /api/auth/

  • Returns the information for the logged in user

POST /api/auth/signup

  • Signs a new user up

POST /api/auth/login

  • Logs in a user

DELETE /api/auth/

  • Logs out a user

Items- Static Seeded Data

GET /api/items/

  • Returns the information for all Items

GET /api/items/:id

  • Returns the information for one Item

Purchases

GET /api/cart/

  • Returns the shopping cart from Local Storage

GET /api/users/:Id/purchases

  • Returns the purchases the user has completed

POST /api/cart

  • Add an item into the Local Storage cart

PUT /api/cart/:id

  • Updates the quantity of an item in the Local Storage cart

POST /api/cart/checkout

  • Empties the Local Storage cart and adds items to purchases

DELETE /api/cart/:id

  • Removes an item from the Local Storage cart

Reviews

GET /api/items/:id/reviews

  • Returns reviews for a single item

POST /api/items/:id/reviews/

  • Creates a review on an item

PUT /api/reviews/:id

  • Edits a review

DELETE /api/reviews/:id

  • Deletes a review

Images

POST /api/images

  • Creates a new image

DELETE /api/images/:id

  • Deletes an image