Giter Site home page Giter Site logo

wannacry081 / bookstore-flask-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 53 KB

Experience the Virtual Bookstore API: a powerful Flask-based solution for online bookstores. Seamlessly manage your inventory with features like book retrieval, addition, update, deletion, user authentication, and admin privileges.

License: Other

Python 98.30% Dockerfile 1.70%
api flask flask-bcrypt flask-cors flask-jwt-extended flask-marshmallow flask-restful flask-sqlalchemy

bookstore-flask-api's Introduction

Bookstore API

Welcome to the Virtual Bookstore API, a robust and user-friendly solution for managing your online bookstore. Built with Flask, Flask-SQLAlchemy, Flask-Restful, Flask-Marshmallow, Flask-Bcrypt, Flask-Cors and Flask-JWT-Extended, this RESTful API seamlessly integrates with SQLite and MySQL databases, providing a versatile and scalable platform. With features like book retrieval, addition, update, deletion, user authentication, and admin privileges, the Virtual Bookstore API empowers you to efficiently manage your inventory. Experience the power and flexibility of the Virtual Bookstore API today and create an exceptional online bookstore experience.

Requirements

  • Python 3.10.0
  • Flask
  • Flask-SQLAlchemy
  • Flask-JWT-Extended
  • SQLite (for local development)
  • MySQL (for production)

Installation

  1. Clone the repository:
git clone https://github.com/TheDayDreamer01/Bookstore-Flask-API.git
cd bookstore-flask-api
  1. Create a virtual environment:
virtualenv env
  1. Activate the virtual environment:
  • For Linux/Mac:
source env/bin/activate
  • For Windows:
env\Scripts\activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Run the application:
python server.py

The default database used in this project is SQLite3. However, you can also use it in MySQL by configuring the config.py in the Config/config.py directory. Moreover, the API should now be accessible at http://localhost:5000.

API Routes

  • POST /api/auth/signin

    • User sign-in with email and password.
    • Returns a JWT token for authentication.
  • POST /api/auth/signup

    • User sign-up with username, email, and password.
    • Creates a new user in the database.
  • POST /api/auth/signout

    • User sign-out.
    • Invalidates the JWT token.
  • GET /api/book

    • Get a list of all books.
    • No authentication required.
  • GET /api/book/<book_id>/<book_title>

    • Get details of a specific book.
    • No authentication required.
  • GET /api/book/user/<user_id>

    • Get the authenticated user's book list.
  • POST /api/book/user/<user_id>

    • Add a book to the authenticated user's book list.
  • DELETE /api/book/<book_id>

    • Delete a book from the authenticated user's book list.
  • GET /api/user/<user_id>

    • Get the authenticated user's profile.
  • PUT /api/user/<user_id>

    • Update the authenticated user's profile.
  • POST /api/user/<user_id>

    • Update the authenticated user's password.
  • DELETE /api/user/<user_id>

    • Delete the authenticated user's account.
  • POST /api/admin/book

    • Add a book (admin only).
  • PUT /api/admin/book

    • Update a book (admin only).
  • DELETE /api/admin/book

    • Delete a book (admin only).
  • GET /api/admin/user

    • Get a list of all users (admin only).
  • DELETE /api/admin/user

    • Delete a user (admin only).

Contributing

Contributions to the project are welcome. If you find any issues or have any suggestions for improvement, feel free to submit a pull request or open an issue on the repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

bookstore-flask-api's People

Contributors

wannacry081 avatar

Stargazers

 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.