Skip to content

whitebeard10/RESTful-API-for-a-Bookstore-Management-System

Repository files navigation

Bookstore Management System API

This project provides a RESTful API for managing a bookstore, allowing users to perform operations such as adding, retrieving, updating, and deleting book information.

Features

  • Database Schema: Utilizes a MySQL database to store book details, including title, author, ISBN, price, and quantity.
  • API Endpoints: Provides endpoints for performing CRUD operations on books:
    • Adding a new book
    • Retrieving all books
    • Retrieving a specific book by ISBN
    • Updating book details
    • Deleting a book
  • Authentication: Implements basic authentication to restrict access to certain endpoints.
  • Documentation: Includes Swagger for clear documentation of API endpoints and usage.
  • Testing: Provides unit tests for the API endpoints to ensure functionality and handle edge cases and errors effectively.

Technologies Used

  • Flask: Python web framework for developing the RESTful API.
  • Flask-SQLAlchemy: SQLAlchemy integration for database management.
  • Flask-HTTPAuth: Library for implementing basic authentication in Flask applications.
  • Flask-Swagger: Integration of Swagger/OpenAPI Specification for API documentation.
  • MySQL: Relational database management system for storing book details.

Installation

  1. Clone the repository:

    git clone https://github.com/whitebeard10/RESTful-API-for-a-Bookstore-Management-System.git  
  2. Install dependencies:

pip install -r requirements.txt
  1. Set up the database:
  • Configure the MySQL database URI in app.py.
  • Ensure the database is created with the necessary table book.
  1. Run the application: Navigate to application folder and run the file as:
    python app.py

API Documentation

The API documentation is available in Swagger and can be accessed by running the application and visiting the Swagger UI endpoint (/apidocs) in a web browser.

Testing

Unit tests are included to ensure the correctness and reliability of the API endpoints. To run the tests, use the following command:

python test_app.py

API Collection:

Following is the postman link of the API testing:

POSTMAN LINK

License

This project uses the following license: 'MIT license'.

About

RESTful API using Python (Flask) for managing a bookstore. The system allows users to add, retrieve, update, and delete book information.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages