API Routes - stili87/Better-Reads GitHub Wiki

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user specific features.

Books

  • A logged in user may add a book to the database, delete their books from the database, edit the information on thier books without causing a refresh/redirect. A route will also be able to grab all the books in the database

    • GET /api/books - get all books in the database
    • POST /api/books - create new book
    • PUT /api/books/:id - edit a user's created book
    • DELETE /api/books/:id - delete a user's book

Bookshelves

  • A logged in user may add a bookshelf to the database, delete their bookshelves from the database, edit the information on thier bookshelf (e.g. change the name) without causing a refresh/redirect. A route will also be able to grab all the bookshelves for that user.

    • GET /api/bookshelves - get all user specific bookshelves in the database
    • POST /api/bookshelves - create new bookshelf
    • PUT /api/bookshelves/:id - edit a user's created bookshelf
    • DELETE /api/bookshelves/:id - delete a user's bookshelf

Reviews

  • A logged in user may add a review to a book, delete their reviews from the database, edit the review without causing a refresh/redirect. A route will also be able to grab all the reviews for a particular book.

    • GET /api/reviews - get all reviews for a particular book
    • POST /api/reviews - create new review for a book
    • PUT /api/reviews - edit a user's created review
    • DELETE /api/reviews - delete a user's review

Read Status

  • A logged in user may mark their read status of a book, edit the read status of a book without causing a refresh/redirect. A route will also be able to grab current read status for a particular book for a particular user.

    • GET /api/readstatus - get the read status for a particular book for a particular user.
    • POST /api/readstatus - create new read status for a particular book for a particular user.
    • PUT /api/readstatus - edit read status for a particular book for a particular user.
    • DELETE /api/readstatus - delete a read status for a particular book for a particular user.