Git Product home page Git Product logo

notarious2 / django-pizza-delivery Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 8.87 MB

Django 4.0, JS, Ajax and Tailwind CSS built Pizza Website for Carryout and Delivery, Cash payment option and Stripe Payment Integration, as well as Guest checkout feature. Product may contain multiple size variations with different prices. Website allows to use Coupon codes.

License: MIT License

Python 31.07% HTML 11.65% CSS 36.22% JavaScript 21.07%
django ajax eccommerce pizza-delivery stripe stripeapi tailwind tailwindcss guest-checkout black coverage-testing django-test django-testing ecommerce-application ecommerce-website github-actions pizza-website

django-pizza-delivery's Introduction

Django Pizza Delivery App

Live Demo

Visit https://notarious2.pythonanywhere.com/

Front page

Admin credentials:

https://notarious2.pythonanywhere.com/admin/

login: admin/[email protected]
password: admin

This e-commerce app was built using the following technologies:

Django TailwindCSS Stripe JQuery

Features

  • Customer Registration, Login and Logout. Customers may login with either email or username

  • Customer and Guest Checkout (using device ID set in Cookies)

  • Delivery and Carry-out option

  • Special Orders tab for registered users to view completed orders

  • Deferred Cash payment and Instant online payment with Stripe

  • 99% test coverage with 100+ of both functional and unit tests

SQL Relational Schema

The app uses SQLite database. Relational representation of Django Models used in ePizza app are provided below.

SQL model

Coupons

3 coupons (integrated with Stripe Payment Gateway) are available at Checkout

WINTER: 50% off the order total

SUMMER: $10 off the order total

App Setup

Clone Repository:

git clone https://github.com/notarious2/Django-Pizza-Delivery.git
cd Django-Pizza-Delivery

Configure Environmental variables:
inside 'epizza' folder add .env file and add Secret Key, Stripe Publishable Key and Stripe Secret Key:

SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=

To test Stripe's Percent Coupon (otherwise tests are automatically skipped) add:

STRIPE_COUPON_ID_PERCENT=

Create and Activate Virtual Environment:

virtualenv env
env\Scripts\activate

Install Dependencies:

pip install -r requirements.txt

Run Development Server:

python manage.py runserver

Tailwind CSS Setup

You must have Node.js installed in your PC
Tailwind Directives are in store/static/store/src/input.css
Output (autogenerated) stored in store/static/store/src/styles.css

Install Dependencies:

npm install

Start Tailwind CLI build process

runs: "tailwind build -i store/static/store/src/input.css -o store/static/store/src/styles.css --watch" Script inside package.json

npm run build

Functional and Unit Tests

The project contains 60+ both functional and unit tests.

Unit tests cover urls, models, forms and views

Functional testing is done using Selenium and django's StaticLiveServerTestCase

Run all tests

python manage.py test

Run functional tests

Located in functional tests folder of a root directory. to see the testing process remove options.add_argument('headless') in SetUp of each functional test

python manage.py test functional_tests

Run unit tests

python manage.py test users store orders

Test coverage report

coverage run manage.py test

to show report in command line:

coverage report

generates html report in test_coverage_report folder

coverage html

django-pizza-delivery's People

Contributors

notarious2 avatar

Stargazers

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