Giter Site home page Giter Site logo

fastapi-bookstore-api's Introduction

Bookstore API using FastAPI

The Bookstore API is a robust and high-performance API built using FastAPI. It allows users to browse, search, and purchase books. The API includes features like adding reviews, managing a shopping cart, and processing orders.

Features

  • Browse and search for books by title, author, or genre
  • User authentication and authorization
  • Adding, updating, and deleting reviews for books
  • Managing a shopping cart with add, update, and remove functionalities
  • Processing orders, calculating totals, and generating invoices

Technologies Used

  • FastAPI: A modern, fast (high-performance) web framework for building APIs with Python
  • SQLAlchemy: A powerful and popular Object-Relational Mapping (ORM) library for database operations
  • SQLite: A lightweight and serverless database used for storing book, user, and order data

Project Structure

The project follows a structured organization to maintain code readability and maintainability. Here's the project structure:

fastapi-bookstore-api/
    ├── main.py
    ├── models.py
    ├── database.py
    ├── authentication.py
    ├── docs/
    ├── tests/
    └── requirements.txt
  • main.py : This file will contain your FastAPI application code, including API routing and logic.
  • models.py : Define Pydantic models for data structures to ensure data consistency and validation.
  • database.py : Set up your database connection and define database models for storing book information.
  • authentication.py : Handle user authentication and authorization.
  • docs/ : Store documentation and project-related notes.
  • tests/ : Create a test suite to ensure the reliability and correctness of your API.
  • requirements.txt : List your project's dependencies for easy installation.

Getting Started

  1. Clone the repository: git clone <repository_url>
  2. Create a virtual environment: python3 -m venv env
  3. Activate the virtual environment:
  • For Unix/Linux: source env/bin/activate
  • For Windows: .\env\Scripts\activate
  1. Install the dependencies: pip install -r requirements.txt
  2. Run the API server: uvicorn main:app --reload
  3. Visit http://localhost:8000/docs to access the interactive API documentation (Swagger UI).

Contributing

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

fastapi-bookstore-api's People

Contributors

durgeshsamariya avatar bredalis avatar

Stargazers

 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.