Logo

This two-sprint school project was about to learn MERN stack by creating a website that uses an external API, Vite for the frontend and Express with MongoDB as backend server.
We chose Google's Books API for a site where the user can search from a list of books, filtering them by title, author, genre or publication year. Clicking on the Show details button, we can see a short description of the book and reviews added by logged in users.
If the user logs in, they can also add reviews and on the library page an extra Add to collection button appears for each book. The user can add books to their collection and set which page they currently read and it shows their reading progress.

main-page
Table of Contents
  1. Built With
  2. Getting Started
  3. Usage

Built with

JavaScript React Vite CSS Bootstrap

Express.js NodeJS npm

Git Visual-Studio-Code MongoDB Google

(back to top)

Getting Started

Prerequisites

  • Register to MongoDB and create a free cluster
  • npm
    npm install npm@latest -g

(back to top)

Installation

  1. Clone the repo
    git clone https://github.com/CodecoolGlobal/freestyle-mern-project-react-KrisztaAntal.git
  2. Install NPM packages
    npm install
  3. Create environment variable: MONGO_DB_URL = "your-MongoDB-cluster-url"
  4. Open a terminal and step into the server directory in the project's directory
  5. Write command: node testdata.js
  6. Write command: node migration.js
  7. Write command: node server.js
  8. Open a new terminal and step into the book-worms directory which is inside the client directory which is inside the project's directory
  9. Write command: npm run dev

Currently the site has a test user "admin" so to see the behaviour of the site with a logged in user please write admin in the login input.

(back to top)

Usage

Filter

The user can filter books by title, author, genre and publication year. The filtering is case insensitive and the value put into the input field can be anywhere in the searched part, for exaxple writing "ill" into the title filter will show three books titled: Papillon, The Pillars of the Earth and Will You be There?

filtering

(back to top)

Details page

Here the user can see the title, author, category, publishing year, number of pages and a summary of the book and the reviews given by other logged in users. Clicking on the Back button steps back to the Main library page

(back to top)

Reviews

A logged in user can add a review with a short text and a rate from 1 to 5. Non registered users can only see them.

review

(back to top)

Collection

A registered user can add books to their collection and can set their reading progress by writing which page they are on currently.

collection

(back to top)