Coder Social home page Coder Social logo

arezamoosavi / shopping-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.11 MB

This projects is build with Django and using Graphql for routing.

Dockerfile 0.18% Shell 0.55% Python 3.51% CSS 45.73% JavaScript 50.04%
django-rest-framework graphql django-graphene postgresql nginx

shopping-app's Introduction

Shopping app with Qraphql

In this project the graphql api method is applied for getting and posting data. Django is used for handling requests and Database handling.

Installation

To install this project

docker-compose build --no-cache

In order to run

docker-compose up

Also to stop it

docker-compose down -v

Usage

in order to see result data in graphql, some dummy data is populated with autofixture in entrypoin.sh with this command:

python manage.py loadtestdata buy.Orders:3000 buy.Products:2000 -d

So to see results follow: 0.0.0.0:8000/graphql

to get data put this as query and press > button. all dummy data is shown.

query{
  allOrders {
    id
    totalPrice
    deliveryMethod
  }
  allProducts{
    category
    id
    name
  }
}

for posting order data use this mutation

mutation{
  addOrder(input:{deliveryMethod:"sdssdsdd", paymentMethod: "55sdsd"}){
    order{
      deliveryMethod
      paymentMethod
      products
      quantities
      totalPrice
    }
  }
}

and for posting product data:

mutation{
  addProduct(input:{name:"randName",category:"sthiii",quantity:5}){
    product{
      name
      category
      quantity
    }
  }
}

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.