Coder Social home page Coder Social logo

library-management-console-app's Introduction

Library Management Console App

Overview

Welcome to the Library Management App repository! In this README, I will cover important architectural decisions, thoughts, and assumptions made during the development process.

Architecture

  • data.json: This file contains array of books to be present in the library

  • library.js: This file contains Library class which has following functions:

    1. showBooks() : to view list of books present in the library
    2. borrowBook(bookId, borrowedList) : this functions accepts the book id of the book user wants to borrow and the borrowed list. If a. book is present in library b. User hasn't already borrowed this book c. User hasn't reached borrow limit of 2 books then it will get added to the borrowed list and quantity of this book will get updated in the library
    3. returnBook(bookId, borrowedList) : this function also accepts the book id of the book user wants to return and the borrowed list. If a. borrowed list is not empty b. book is present in the borrowed list then it will be removed from the borrowed list and the quantity of the book will get updated in the library.
    4. addBook(bookId) : This extra helper function is created to add the book in the library. If book is present in the library, it's quantity will get increased by 1 else it will get added to the library and it's quanity will be set to 1.
    5. removeBook(bookId) : This extra helper function is created to remove the book from the library. If book has more than 1 copies, then it's quanity will be decreased by 1, else if book has only 1 copy, then it will be removed from the library.
  • library.test.js: This is a test file created to test library class and it's functions to view, borrow and return books

  • index.js: This file has the code to show the menu to user and perform actions on library and borrowed list according to user's inputs.

Technologies Used

  • Javascript for coding & Jest for testing

Assumptions

  1. Only 1 user is present: I am assuming that only 1 user is present.

library-management-console-app's People

Contributors

priyankapakhale avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.