# fl4viooliveira/django_ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/fl4viooliveira/django_ecommerce
- Repository: https://github.com/fl4viooliveira/django_ecommerce

## Overview

This is a Django e-commerce application. Shoppers browse products, add variants to a session-backed order, provide addresses, and complete payment through PayPal or Stripe; staff maintain the catalog and review orders. Account authentication, profiles, and contact messaging are additional user-facing capabilities. The graph follows documented routes and indexed source references; some view implementations and integrations are only partially excerpted, so those links are limited to the visible evidence.

Main entry points: [`cart/models.py`](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/models.py) (Catalog and order records), [`cart/views.py`](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py) (Shop and cart views), [`ecom/urls.py`](https://github.com/fl4viooliveira/django_ecommerce/blob/master/ecom/urls.py) (Project URL routing), [`core/views.py`](https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/views.py) (Profile and contact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront and cart"]
  node_cart_views["Shop and cart views<br/>[views.py]"]
  node_cart_forms["Cart forms<br/>[forms.py]"]
  node_cart_utils["Cart session helper<br/>[utils.py]"]
  node_cart_tags["Cart count tag"]
  node_catalog_data[("Catalog and order records<br/>[models.py]")]
end

subgraph group_payment["Checkout and payment"]
  node_checkout["Address and checkout<br/>[views.py]"]
  node_paypal["PayPal confirmation<br/>[views.py]"]
  node_stripe["Stripe payment and webhook<br/>[views.py]"]
end

subgraph group_operations["Accounts and operations"]
  node_customer_data[("Customer records<br/>[models.py]")]
  node_account_flow["Profile and contact<br/>[views.py]"]
  node_contact_form["Contact form<br/>[forms.py]"]
  node_staff_views["Staff catalog and orders<br/>[views.py]"]
  node_staff_forms["Staff product form<br/>[forms.py]"]
  node_staff_access["Staff access mixin<br/>[mixins.py]"]
end

subgraph group_platform["Application platform"]
  node_routes["Project URL routing<br/>[urls.py]"]
  node_settings["Django settings<br/>[main.py]"]
end

node_shopper(("Shopper"))
node_stripe_service{{"Stripe"}}
node_paypal_service{{"PayPal"}}
node_database[("PostgreSQL database")]
node_mail{{"Email service"}}
node_visitor(("Site visitor"))

node_shopper -->|"requests pages"| node_routes
node_routes -->|"routes home/profile/contact"| node_account_flow
node_routes -->|"includes cart routes"| node_cart_views
node_routes -->|"includes staff routes"| node_staff_views
node_cart_views -->|"uses forms"| node_cart_forms
node_cart_views -->|"queries and updates"| node_catalog_data
node_cart_views -->|"gets session order"| node_cart_utils
node_cart_forms -->|"validates against"| node_catalog_data
node_cart_tags -->|"gets session order"| node_cart_utils
node_cart_views -->|"handles checkout"| node_checkout
node_checkout -->|"creates payment intent"| node_stripe_service
node_stripe -->|"verifies webhook"| node_stripe_service
node_checkout -->|"records Stripe payment"| node_catalog_data
node_stripe -->|"marks order paid"| node_catalog_data
node_paypal -->|"records confirmation"| node_catalog_data
node_paypal -.->|"accepts PayPal result"| node_paypal_service
node_account_flow -->|"reads order history"| node_catalog_data
node_account_flow -->|"validates contact"| node_contact_form
node_account_flow -->|"sends contact message"| node_mail
node_staff_views -->|"manages products and orders"| node_catalog_data
node_staff_views -->|"uses product form"| node_staff_forms
node_staff_views -->|"checks staff access"| node_staff_access
node_settings -->|"configures PostgreSQL"| node_database
node_customer_data -.->|"persists customer records"| node_database
node_catalog_data -.->|"persists commerce records"| node_database
node_visitor -.->|"visits storefront"| node_routes
node_customer_data -.->|"associates user orders"| node_catalog_data

click node_cart_views "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py"
click node_cart_forms "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/forms.py"
click node_cart_utils "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/utils.py"
click node_cart_tags "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/templatetags/cart_template_tags.py"
click node_catalog_data "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/models.py"
click node_checkout "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py"
click node_paypal "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py"
click node_stripe "https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py"
click node_customer_data "https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/models.py"
click node_account_flow "https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/views.py"
click node_contact_form "https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/forms.py"
click node_staff_views "https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/views.py"
click node_staff_forms "https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/forms.py"
click node_staff_access "https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/mixins.py"
click node_routes "https://github.com/fl4viooliveira/django_ecommerce/blob/master/ecom/urls.py"
click node_settings "https://github.com/fl4viooliveira/django_ecommerce/blob/master/ecom/settings/main.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_cart_views,node_cart_forms,node_cart_utils,node_cart_tags,node_catalog_data toneBlue
class node_checkout,node_paypal,node_stripe,node_database toneAmber
class node_customer_data,node_account_flow,node_contact_form,node_staff_views,node_staff_forms,node_staff_access toneMint
class node_routes,node_settings toneRose
class node_shopper,node_stripe_service,node_paypal_service,node_mail,node_visitor toneIndigo
```

## Components

### Storefront and cart

- [Shop and cart views](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py): `cart/views.py`
- [Cart forms](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/forms.py): `cart/forms.py`
- [Cart session helper](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/utils.py): `cart/utils.py`
- [Cart count tag](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/templatetags/cart_template_tags.py): `cart/templatetags/cart_template_tags.py`
- [Catalog and order records](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/models.py): `cart/models.py`

### Checkout and payment

- [Address and checkout](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py): `cart/views.py`
- [PayPal confirmation](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py): `cart/views.py`
- [Stripe payment and webhook](https://github.com/fl4viooliveira/django_ecommerce/blob/master/cart/views.py): `cart/views.py`

### Accounts and operations

- [Customer records](https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/models.py): `core/models.py`
- [Profile and contact](https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/views.py): `core/views.py`
- [Contact form](https://github.com/fl4viooliveira/django_ecommerce/blob/master/core/forms.py): `core/forms.py`
- [Staff catalog and orders](https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/views.py): `staff/views.py`
- [Staff product form](https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/forms.py): `staff/forms.py`
- [Staff access mixin](https://github.com/fl4viooliveira/django_ecommerce/blob/master/staff/mixins.py): `staff/mixins.py`

### Application platform

- [Project URL routing](https://github.com/fl4viooliveira/django_ecommerce/blob/master/ecom/urls.py): `ecom/urls.py`
- [Django settings](https://github.com/fl4viooliveira/django_ecommerce/blob/master/ecom/settings/main.py): `ecom/settings/main.py`

### Other components

- **Shopper**
- **Stripe**
- **PayPal**
- **PostgreSQL database**
- **Email service**
- **Site visitor**

## Connections

- Shopper → Project URL routing: requests pages (evidence: `ecom/urls.py`)
- Project URL routing → Profile and contact: routes home/profile/contact (evidence: `ecom/urls.py`)
- Project URL routing → Shop and cart views: includes cart routes (evidence: `ecom/urls.py`)
- Project URL routing → Staff catalog and orders: includes staff routes (evidence: `ecom/urls.py`)
- Shop and cart views → Cart forms: uses forms (evidence: `cart/views.py`)
- Shop and cart views → Catalog and order records: queries and updates (evidence: `cart/views.py`)
- Shop and cart views → Cart session helper: gets session order (evidence: `cart/views.py`)
- Cart forms → Catalog and order records: validates against (evidence: `cart/forms.py`)
- Cart count tag → Cart session helper: gets session order (evidence: `cart/templatetags/cart_template_tags.py`)
- Shop and cart views → Address and checkout: handles checkout (evidence: `cart/views.py`)
- Address and checkout → Stripe: creates payment intent (evidence: `cart/views.py`)
- Stripe payment and webhook → Stripe: verifies webhook (evidence: `cart/views.py`)
- Address and checkout → Catalog and order records: records Stripe payment (evidence: `cart/views.py`)
- Stripe payment and webhook → Catalog and order records: marks order paid (evidence: `cart/views.py`)
- PayPal confirmation → Catalog and order records: records confirmation (evidence: `cart/views.py`)
- PayPal confirmation → PayPal: accepts PayPal result
- Profile and contact → Catalog and order records: reads order history (evidence: `core/views.py`)
- Profile and contact → Contact form: validates contact (evidence: `core/views.py`)
- Profile and contact → Email service: sends contact message (evidence: `core/views.py`)
- Staff catalog and orders → Catalog and order records: manages products and orders (evidence: `staff/views.py`)
- Staff catalog and orders → Staff product form: uses product form (evidence: `staff/views.py`)
- Staff catalog and orders → Staff access mixin: checks staff access (evidence: `staff/views.py`)
- Django settings → PostgreSQL database: configures PostgreSQL (evidence: `ecom/settings/main.py`)
- Customer records → PostgreSQL database: persists customer records
- Catalog and order records → PostgreSQL database: persists commerce records
- Site visitor → Project URL routing: visits storefront
- Customer records → Catalog and order records: associates user orders
