GithubHelp home page GithubHelp logo

eshop's Introduction

e-Shop Menu Application

e-Shop like Application managing Products and Categories tree menu for Python 3.5

Requires django 1.10 and psycopg2 libraries

Getting started

Running unit tests

Using tox basic dependencies are installed. Unit Tests uses in-memory DB.

pip install tox
tox -r

Install application dependencies

pyvenv env
. env/bin/activate
pip install -r requirements_run.txt

Setup postgres DB

Create eshop database and eshopuser. Assuming postgres DB on localhost. Modify database settings @ eshop/settings.py

CREATE DATABASE eshop;
CREATE USER eshopuser WITH PASSWORD 'password';
ALTER ROLE eshopuser SET client_encoding TO 'utf8';
ALTER ROLE eshopuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE eshopuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE ehop TO eshopuser;

###Running migrations

python eshop/manage.py migrate

Running stress test

Testing application performance when 10 000 active products added to the DB with many categories and subcategories

python eshop/manage.py stress_test

Running unit test manually

python eshop/manage.py test --settings eshop.test_settings

Create application superuser

python eshop/manage.py createsuperuser

Running web application

python eshop/manage.py runserver

Application Overview

Application specification doc is here. Application display Read-Only Menu of active Products and Categories @ index url. Under /admin site logged in users are allowed to add Categories and Products.

Additional behaviour assumptions done:

  • Model Validations added
    • Category can not be a parent for itself
    • Sub_categories can not be assigned to multiple categories
  • If product is inactive it is not shown in Read-Only Menu and not included to the 'active product count' (N)
  • DB is optimize to read data: Create and Delete new products and categories can take quite long time to optimise retrieve of data (db_index used)
  • Product can be added to different categories multiple times, then total product count adds it multiple times

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.