Coder Social home page Coder Social logo

django-bookr's Introduction

django-bookr

Django Auth + GraphQL Implementation

Setup

The first thing to do is to clone the repository:

$ git clone https://github.com/faisalmaqsood01/django-bookr.git
$ cd django-bookr

Activate a virtual environment and install dependencies:

$ source venv/bin/activate

Then install the dependencies:

(venv)$ pip install -r requirements.txt

Copy the .env file into your config folder and run the server using cmd

(env)$ python manage.py runserver

Django APIS

Register User.

URL: http://127.0.0.1:8000/v1/auth/register/

Method: Post

payload. { "username": "Faisal", "password1": "password123!", "password2": "password123!", "email": "[email protected]", "first_name": "Faisal", "last_name": "Maqsood" }

Login-API

URL: http://127.0.0.1:8000/v1/auth/login Method: Post payload { "username": "Faisal", "password": "password123!" }

List all the products

URL: http://127.0.0.1:8000/v1/api/products/ Method: GET with Authorization Bearer token.

GRAPHQL

URL: http://127.0.0.1:8000/graphql

List all the products

query { products { id name price quantity } }

Create a product

mutation { create_product_item: createProductItem(input: {name:"Product_test_6", price: 5000, quantity: 1, description: "some desc"}){ productItem { name price quantity description } } }

List all the products which user bought

query { userBuyItems { quantity product { name description price } user { email firstName lastName } } }

Create user buy products API

mutation { create_cart_item: createCartItem( input: { user: 2, product: 2, quantity: 1 } ) { cartItem { product { name description price } user { email firstName lastName } quantity } } }

django-bookr's People

Contributors

faisalmaqsood01 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.