/bookmarkt

Bookmarkt - The Goodreads clone

Primary LanguageTypeScript

Bookmarkt - The Goodreads clone

Bookmarkt

A Goodreads inspired web application to keep track of your book collections, store your book progress, write book reviews and see what others think about it.

Table of Contents

Usage

  • Create an account and login using either email & password credentials or using your Github or Google account.
  • Search for books in which you are interested in, using the Google Books API and save them to your bookshelves.
  • Write book reviews and rate books; see what other users have rated them as well as the current average rating.
  • Add friends and other users, and see what their thoughts are on the books.
  • Combinining the best of both worlds - optimised and matched together mobile and desktop versions of the web application, using CSS media breakpoints to get you the best experience no matter what device.

Architecture

Bookmarkt is a modern full stack application, using the Next.js framework.

Frontend

  • The main part of the frontend is developed using Typescript for type safety, alongside the React library.
  • Zustand for state management.
  • TailwindCSS for styling, as well as simple responsive design with media queries.

Frontend routes

The frontend has multiple specific routes, closely resembling that to that of Goodreads'.

  • / The home page displays recent book updates from users using the app.

  • /books/[bookId] Displays individual book

  • /books/user/[userId] Displays all of the user's books, which can be

  • /friend Displays the list of friends of the currently logged in user.

  • /friend/[userId] Displays the list of friends of the user corresponding to the userId.

  • /login Credentials login page.

  • /register Credentials registration page.

  • /search?q=[query] Displays books resulting from your search query.

  • /user/show/[userId] Displays the user profile of the user corresponding to userId.

  • /user/sign_in Displays the options for logging in using Google and Github authentication or with credentials.

  • /user/sign_up - Displays the options for creating an account using Google and Github authentication or with credentials.

Backend

  • All of the backend is powered using Next.js API design with the app router.
  • Next-auth has been used for user Authentication.
  • Using the Google Books API for fetching book information.

Database

  • A combination of Prisma as an ORM, combined with MongoDB as a NoSQL database.

Database Design

Using MongoDB as the database with the following models:

  • Account: Stores the account information when authenticated using Github or Google such as provider and token information.
  • BookData: Used to keep track of total and average ratings for books, keeping track using their respective Google Books ID.
  • Bookshelf: Contains bookshelf information, its respective books and the user to which it belongs.
  • Notification: Stores notification information, such as who it's coming from, the type and time of the notification.
  • Review: Holds reviews generated by the users, including the review description as well as the rating.
  • User: Keeps track of user information, such as names, emails, hashed passwords and all IDs needed to keep track of all the remaining information like reviews, friends and books.

API Documentation

Note: All API routes begin with {SITEURL}/api.

/books

/

GET /books

Retrieves all books stored within the database

/[id]

GET /books/[id]

Retrieves the book with GoogleBookID equal to id

POST /books/[id]

Adds a new book to the database, with GoogleBookID equal to id, if it does not already exist.

/register

/

POST /register

Route user for creating a new account with a credentials combination of email & password

/review

/

GET /review

Retrieves all reviews stored within the database

POST /review

Adds a new review to the database, adding the review id to the list of reviews for the book and the user which made the review.

/[id]

GET /review/[id]

Retrieves a review with reviewID id from the database.

/users

/

/books

GET /users/books

Retrieves the books of the currently logged in user, if there is no logged in user it breaks.

POST /users/books

Adds a new book, from body of the request, to the current user's list. If the book exists in the db already, and is found, it simply adds the book id to the user's book list. Otherwise, it will create the book and then add it to the user's list.

/[userId]/books

GET /users/[userId]/books

Retrieves all books of a user with id userId.

Issues

License

Acknowledgements

Contact

API Routes