# rehan1504-rehan/northstar_store architecture

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

- Interactive diagram: https://gitdiagram.com/rehan1504-rehan/northstar_store
- Repository: https://github.com/rehan1504-rehan/northstar_store

## Overview

Northstar Store is a Django storefront and simple order-management application. Customers register or sign in, browse and search the catalog, add stock-checked quantities to a persistent cart, and submit shipping details at checkout; the order and item price snapshots are saved while inventory is reduced. Customers can review and cancel eligible orders, which restores stock. Staff manage catalog, images, and order status through Django Admin. The README documents these capabilities; sampled source was limited, so uncertain view-to-model wiring is represented only where clearly supported.

Main entry points: [`store/views.py`](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py) (Store views), [`store/models.py`](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py) (Products and categories), [`ecommerce/settings.py`](https://github.com/rehan1504-rehan/northstar_store/blob/main/ecommerce/settings.py) (Configured database), [`store/context_processors.py`](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/context_processors.py) (Shared page context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_routes["Store routes<br/>[urls.py]"]
  node_views["Store views<br/>[views.py]"]
  node_pages["Store pages"]
  node_browser["Store interactions<br/>[site.js]"]
  node_accounts["Account forms<br/>[forms.py]"]
  node_catalog["Catalog browsing<br/>[views.py]"]
  node_context["Shared page context"]
end

subgraph group_commerce["Commerce"]
  node_cart[("Persistent cart<br/>[models.py]")]
  node_checkout["Checkout and cancellation<br/>[views.py]"]
  node_orders[("Orders and items<br/>[models.py]")]
  node_products[("Products and categories<br/>[models.py]")]
end

subgraph group_operations["Store operations"]
  node_admin["Store admin<br/>[admin.py]"]
  node_auth[("Django accounts<br/>[settings.py]")]
end

subgraph group_platform["Persistence"]
  node_database[("Configured database<br/>[settings.py]")]
  node_media_storage["Image storage<br/>[storage.py]"]
  node_media_files[("Stored media<br/>[models.py]")]
end

node_shopper(("Shopper"))
node_staff(("Staff"))
node_django_admin(("Django Admin"))

node_shopper -->|"requests pages"| node_routes
node_routes -->|"dispatches"| node_views
node_views -->|"renders"| node_pages
node_pages -->|"loads scripts"| node_browser
node_views -->|"validates forms"| node_accounts
node_views -->|"serves catalog"| node_catalog
node_views -->|"queries catalog"| node_products
node_views -->|"updates cart"| node_cart
node_views -->|"handles orders"| node_checkout
node_checkout -->|"creates or cancels"| node_orders
node_checkout -->|"adjusts stock"| node_products
node_views -->|"shows order history"| node_orders
node_admin -->|"manages catalog"| node_products
node_admin -->|"manages orders"| node_orders
node_django_admin -->|"uses"| node_admin
node_staff -->|"operates"| node_django_admin
node_accounts -->|"authenticates users"| node_auth
node_products -->|"stores image files"| node_media_storage
node_media_storage -->|"reads and writes"| node_media_files
node_views -->|"renders shared data"| node_context
node_context -->|"counts cart items"| node_cart
node_context -->|"queries navigation"| node_products
node_cart -->|"persists"| node_database
node_orders -->|"persists"| node_database
node_products -->|"persists"| node_database
node_auth -->|"persists"| node_database
node_media_files -->|"persists bytes"| node_database

click node_routes "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/urls.py"
click node_views "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py"
click node_pages "https://github.com/rehan1504-rehan/northstar_store/tree/main/templates/store"
click node_browser "https://github.com/rehan1504-rehan/northstar_store/blob/main/static/store/js/site.js"
click node_accounts "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/forms.py"
click node_catalog "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py"
click node_cart "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py"
click node_checkout "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py"
click node_orders "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py"
click node_products "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py"
click node_admin "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/admin.py"
click node_auth "https://github.com/rehan1504-rehan/northstar_store/blob/main/ecommerce/settings.py"
click node_database "https://github.com/rehan1504-rehan/northstar_store/blob/main/ecommerce/settings.py"
click node_media_storage "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/storage.py"
click node_media_files "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py"
click node_context "https://github.com/rehan1504-rehan/northstar_store/blob/main/store/context_processors.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_routes,node_views,node_pages,node_browser,node_accounts,node_catalog,node_context toneBlue
class node_cart,node_checkout,node_orders,node_products toneAmber
class node_admin,node_auth toneMint
class node_database,node_media_storage,node_media_files toneRose
class node_shopper,node_staff,node_django_admin toneIndigo
```

## Components

### Storefront

- [Store routes](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/urls.py): `store/urls.py`
- [Store views](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py): `store/views.py`
- [Store pages](https://github.com/rehan1504-rehan/northstar_store/tree/main/templates/store): `templates/store`
- [Store interactions](https://github.com/rehan1504-rehan/northstar_store/blob/main/static/store/js/site.js): `static/store/js/site.js`
- [Account forms](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/forms.py): `store/forms.py`
- [Catalog browsing](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py): `store/views.py`
- [Shared page context](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/context_processors.py): `store/context_processors.py`

### Commerce

- [Persistent cart](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py): `store/models.py`
- [Checkout and cancellation](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/views.py): `store/views.py`
- [Orders and items](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py): `store/models.py`
- [Products and categories](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py): `store/models.py`

### Store operations

- [Store admin](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/admin.py): `store/admin.py`
- [Django accounts](https://github.com/rehan1504-rehan/northstar_store/blob/main/ecommerce/settings.py): `ecommerce/settings.py`

### Persistence

- [Configured database](https://github.com/rehan1504-rehan/northstar_store/blob/main/ecommerce/settings.py): `ecommerce/settings.py`
- [Image storage](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/storage.py): `store/storage.py`
- [Stored media](https://github.com/rehan1504-rehan/northstar_store/blob/main/store/models.py): `store/models.py`

### Other components

- **Shopper**
- **Staff**
- **Django Admin**

## Connections

- Shopper → Store routes: requests pages
- Store routes → Store views: dispatches
- Store views → Store pages: renders
- Store pages → Store interactions: loads scripts
- Store views → Account forms: validates forms
- Store views → Catalog browsing: serves catalog
- Store views → Products and categories: queries catalog
- Store views → Persistent cart: updates cart
- Store views → Checkout and cancellation: handles orders
- Checkout and cancellation → Orders and items: creates or cancels
- Checkout and cancellation → Products and categories: adjusts stock
- Store views → Orders and items: shows order history
- Store admin → Products and categories: manages catalog
- Store admin → Orders and items: manages orders
- Django Admin → Store admin: uses
- Staff → Django Admin: operates
- Account forms → Django accounts: authenticates users
- Products and categories → Image storage: stores image files
- Image storage → Stored media: reads and writes
- Store views → Shared page context: renders shared data
- Shared page context → Persistent cart: counts cart items
- Shared page context → Products and categories: queries navigation
- Persistent cart → Configured database: persists
- Orders and items → Configured database: persists
- Products and categories → Configured database: persists
- Django accounts → Configured database: persists
- Stored media → Configured database: persists bytes
