Code Monkey home page Code Monkey logo

rest-api-library's Introduction

๐Ÿ“š Library Management System API

Welcome to the Library Management System API! This Node.js project allows you to manage your library's book collection with ease. Whether you're adding new books, editing details, or searching for specific titles, we've got you covered. Additionally, user authentication and registration are included for added security.

๐Ÿš€ Features

Authentication and Registration

  • User Login:
    • Endpoint: POST /login
    • Allows users to log in with their credentials.
  • User Registration:
    • Endpoint: POST /register
    • Enables users to register by providing necessary information.

Basic CRUD Operations

  1. Add a New Book

    • Endpoint: POST /addbook
    • Request body includes title, author, genre, and ISBN.
  2. Edit Existing Book

    • Endpoint: PUT /updatebook/:isbn
  3. Delete a Book

    • Endpoint: DELETE /deletebook/:isbn
  4. Search for Books

    • Retrieve all books: GET /allbook
    • Retrieve a specific book by ISBN: GET /book/:isbn

๐Ÿ› ๏ธ Dependencies

  • bcrypt: Password hashing for enhanced security.
  • body-parser: Middleware for parsing request bodies.
  • dotenv: Load environment variables from a .env file.
  • express: Web application framework for Node.js.
  • jsonwebtoken: JSON Web Token generation and verification.
  • knex: SQL query builder for Node.js.
  • mysql: MySQL database driver.
  • swagger-ui-express: Swagger UI integration for API documentation.

โš™๏ธ Database Schema

The database schema is defined using Knex migrations. You can find the migration files in the migrations directory.

๐Ÿšฆ Getting Started

  1. Clone the Repository:

    git clone https://github.com/your-username/library-management-api.git](https://github.com/devsathwara/rest-api-library.git
  2. Install Dependencies:

    npm install
  3. Run Migrations:

    npm run migrate
  4. Set up the Database:

    • Configure the MySQL connection in the .env file.
  5. Run the Project:

    npm start

๐Ÿ“– API Documentation

Explore and test the API endpoints using Swagger UI at http://localhost:your-port/api-docs after running the project.

๐Ÿงช Testing

Use tools like Postman or testing libraries like Mocha and Chai to test the API endpoints.

๐Ÿค Contributing

Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.

rest-api-library's People

Contributors

devsathwara 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.