Skip to content

techemmy/Sava-Book-Management-System

Repository files navigation

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. API Endpoints
  5. CLI App
  6. Contributing
  7. License
  8. Contact

About The Project

The Book Management System is a server-side application built with Node.js that allows users to manage a collection of books. It utilizes a Redis in-memory database to store book data and provides various API endpoints to perform CRUD (Create, Read, Update, Delete) operations on the books. Additionally, the project includes a Command Line Interface (CLI) app that allows users to interact with the API directly from the command line.

API Features

  • Get a list of all books in the collection.
  • Get a book by its ISBN number.
  • Create a new book and add it to the collection.
  • Update an existing book by its ISBN number.
  • Delete a book by its ISBN number.
  • Search for books by title or author.

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

  • Node.js (version 18 or above)
  • Redis Server (running on the default port 6379)
  • npm
    npm install npm@latest -g

Installation

  1. Clone the repository:
    git clone https://github.com/techemmy/Book-Management-System
  2. Install Dependencies
    cd Book-Management-System
    npm install
  3. Set up environment variables and fill in it as appropriate
    cp .example.env .env

(back to top)

Usage

  1. Start your redis server depending on how you installed it

    redis-server
  2. Start the server

    npm run start
  3. Access the API: The API will be available at http://localhost:3000 (change the port if you specified a different one in the .env file).

  4. API documentation here

(back to top)

API Endpoints

  • GET /books : Get a list of all books.
  • GET /books/:ISBN : Get a book by its ISBN number.
  • POST /books : Create a new book.
  • PATCH /books/:ISBN : Update an existing book by its ISBN number.
  • DELETE /books/:ISBN : Delete a book by its ISBN number.
  • GET /books/search?term=keyword : Search for books by title or author using the provided search term.

(back to top)

CLI App

  1. Make sure you have installed and started running your server

  2. Configure the CLI. To make sure you have the CLI app installed globally on your PC, Run this command in the base directory of the project:

      npm link
  3. To use the CLI, run this command on your terminal

    book-manager help

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Emmanuel Oloyede - @Itechemmy

Project Link: https://github.com/techemmy/Book-Management-System

(back to top)

(back to top)

About

A NodeJs Book Management System with CLI to interact with the API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published