Skip to content

harshongithub/bookstore_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bookstore API

This project is a RESTful API for managing a book inventory.

Table of Contents

  1. Features
  2. Prerequisites
  3. Installation
  4. Usage
  5. API Endpoints

Features

  • Manage book inventory (add, update, delete books)
  • User authentication and authorization
  • Search functionality for books by ID

Prerequisites

  • Python 3.7+
  • Django 3.2+
  • Django REST Framework 3.12+

Installation

  1. Clone the Repository or Download the Zip:

    git clone https://github.com/harshongithub/bookstore_api.git
    cd bookstore_api
  2. Create and Activate a Virtual Environment:

    python -m venv venv 
    • On Windows: venv\Scripts\activate
    • On macOS/Linux: source venv/bin/activate
  3. Install the Required Packages:

    pip install -r requirements.txt
  4. Apply Migrations:

    python manage.py migrate
    python manage.py makemigrations
  5. Create a Superuser:

    python manage.py createsuperuser

Usage

To run the development server:

python manage.py runserver

The API will be available at http://localhost:8000.

API Endpoints

  • /api/books/: List all books or create a new book (Authentication required for creating a new book)
  • /api/books/<id>/: Retrieve, update, or delete a specific book (Authentication required for update and delete)
  • /api/login/: To log in
  • /api/register/: To register as a new user
  • /api/token/refresh/: To get a new access token
  • /api/admin/: To access the admin panel

For detailed documentation of the API endpoints, visit Postman Documentation.

About

This is an api made up through django rest api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published