Code Monkey home page Code Monkey logo

django_pizza_api's Introduction

Pizza Order Management API

Introduction

This django-admin api provides endpoints for managing client pizza orders.

Install

  • Clone this repo
  • Run cd django_pizza_api
  • Add .env file in the root folder containing the environment variables below.
  • Run docker-compose up --build -d

This will install django and postgresql, create superuser with the credentials pizza_admin (password: pizza) and will seed the static tables: client, flavour, size, and status.

Environment Variables

SECRET_KEY=your secret is safe
DEBUG=1
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=pizza_order_management_db
SQL_USER=pizza_admin
SQL_EMAIL=[email protected]
SQL_PASSWORD=pizza
SQL_HOST=db
SQL_PORT=5432
DATABASE=postgres

Endpoints:

Methods Route Description Payload
GET /api/client/ List all clients
POST /api/client/ Create a new client { client_name: str, client_address: str, client_phone: str }
GET /api/client/[int:id] Retrieve client by id
PATCH /api/client/[int:id] Update client by id {client_name: str}
DELETE /api/client/[int:id] Remove client by id
GET /api/flavour/ List all flavours
GET /api/flavour/[int:id] Retrieve flavour by id
GET /api/size/ List all sizes
GET /api/size/[int:id] Retrieve size by id
GET /api/status List all statuses
GET /api/status/[int:id] Retrieve status by id
GET /api/item/ List all items
POST /api/item/ Create a new item { flavour: int, size: int, amount: int, is_ready: bool }
GET /api/item/[int:id] Retrieve item by id
PATCH /api/item/[int:id] Update (order) item by id {flavour: int}
DELETE /api/item/[int:id] Remove item by id
GET /api/order/ List all orders
POST /api/order/ Create a new order { client: int, status: int }
GET /api/order/[int:id] Retrieve order by id
PATCH /api/order/[int:id] Update order by id { status: int }
DELETE /api/order/[int:id] Remove (Client) order by id
GET /api/order_item/ List all order items
POST /api/order_item/ Create a new order item { order: int, item: int }
GET /api/order_item/[int:id] Retrieve order item by id
PATCH /api/order_item/[int:id] Update order item by id { item: int }
DELETE /api/order_item/[int:id] Remove order item by id

Relations

image

django_pizza_api's People

Contributors

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