# rgh-code/python-django architecture

> Architecture diagram of the GitHub repository rgh-code/python-django, 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/rgh-code/python-django
- Repository: https://github.com/rgh-code/python-django

## Overview

This is a Django storefront API: users enter through project URL routing for authentication, store operations, and playground endpoints. The sampled order service builds an order from either cart contents or a single product and persists order totals. The tree also shows payment, likes, and tagging apps. Source evidence is limited: store views and several app implementations were not excerpted, so their internal calls and most cross-app relationships are not asserted.

Main entry points: [`storefront/urls.py`](https://github.com/rgh-code/python-django/blob/main/storefront/urls.py) (Project routing), [`store/views.py`](https://github.com/rgh-code/python-django/blob/main/store/views.py) (Store endpoints), [`store/models.py`](https://github.com/rgh-code/python-django/blob/main/store/models.py) (Commerce records), [`store/services.py`](https://github.com/rgh-code/python-django/blob/main/store/services.py) (Order service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_router["Project routing<br/>[urls.py]"]
end

subgraph group_commerce["Store commerce"]
  node_store_api["Store endpoints<br/>[views.py]"]
  node_order_service["Order service<br/>[services.py]"]
  node_commerce_models[("Commerce records<br/>[models.py]")]
  node_store_validation["File validation<br/>[validators.py]"]
  node_store_signals["Customer signal<br/>[signals.py]"]
end

subgraph group_identity["Identity"]
  node_google_login["Google login<br/>[views.py]"]
  node_core_routes["Core routes<br/>[urls.py]"]
end

subgraph group_extensions["Store extensions"]
  node_payments["Payment handlers<br/>[views.py]"]
  node_esewa["eSewa integration<br/>[esewa.py]"]
  node_likes["Product likes<br/>[views.py]"]
  node_tags["Tag features<br/>[views.py]"]
  node_playground["Playground endpoints<br/>[views.py]"]
end

subgraph group_async["Async tasks"]
  node_notify_task["Customer notification task<br/>[tasks.py]"]
  node_celery_config["Celery application<br/>[celery.py]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_router
node_router -->|"includes routes"| node_core_routes
node_router -->|"routes store requests"| node_store_api
node_router -->|"routes playground requests"| node_playground
node_core_routes -.->|"routes login"| node_google_login
node_google_login -->|"returns JWT tokens"| node_client
node_order_service -->|"creates and reads"| node_commerce_models
node_store_api -.->|"delegates orders"| node_order_service
node_store_signals -->|"creates customer"| node_commerce_models
node_store_api -.->|"uses records"| node_commerce_models

click node_router "https://github.com/rgh-code/python-django/blob/main/storefront/urls.py"
click node_store_api "https://github.com/rgh-code/python-django/blob/main/store/views.py"
click node_order_service "https://github.com/rgh-code/python-django/blob/main/store/services.py"
click node_commerce_models "https://github.com/rgh-code/python-django/blob/main/store/models.py"
click node_store_validation "https://github.com/rgh-code/python-django/blob/main/store/validators.py"
click node_store_signals "https://github.com/rgh-code/python-django/blob/main/store/signals.py"
click node_google_login "https://github.com/rgh-code/python-django/blob/main/core/views.py"
click node_core_routes "https://github.com/rgh-code/python-django/blob/main/core/urls.py"
click node_payments "https://github.com/rgh-code/python-django/blob/main/payments/views.py"
click node_esewa "https://github.com/rgh-code/python-django/blob/main/payments/esewa.py"
click node_likes "https://github.com/rgh-code/python-django/blob/main/likes/views.py"
click node_tags "https://github.com/rgh-code/python-django/blob/main/tag/views.py"
click node_playground "https://github.com/rgh-code/python-django/blob/main/playground/views.py"
click node_notify_task "https://github.com/rgh-code/python-django/blob/main/playground/tasks.py"
click node_celery_config "https://github.com/rgh-code/python-django/blob/main/storefront/celery.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_router,node_client toneBlue
class node_store_api,node_order_service,node_commerce_models,node_store_validation,node_store_signals toneAmber
class node_google_login,node_core_routes toneMint
class node_payments,node_esewa,node_likes,node_tags,node_playground toneRose
class node_notify_task,node_celery_config toneIndigo
```

## Components

### API entry

- [Project routing](https://github.com/rgh-code/python-django/blob/main/storefront/urls.py): `storefront/urls.py`

### Store commerce

- [Store endpoints](https://github.com/rgh-code/python-django/blob/main/store/views.py): `store/views.py`
- [Order service](https://github.com/rgh-code/python-django/blob/main/store/services.py): `store/services.py`
- [Commerce records](https://github.com/rgh-code/python-django/blob/main/store/models.py): `store/models.py`
- [File validation](https://github.com/rgh-code/python-django/blob/main/store/validators.py): `store/validators.py`
- [Customer signal](https://github.com/rgh-code/python-django/blob/main/store/signals.py): `store/signals.py`

### Identity

- [Google login](https://github.com/rgh-code/python-django/blob/main/core/views.py): `core/views.py`
- [Core routes](https://github.com/rgh-code/python-django/blob/main/core/urls.py): `core/urls.py`

### Store extensions

- [Payment handlers](https://github.com/rgh-code/python-django/blob/main/payments/views.py): `payments/views.py`
- [eSewa integration](https://github.com/rgh-code/python-django/blob/main/payments/esewa.py): `payments/esewa.py`
- [Product likes](https://github.com/rgh-code/python-django/blob/main/likes/views.py): `likes/views.py`
- [Tag features](https://github.com/rgh-code/python-django/blob/main/tag/views.py): `tag/views.py`
- [Playground endpoints](https://github.com/rgh-code/python-django/blob/main/playground/views.py): `playground/views.py`

### Async tasks

- [Customer notification task](https://github.com/rgh-code/python-django/blob/main/playground/tasks.py): `playground/tasks.py`
- [Celery application](https://github.com/rgh-code/python-django/blob/main/storefront/celery.py): `storefront/celery.py`

### Other components

- **API client**

## Connections

- API client → Project routing: sends requests (evidence: `storefront/urls.py`)
- Project routing → Core routes: includes routes (evidence: `storefront/urls.py`)
- Project routing → Store endpoints: routes store requests (evidence: `storefront/urls.py`)
- Project routing → Playground endpoints: routes playground requests (evidence: `storefront/urls.py`)
- Core routes → Google login: routes login
- Google login → API client: returns JWT tokens (evidence: `core/views.py`)
- Order service → Commerce records: creates and reads (evidence: `store/services.py`)
- Store endpoints → Order service: delegates orders
- Customer signal → Commerce records: creates customer (evidence: `store/signals.py`)
- Store endpoints → Commerce records: uses records
