Git Product home page Git Product logo

order_delivery's Introduction

Order_delivery

A simple order delivery API app using Python, Django, Django Rest Framework

Features

  • Order Calculator
  • List items
  • Add to cart feature
  • Save orders to database
  • Order Tracking

Demo

This Django application is hosted on aws ec2 instance in DEBUG mode and it can be accessed here. It is hosted using Nginx, Supervisor, Gunicorn.

Usage

  1. Clone this repository
git clone https://github.com/ShreehariVaasishta/order_delivery
  1. Go to the root directory of this project
cd order_delivery
  1. Install the dependencies using pip. Activate virtual environment if you use one.
pip3 install -r requirements.txt
  1. Create a .env file and make sure the following variables are set
DJANGO_SECRET_KEY=
DEBUG=
  1. Start the django server
./manage.py runserver

OR

python3 manage.py runserver

Now you should be able to access the Django app running locally at port 8000. Additionally you can specifiy the port for the django app to run in local

./manage.py runserver 0.0.0.0:8080

Now the Django app will be accessible at port 8080

Testing

Few basic test cases are already included for the existing order calculation API which inherits Django's TestCase class.
To run those test cases, run the following command

./manage.py test 

OR

python3 manage.py test

Test case results will be displayed in the terminal.

Tech Stack (Programming Language, Framework(s))

  • Python
  • Django
  • Django Rest Framework

Technical Decisions

  1. Added type annotations and comments everywhere which improves code readability
  2. Used DjangoRestFramework's serializers to validate the request body. Which keeps code readable, modularised and also maintainable.
  3. Used python dictionaries to store distance range and price allotted to the respective distance.
  4. Moved utility functions to utility folder. This should keep them easily accessible instead of searching the whole file.
  5. Constants have a dedicated file in the app which might not change frequently.

Screenshots

  1. With FLAT offer Flat
  2. With DELIVERY offer Delivery
  3. Without OFFER No offer
  4. Order 4 Order 4
  5. Order 5 Order 5
  6. Order 6 Order 6

order_delivery's People

Contributors

shreeharivaasishta avatar

Watchers

James Cloos avatar  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.