About the E-Commerce Demo Application

In this post, we describe the features of our simple e-commerce API application, to help you understand the scope of the current codebase and how you will need to work with it.

Overall Features

The application is written in Python using the Django REST framework and has the following components:

  1. A REST API to support a simple e-commerce shopping site, such as browsing products, creating and filling shopping carts, and placing orders based on the contents of a shopping cart.
  2. An administrative user interface for doing back-end administration of the shopping site from a browser. This includes creating and updating product categories, products, and product images, and also correcting customer and order information.
  3. An API testing user interface that supports running the REST APIs from a browser.
  4. A relational database that provides persistent storage for all of the objects the application works with.

Note About URLs

In this post, we will identify URLs using the URL path within the server rather than as fully-qualified URLs. For example, we will identify the administrative URL as /admin rather than http://localhost:8000/admin, or https://myowndomainname.com/admin.

REST API

This section identifies the functions that exist within the REST API and which we will be using. It provides a brief description of what each API does but stops short of documenting the specific parameters and results of each. You can obtain the specific inputs and outputs by using the API testing user interface, which formats all of the API calls using HTML pages. Please see the table below:

API Testing User Interface

The debugging configuration of the application includes web pages that allow you to run the REST APIs and see the results without having to write a client application or use an API utility like Postman. You access these pages by pointing your browser at specific URLs that exist on the server.

Administrative User Interface

You can access the administrative UI from your browser at /admin. This gives a login page, followed by a series of administrative pages. The following pages and functions are available:

User Groups: Define groups with specific administrative privileges that can be applied to multiple users. This is part of the Django REST framework.

Users: Define individual administrative users and their privileges. This is provided by the djoser package within the Django REST Framework.

Store Collections: Define product categories (“collections”) that are used to group products that can be ordered.

Store Products: Define products and product images that can be browsed and ordered on the site.

Store Customers: Manage profiles for customers that shop on the site.

Store Orders: Manage orders that have been created on the site.

Tags: Create and update tags that can be applied to products to support tag-based search and filter.

In order to use these administrative features, you need to set up at least one administrative user id. You create your first admin user using the ‘python manage.py createsuperuser’ what you first set up the application.

Relational Database

The demo application currently uses a relational database to store all of its persistent data. Here is a very distilled entity-relationship diagram (ERD) that identifies the tables and shows the relationships among them: