Skip to content

This project is a book searching website & it's backend is a REST API developed using nodejs. This is one of my personal projects. This repo holds the backend code of the project.

Notifications You must be signed in to change notification settings

tazbin/book-search-backend-nodejs-REST-API

Repository files navigation

book-search-backend-nodejs-REST-API

book-search is one of my personal projects where anyone can search for books related to programming, IT or technology. Registered user can also add books to their favourite list. This repository holds the code of it's backend which is a RESTful API.

The frontend of this project can be found here (Angular).

Visit complete live project book-search241.netlify.app

Contents

Features:

  • Users can create their profiles (token-based authentication)
  • Users can search for books by title, author or keywords
  • Users can view details of a particular book
  • Users can add books to their favorite list
  • Users can remove books from their favorite list
  • Users can view their list of favorite books

Tech used:

Runtime environment

  • Node.js

API for books

Database

  • MongoDB

Containerized tool

  • Docker

How to get the project:

Using Git (recommended)

  1. Navigate & open CLI into the directory where you want to put this project & Clone this project using this command.
git clone https://github.com/tazbin/book-search-backend-nodejs-REST-API.git

Using manual download ZIP

  1. Download repository
  2. Extract the zip file, navigate into it & copy the folder to your desired directory

Setting up environments

  1. There is a file named .env.example on the root directory of the project
  2. Create a new file by copying & pasting the file on the root directory & rename it to just .env
  3. The .env file is already ignored, so your credentials inside it won't be committed
  4. Change the values of the file. Make changes of comment to the .env.example file while adding new constants to the .env file.

Run the project using docker

  1. To build docker image

    docker compose build --no-cache
  2. To run the containers in detached mode (wait for a while for database connection)

    docker compose up -d
  3. To view running containers

    docker container ps
  4. To view API logs

    docker logs booksearch-api-c
  5. To run tests, first enter within the API container

    • on windows CMD (not switching to bash)
      docker exec -it booksearch-api-c /bin/sh
    • on windows CMD (after switching to bash)
      docker exec -it booksearch-api-c //bin//sh
      or
      winpty docker exec -it booksearch-api-c //bin//sh

    now run test command

    npm test
  6. To exit from API container, press Ctrl+D on terminal

  7. To stop the containers

    docker compose down

API endpoints:

Indication

  • Authentication required
  • Authentication not required

User related

Book related

About

This project is a book searching website & it's backend is a REST API developed using nodejs. This is one of my personal projects. This repo holds the backend code of the project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages