You are on page 1of 1

Postman Queries:

- For Authors Details:


[GET] https://localhost:3000/api/authors

[GET] https://localhost:3000/api/authors/me

[GET] https://localhost:3000/api/authors/:id

[GET] https://localhost:3000/api/authors/login/:id (Helper function for authentication)

[GET] https://localhost:3000/api/authors/logout (Helper function for authentication)

- For Books Details:


[GET] https://localhost:3000/api/books

[PUT] https://localhost:3000/api/books/like/:id

[PUT] https://localhost:3000/api/books/unlike/:id

Architecture and flow:


- Server started and fake entries are inserted using faker.
- Helper function login to be used to authenticate a user.
- Now after authentication, any route can be accessed by the author.
- Author can view the details of any author, view his/her profile, view books, like and
unlike any book.
- All the routes are only accessible when the author is logged-in else he wouldn’t able to
access these routes.
Authors Model Books Model

Title - String
Likes- {
Name - String noOflikes -num
Email - Email likedBy – []
Phone_num - }
Unlikes - {
String
noOfunlikes -num
booksWrote[] unlikedBy – []
}
Author - String

You might also like