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.
Table of Contents
- Register to MongoDB and create a free cluster
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/CodecoolGlobal/freestyle-mern-project-react-KrisztaAntal.git
- Install NPM packages
npm install
- Create environment variable: MONGO_DB_URL = "your-MongoDB-cluster-url"
- Open a terminal and step into the server directory in the project's directory
- Write command:
node testdata.js
- Write command:
node migration.js
- Write command:
node server.js
- Open a new terminal and step into the book-worms directory which is inside the client directory which is inside the project's directory
- 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.
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?
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
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.
A registered user can add books to their collection and can set their reading progress by writing which page they are on currently.