# kocha-design/random-e-commerce architecture

> Architecture diagram of the GitHub repository kocha-design/random-e-commerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kocha-design/random-e-commerce
- Repository: https://github.com/kocha-design/random-e-commerce

## Overview

Random E-Commerce is a Django multi-vendor marketplace. Guests browse and search active sellers’ products, view listings, and assemble a session cart for WhatsApp ordering; sellers register, await subscription activation, and then manage listings. Admins manually verify subscription payments and manage seller status. The graph also preserves the documented seller-contact and image-gallery capabilities. Edges reflect shown calls, routing, or README statements; unsampled URL wiring and frontend behavior are not inferred beyond documented capabilities.

Main entry points: [`products/views.py`](https://github.com/kocha-design/random-e-commerce/blob/main/products/views.py) (Catalog and listing views), [`products/models.py`](https://github.com/kocha-design/random-e-commerce/blob/main/products/models.py) (Products and categories), [`config/urls.py`](https://github.com/kocha-design/random-e-commerce/blob/main/config/urls.py) (URL routing), [`accounts/views.py`](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/views.py) (Registration and profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_routing["URL routing<br/>[urls.py]"]
  node_account_routes["Account routes<br/>[urls.py]"]
  node_product_routes["Product routes<br/>[urls.py]"]
end

subgraph group_identity["Accounts and subscriptions"]
  node_account_views["Registration and profile<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_seller_gate["Seller access check<br/>[decorators.py]"]
  node_accounts_data[("Users and subscriptions<br/>[models.py]")]
end

subgraph group_market["Marketplace"]
  node_product_views["Catalog and listing views<br/>[views.py]"]
  node_product_forms["Listing form<br/>[forms.py]"]
  node_product_data[("Products and categories<br/>[models.py]")]
  node_cart_views["Cart views<br/>[views.py]"]
  node_cart["Session cart<br/>[cart.py]"]
  node_templates["Marketplace pages"]
  node_whatsapp(("WhatsApp ordering"))
end

subgraph group_operations["Administration"]
  node_admin_ops["Seller and payment admin<br/>[admin.py]"]
  node_product_admin["Catalog admin<br/>[admin.py]"]
end

node_visitor(("Shopper or seller"))
node_admin_user(("Administrator"))

node_visitor -->|"requests pages"| node_routing
node_routing -->|"includes routes"| node_account_routes
node_routing -->|"includes routes"| node_product_routes
node_account_routes -->|"routes to"| node_account_views
node_product_routes -->|"routes to"| node_product_views
node_account_views -->|"validates registration"| node_account_forms
node_account_forms -->|"creates seller"| node_accounts_data
node_product_views -->|"guards seller actions"| node_seller_gate
node_seller_gate -->|"checks activation"| node_accounts_data
node_product_views -->|"validates listings"| node_product_forms
node_product_forms -->|"saves product"| node_product_data
node_product_views -->|"queries catalog"| node_product_data
node_product_views -->|"renders pages"| node_templates
node_account_views -->|"renders account pages"| node_templates
node_product_views -->|"uses session cart"| node_cart
node_cart -->|"loads products"| node_product_data
node_cart_views -->|"provides order link"| node_whatsapp
node_admin_user -->|"manages subscriptions"| node_admin_ops
node_admin_user -->|"manages catalog"| node_product_admin
node_admin_ops -->|"confirms payments"| node_accounts_data
node_product_admin -->|"registers models"| node_product_data

click node_routing "https://github.com/kocha-design/random-e-commerce/blob/main/config/urls.py"
click node_account_routes "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/urls.py"
click node_product_routes "https://github.com/kocha-design/random-e-commerce/blob/main/products/urls.py"
click node_account_views "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/views.py"
click node_account_forms "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/forms.py"
click node_seller_gate "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/decorators.py"
click node_accounts_data "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/models.py"
click node_product_views "https://github.com/kocha-design/random-e-commerce/blob/main/products/views.py"
click node_product_forms "https://github.com/kocha-design/random-e-commerce/blob/main/products/forms.py"
click node_product_data "https://github.com/kocha-design/random-e-commerce/blob/main/products/models.py"
click node_cart_views "https://github.com/kocha-design/random-e-commerce/blob/main/products/views.py"
click node_cart "https://github.com/kocha-design/random-e-commerce/blob/main/products/cart.py"
click node_templates "https://github.com/kocha-design/random-e-commerce/tree/main/templates"
click node_admin_ops "https://github.com/kocha-design/random-e-commerce/blob/main/accounts/admin.py"
click node_product_admin "https://github.com/kocha-design/random-e-commerce/blob/main/products/admin.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_routing,node_account_routes,node_product_routes toneBlue
class node_account_views,node_account_forms,node_seller_gate,node_accounts_data toneAmber
class node_product_views,node_product_forms,node_product_data,node_cart_views,node_cart,node_templates,node_whatsapp toneMint
class node_admin_ops,node_product_admin toneRose
class node_visitor,node_admin_user toneIndigo
```

## Components

### Web entry

- [URL routing](https://github.com/kocha-design/random-e-commerce/blob/main/config/urls.py): `config/urls.py`
- [Account routes](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/urls.py): `accounts/urls.py`
- [Product routes](https://github.com/kocha-design/random-e-commerce/blob/main/products/urls.py): `products/urls.py`

### Accounts and subscriptions

- [Registration and profile](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/views.py): `accounts/views.py`
- [Account forms](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/forms.py): `accounts/forms.py`
- [Seller access check](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/decorators.py): `accounts/decorators.py`
- [Users and subscriptions](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/models.py): `accounts/models.py`

### Marketplace

- [Catalog and listing views](https://github.com/kocha-design/random-e-commerce/blob/main/products/views.py): `products/views.py`
- [Listing form](https://github.com/kocha-design/random-e-commerce/blob/main/products/forms.py): `products/forms.py`
- [Products and categories](https://github.com/kocha-design/random-e-commerce/blob/main/products/models.py): `products/models.py`
- [Cart views](https://github.com/kocha-design/random-e-commerce/blob/main/products/views.py): `products/views.py`
- [Session cart](https://github.com/kocha-design/random-e-commerce/blob/main/products/cart.py): `products/cart.py`
- [Marketplace pages](https://github.com/kocha-design/random-e-commerce/tree/main/templates): `templates`
- **WhatsApp ordering**

### Administration

- [Seller and payment admin](https://github.com/kocha-design/random-e-commerce/blob/main/accounts/admin.py): `accounts/admin.py`
- [Catalog admin](https://github.com/kocha-design/random-e-commerce/blob/main/products/admin.py): `products/admin.py`

### Other components

- **Shopper or seller**
- **Administrator**

## Connections

- Shopper or seller → URL routing: requests pages (evidence: `README.md`)
- URL routing → Account routes: includes routes (evidence: `config/urls.py`)
- URL routing → Product routes: includes routes (evidence: `config/urls.py`)
- Account routes → Registration and profile: routes to (evidence: `accounts/urls.py`)
- Product routes → Catalog and listing views: routes to (evidence: `products/urls.py`)
- Registration and profile → Account forms: validates registration (evidence: `accounts/views.py`)
- Account forms → Users and subscriptions: creates seller (evidence: `accounts/forms.py`)
- Catalog and listing views → Seller access check: guards seller actions (evidence: `products/views.py`)
- Seller access check → Users and subscriptions: checks activation (evidence: `accounts/decorators.py`)
- Catalog and listing views → Listing form: validates listings (evidence: `products/views.py`)
- Listing form → Products and categories: saves product (evidence: `products/forms.py`)
- Catalog and listing views → Products and categories: queries catalog (evidence: `products/views.py`)
- Catalog and listing views → Marketplace pages: renders pages (evidence: `products/views.py`)
- Registration and profile → Marketplace pages: renders account pages (evidence: `accounts/views.py`)
- Catalog and listing views → Session cart: uses session cart (evidence: `products/views.py`)
- Session cart → Products and categories: loads products (evidence: `products/cart.py`)
- Cart views → WhatsApp ordering: provides order link (evidence: `README.md`)
- Administrator → Seller and payment admin: manages subscriptions (evidence: `README.md`)
- Administrator → Catalog admin: manages catalog (evidence: `products/admin.py`)
- Seller and payment admin → Users and subscriptions: confirms payments (evidence: `accounts/admin.py`)
- Catalog admin → Products and categories: registers models (evidence: `products/admin.py`)
