Skip to content

Floran Book Display is an open Api created for React.js workshop for beginner to fetch latest and other book data along with posting new book data.

Notifications You must be signed in to change notification settings

bhagwanZaki/book_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Floran Book Display Api

Floran Book Display is an open Api created for React.js workshop for beginner to fetch latest and other book data along with posting new book data.

API Information

Each book object will look like this

{
    "id": 3,
    "name": "Dummy Book 2",
    "author": "Elon Musk",
    "description": "Lorem Ipsum is simply dummy text of the printing and ….",
    "price": 500.0,
    "pages": 200,
    "cover": "https://res.cloudinary.com/floran-music/raw/upload/v1/media/default.jpg"
}
  1. To get the latest book data

    API: https://floran-book-api.herokuapp.com/latest/

    This will return you list of 5 latest books only

  2. To get other book data

    API: https://floran-book-api.herokuapp.com/

    This will return you remaining book data other than the latest books

  3. To get specific book data for detail page

    API: https://floran-book-api.herokuapp.com/

    This will return you specific book data

  4. To post new book data API: https://floran-book-api.herokuapp.com/ [USE POST REQUEST]

    The formdata should contain exactly the same following key

    • field: name type: String
    • field: author type: String
    • field: description: type: String
    • field: price: type: Float
    • field: pages: type: Integer
    • field: cover: type: Image File

Requirement

Python v.3.8+

Setup

Clone Repository

for windows, create virtual env using virtualenvwrapper-win

    pip install virtualenvwrapper-win
    mkvirtualenv reactdj

for linux & mac use this command

    apt-get install python3-venv  
    python3 -m venv reactdj

To activate environment in windows

    workon reactdj

To activate environment in linux & mac

    source reactdj/bin/activate

Copy Paste the following commands to clone the repo

    https://github.com/Floran-Github/Floran_POS.git

To run backend django rest framework

Go inside the floran_pos_backend directory and install the module from requirements.txt

  cd floran_pos_backend
  pip install -r requirements.txt

Then make the migrations and then migrate the database

   python manage.py makemigrations
   python manage.py migrate

Create the superuser

  python manage.py createsuperuser

Now run the django server on your local network instead of localhost for react to communicate

  python manage.py runserver 0.0.0.0:8000

Now you goto localhost:8000 to see the API

    http://127.0.0.1:8000/api/auth

About

Floran Book Display is an open Api created for React.js workshop for beginner to fetch latest and other book data along with posting new book data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published