# flatplanet/django-ecommerce architecture

> Architecture diagram of the GitHub repository flatplanet/django-ecommerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flatplanet/django-ecommerce
- Repository: https://github.com/flatplanet/django-ecommerce

## Overview

This Django e-commerce application lets shoppers browse and search a product catalog, manage a session-backed cart, provide shipping details, and proceed to PayPal checkout; order creation and shipping-status management are also present. The main request flow is routed through the project URL configuration to store, cart, or payment views. Those views use catalog, profile, cart, and order models. The excerpts show these interactions, but not PayPal’s callback handling or template behavior, so those are not expanded here.

Main entry points: [`payment/views.py`](https://github.com/flatplanet/django-ecommerce/blob/main/payment/views.py) (Checkout and Orders), [`store/views.py`](https://github.com/flatplanet/django-ecommerce/blob/main/store/views.py) (Catalog and Accounts), [`ecom/urls.py`](https://github.com/flatplanet/django-ecommerce/blob/main/ecom/urls.py) (Project Routes), [`cart/cart.py`](https://github.com/flatplanet/django-ecommerce/blob/main/cart/cart.py) (Cart Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Routing and Configuration"]
  node_project_routes["Project Routes<br/>[urls.py]"]
  node_project_settings["Django Settings<br/>[settings.py]"]
  node_store_routes["Store Routes<br/>[urls.py]"]
  node_cart_routes["Cart Routes<br/>[urls.py]"]
  node_payment_routes["Payment Routes<br/>[urls.py]"]
end

subgraph group_catalog["Store and Accounts"]
  node_storefront["Catalog and Accounts<br/>[views.py]"]
  node_store_forms["Account Forms<br/>[forms.py]"]
  node_store_data[("Catalog and Profiles<br/>[models.py]")]
end

subgraph group_cart["Shopping Cart"]
  node_cart_handlers["Cart Handlers<br/>[views.py]"]
  node_cart_engine["Cart Engine<br/>[cart.py]"]
end

subgraph group_checkout["Checkout and Orders"]
  node_payment_handlers["Checkout and Orders<br/>[views.py]"]
  node_payment_forms["Shipping and Payment Forms<br/>[forms.py]"]
  node_order_data[("Shipping and Order Data<br/>[models.py]")]
end

node_shopper(("Shopper"))
node_admin(("Store Admin"))
node_session_store[("Django Session")]
node_postgres[("PostgreSQL")]
node_paypal["PayPal"]

node_shopper -->|"requests pages"| node_project_routes
node_admin -->|"requests admin"| node_project_routes
node_project_routes -->|"routes store"| node_store_routes
node_project_routes -->|"routes cart"| node_cart_routes
node_project_routes -->|"routes payment"| node_payment_routes
node_project_routes -->|"loads settings"| node_project_settings
node_store_routes -->|"dispatches requests"| node_storefront
node_cart_routes -->|"dispatches requests"| node_cart_handlers
node_payment_routes -->|"dispatches requests"| node_payment_handlers
node_storefront -->|"queries and updates"| node_store_data
node_storefront -->|"uses forms"| node_store_forms
node_storefront -->|"uses shipping form"| node_payment_forms
node_storefront -->|"reads shipping"| node_order_data
node_storefront -->|"restores saved cart"| node_cart_engine
node_cart_handlers -->|"updates cart"| node_cart_engine
node_cart_engine -->|"looks up products and profiles"| node_store_data
node_cart_engine -->|"reads and writes session"| node_session_store
node_payment_handlers -->|"reads cart totals"| node_cart_engine
node_payment_handlers -->|"uses checkout forms"| node_payment_forms
node_payment_handlers -->|"creates and updates orders"| node_order_data
node_payment_handlers -->|"reads products and profiles"| node_store_data
node_payment_handlers -->|"reads shipping session"| node_session_store
node_payment_handlers -->|"builds payment form"| node_paypal
node_project_settings -->|"configures database"| node_postgres
node_store_data -.->|"persists models"| node_postgres
node_order_data -.->|"persists models"| node_postgres

click node_project_routes "https://github.com/flatplanet/django-ecommerce/blob/main/ecom/urls.py"
click node_project_settings "https://github.com/flatplanet/django-ecommerce/blob/main/ecom/settings.py"
click node_store_routes "https://github.com/flatplanet/django-ecommerce/blob/main/store/urls.py"
click node_cart_routes "https://github.com/flatplanet/django-ecommerce/blob/main/cart/urls.py"
click node_payment_routes "https://github.com/flatplanet/django-ecommerce/blob/main/payment/urls.py"
click node_storefront "https://github.com/flatplanet/django-ecommerce/blob/main/store/views.py"
click node_store_forms "https://github.com/flatplanet/django-ecommerce/blob/main/store/forms.py"
click node_store_data "https://github.com/flatplanet/django-ecommerce/blob/main/store/models.py"
click node_cart_handlers "https://github.com/flatplanet/django-ecommerce/blob/main/cart/views.py"
click node_cart_engine "https://github.com/flatplanet/django-ecommerce/blob/main/cart/cart.py"
click node_payment_handlers "https://github.com/flatplanet/django-ecommerce/blob/main/payment/views.py"
click node_payment_forms "https://github.com/flatplanet/django-ecommerce/blob/main/payment/forms.py"
click node_order_data "https://github.com/flatplanet/django-ecommerce/blob/main/payment/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_project_routes,node_project_settings,node_store_routes,node_cart_routes,node_payment_routes toneBlue
class node_storefront,node_store_forms,node_store_data,node_session_store,node_postgres toneAmber
class node_cart_handlers,node_cart_engine toneMint
class node_payment_handlers,node_payment_forms,node_order_data toneRose
class node_shopper,node_admin,node_paypal toneIndigo
```

## Components

### Routing and Configuration

- [Project Routes](https://github.com/flatplanet/django-ecommerce/blob/main/ecom/urls.py): `ecom/urls.py`
- [Django Settings](https://github.com/flatplanet/django-ecommerce/blob/main/ecom/settings.py): `ecom/settings.py`
- [Store Routes](https://github.com/flatplanet/django-ecommerce/blob/main/store/urls.py): `store/urls.py`
- [Cart Routes](https://github.com/flatplanet/django-ecommerce/blob/main/cart/urls.py): `cart/urls.py`
- [Payment Routes](https://github.com/flatplanet/django-ecommerce/blob/main/payment/urls.py): `payment/urls.py`

### Store and Accounts

- [Catalog and Accounts](https://github.com/flatplanet/django-ecommerce/blob/main/store/views.py): `store/views.py`
- [Account Forms](https://github.com/flatplanet/django-ecommerce/blob/main/store/forms.py): `store/forms.py`
- [Catalog and Profiles](https://github.com/flatplanet/django-ecommerce/blob/main/store/models.py): `store/models.py`

### Shopping Cart

- [Cart Handlers](https://github.com/flatplanet/django-ecommerce/blob/main/cart/views.py): `cart/views.py`
- [Cart Engine](https://github.com/flatplanet/django-ecommerce/blob/main/cart/cart.py): `cart/cart.py`

### Checkout and Orders

- [Checkout and Orders](https://github.com/flatplanet/django-ecommerce/blob/main/payment/views.py): `payment/views.py`
- [Shipping and Payment Forms](https://github.com/flatplanet/django-ecommerce/blob/main/payment/forms.py): `payment/forms.py`
- [Shipping and Order Data](https://github.com/flatplanet/django-ecommerce/blob/main/payment/models.py): `payment/models.py`

### Other components

- **Shopper**
- **Store Admin**
- **Django Session**
- **PostgreSQL**
- **PayPal**

## Connections

- Shopper → Project Routes: requests pages (evidence: `ecom/urls.py`)
- Store Admin → Project Routes: requests admin (evidence: `ecom/urls.py`)
- Project Routes → Store Routes: routes store (evidence: `ecom/urls.py`)
- Project Routes → Cart Routes: routes cart (evidence: `ecom/urls.py`)
- Project Routes → Payment Routes: routes payment (evidence: `ecom/urls.py`)
- Project Routes → Django Settings: loads settings (evidence: `ecom/urls.py`)
- Store Routes → Catalog and Accounts: dispatches requests (evidence: `store/urls.py`)
- Cart Routes → Cart Handlers: dispatches requests (evidence: `cart/urls.py`)
- Payment Routes → Checkout and Orders: dispatches requests (evidence: `payment/urls.py`)
- Catalog and Accounts → Catalog and Profiles: queries and updates (evidence: `store/views.py`)
- Catalog and Accounts → Account Forms: uses forms (evidence: `store/views.py`)
- Catalog and Accounts → Shipping and Payment Forms: uses shipping form (evidence: `store/views.py`)
- Catalog and Accounts → Shipping and Order Data: reads shipping (evidence: `store/views.py`)
- Catalog and Accounts → Cart Engine: restores saved cart (evidence: `store/views.py`)
- Cart Handlers → Cart Engine: updates cart (evidence: `cart/views.py`)
- Cart Engine → Catalog and Profiles: looks up products and profiles (evidence: `cart/cart.py`)
- Cart Engine → Django Session: reads and writes session (evidence: `cart/cart.py`)
- Checkout and Orders → Cart Engine: reads cart totals (evidence: `payment/views.py`)
- Checkout and Orders → Shipping and Payment Forms: uses checkout forms (evidence: `payment/views.py`)
- Checkout and Orders → Shipping and Order Data: creates and updates orders (evidence: `payment/views.py`)
- Checkout and Orders → Catalog and Profiles: reads products and profiles (evidence: `payment/views.py`)
- Checkout and Orders → Django Session: reads shipping session (evidence: `payment/views.py`)
- Checkout and Orders → PayPal: builds payment form (evidence: `payment/views.py`)
- Django Settings → PostgreSQL: configures database (evidence: `ecom/settings.py`)
- Catalog and Profiles → PostgreSQL: persists models
- Shipping and Order Data → PostgreSQL: persists models
