# shaanms/hungrio architecture

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

- Interactive diagram: https://gitdiagram.com/shaanms/hungrio
- Repository: https://github.com/shaanms/hungrio

## Overview

Hungrio is a Django restaurant-ordering platform. A customer browses the menu, authenticates, builds a cart, checks out through Stripe, and receives order confirmation; payment webhooks update order/payment state and trigger invoice and email tasks. The graph includes README-documented capabilities whose implementation was not sampled. Edges for those capabilities cite the README; source-backed payment and task relationships cite the shown modules. The runtime excerpts do not establish wiring for every advertised feature.

Main entry points: [`order/models.py`](https://github.com/shaanms/hungrio/blob/main/order/models.py) (Orders), [`product/restaurant_frontend/js`](https://github.com/shaanms/hungrio/tree/main/product/restaurant_frontend/js) (Ordering frontend), [`order_payment/views.py`](https://github.com/shaanms/hungrio/blob/main/order_payment/views.py) (Checkout API), [`order/tasks.py`](https://github.com/shaanms/hungrio/blob/main/order/tasks.py) (Confirmation task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_web["Ordering frontend"]
  node_catalog["Menu catalog"]
  node_category["Categories"]
end

subgraph group_identity["Identity &amp; discovery"]
  node_identity["Accounts &amp; CAPTCHA"]
end

subgraph group_commerce["Cart &amp; payment"]
  node_cart[("Cart")]
  node_wishlist[("Wishlist")]
  node_checkout["Checkout API<br/>[views.py]"]
  node_payments[("Payment records<br/>[models.py]")]
  node_webhook["Stripe webhook<br/>[views.py]"]
end

subgraph group_fulfillment["Orders &amp; follow-up"]
  node_orders[("Orders<br/>[models.py]")]
  node_stock[("Stock &amp; capacity")]
  node_receipt["Receipts"]
  node_refund["Refunds"]
  node_complaints["Complaints"]
  node_invoices["Invoice generation<br/>[stripe.py]"]
end

subgraph group_platform["Runtime services"]
  node_invoice_task["Invoice task<br/>[tasks.py]"]
  node_email_task["Confirmation task<br/>[tasks.py]"]
  node_celery["Celery worker<br/>[celery.py]"]
end

node_customer(("Customer"))
node_stripe["Stripe"]
node_brevo["Brevo email"]
node_database[("PostgreSQL")]

node_customer -->|"uses"| node_web
node_web -->|"browses"| node_catalog
node_web -->|"signs in"| node_identity
node_web -->|"adds items"| node_cart
node_web -->|"saves items"| node_wishlist
node_web -->|"checks out"| node_checkout
node_catalog -.->|"organized by"| node_category
node_checkout -->|"reads items"| node_cart
node_checkout -->|"creates"| node_orders
node_checkout -->|"creates"| node_payments
node_checkout -->|"creates intent"| node_stripe
node_stripe -->|"sends events"| node_webhook
node_webhook -->|"updates status"| node_orders
node_webhook -->|"updates status"| node_payments
node_webhook -->|"queues email"| node_email_task
node_webhook -->|"queues invoice"| node_invoice_task
node_invoice_task -->|"generates"| node_invoices
node_invoices -->|"creates invoice"| node_stripe
node_invoices -->|"reads order"| node_orders
node_email_task -->|"reads order"| node_orders
node_email_task -->|"reads payment"| node_payments
node_email_task -->|"sends email"| node_brevo
node_celery -->|"discovers tasks"| node_email_task
node_celery -->|"discovers tasks"| node_invoice_task
node_orders -->|"persists"| node_database
node_payments -->|"persists"| node_database
node_customer -.->|"availability"| node_stock
node_orders -.->|"receipt details"| node_receipt
node_orders -.->|"refund handling"| node_refund
node_customer -.->|"reports issue"| node_complaints

click node_web "https://github.com/shaanms/hungrio/tree/main/product/restaurant_frontend/js"
click node_catalog "https://github.com/shaanms/hungrio/tree/main/product"
click node_category "https://github.com/shaanms/hungrio/tree/main/category"
click node_identity "https://github.com/shaanms/hungrio/tree/main/accounts"
click node_cart "https://github.com/shaanms/hungrio/tree/main/cart"
click node_wishlist "https://github.com/shaanms/hungrio/tree/main/wishlist"
click node_checkout "https://github.com/shaanms/hungrio/blob/main/order_payment/views.py"
click node_orders "https://github.com/shaanms/hungrio/blob/main/order/models.py"
click node_payments "https://github.com/shaanms/hungrio/blob/main/order_payment/models.py"
click node_webhook "https://github.com/shaanms/hungrio/blob/main/order_payment/views.py"
click node_stock "https://github.com/shaanms/hungrio/tree/main/stock_and_capacity"
click node_receipt "https://github.com/shaanms/hungrio/tree/main/receipt"
click node_refund "https://github.com/shaanms/hungrio/tree/main/refund"
click node_complaints "https://github.com/shaanms/hungrio/tree/main/complaint"
click node_invoices "https://github.com/shaanms/hungrio/blob/main/invoice/services/stripe.py"
click node_invoice_task "https://github.com/shaanms/hungrio/blob/main/invoice/tasks.py"
click node_email_task "https://github.com/shaanms/hungrio/blob/main/order/tasks.py"
click node_celery "https://github.com/shaanms/hungrio/blob/main/restaurant/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_web,node_catalog,node_category toneBlue
class node_identity,node_database toneAmber
class node_cart,node_wishlist,node_checkout,node_payments,node_webhook toneMint
class node_orders,node_stock,node_receipt,node_refund,node_complaints,node_invoices toneRose
class node_invoice_task,node_email_task,node_celery,node_customer,node_stripe,node_brevo toneIndigo
```

## Components

### Storefront

- [Ordering frontend](https://github.com/shaanms/hungrio/tree/main/product/restaurant_frontend/js): `product/restaurant_frontend/js`
- [Menu catalog](https://github.com/shaanms/hungrio/tree/main/product): `product`
- [Categories](https://github.com/shaanms/hungrio/tree/main/category): `category`

### Identity & discovery

- [Accounts & CAPTCHA](https://github.com/shaanms/hungrio/tree/main/accounts): `accounts`

### Cart & payment

- [Cart](https://github.com/shaanms/hungrio/tree/main/cart): `cart`
- [Wishlist](https://github.com/shaanms/hungrio/tree/main/wishlist): `wishlist`
- [Checkout API](https://github.com/shaanms/hungrio/blob/main/order_payment/views.py): `order_payment/views.py`
- [Payment records](https://github.com/shaanms/hungrio/blob/main/order_payment/models.py): `order_payment/models.py`
- [Stripe webhook](https://github.com/shaanms/hungrio/blob/main/order_payment/views.py): `order_payment/views.py`

### Orders & follow-up

- [Orders](https://github.com/shaanms/hungrio/blob/main/order/models.py): `order/models.py`
- [Stock & capacity](https://github.com/shaanms/hungrio/tree/main/stock_and_capacity): `stock_and_capacity`
- [Receipts](https://github.com/shaanms/hungrio/tree/main/receipt): `receipt`
- [Refunds](https://github.com/shaanms/hungrio/tree/main/refund): `refund`
- [Complaints](https://github.com/shaanms/hungrio/tree/main/complaint): `complaint`
- [Invoice generation](https://github.com/shaanms/hungrio/blob/main/invoice/services/stripe.py): `invoice/services/stripe.py`

### Runtime services

- [Invoice task](https://github.com/shaanms/hungrio/blob/main/invoice/tasks.py): `invoice/tasks.py`
- [Confirmation task](https://github.com/shaanms/hungrio/blob/main/order/tasks.py): `order/tasks.py`
- [Celery worker](https://github.com/shaanms/hungrio/blob/main/restaurant/celery.py): `restaurant/celery.py`

### Other components

- **Customer**
- **Stripe**
- **Brevo email**
- **PostgreSQL**

## Connections

- Customer → Ordering frontend: uses
- Ordering frontend → Menu catalog: browses
- Ordering frontend → Accounts & CAPTCHA: signs in
- Ordering frontend → Cart: adds items
- Ordering frontend → Wishlist: saves items
- Ordering frontend → Checkout API: checks out
- Menu catalog → Categories: organized by
- Checkout API → Cart: reads items (evidence: `order_payment/views.py`)
- Checkout API → Orders: creates (evidence: `order_payment/views.py`)
- Checkout API → Payment records: creates (evidence: `order_payment/views.py`)
- Checkout API → Stripe: creates intent (evidence: `order_payment/views.py`)
- Stripe → Stripe webhook: sends events
- Stripe webhook → Orders: updates status (evidence: `order_payment/views.py`)
- Stripe webhook → Payment records: updates status (evidence: `order_payment/views.py`)
- Stripe webhook → Confirmation task: queues email (evidence: `order_payment/views.py`)
- Stripe webhook → Invoice task: queues invoice (evidence: `order_payment/views.py`)
- Invoice task → Invoice generation: generates (evidence: `invoice/tasks.py`)
- Invoice generation → Stripe: creates invoice (evidence: `invoice/services/stripe.py`)
- Invoice generation → Orders: reads order (evidence: `invoice/services/stripe.py`)
- Confirmation task → Orders: reads order (evidence: `order/tasks.py`)
- Confirmation task → Payment records: reads payment (evidence: `order/tasks.py`)
- Confirmation task → Brevo email: sends email (evidence: `order/tasks.py`)
- Celery worker → Confirmation task: discovers tasks (evidence: `restaurant/celery.py`)
- Celery worker → Invoice task: discovers tasks (evidence: `restaurant/celery.py`)
- Orders → PostgreSQL: persists (evidence: `order/models.py`)
- Payment records → PostgreSQL: persists (evidence: `order_payment/models.py`)
- Customer → Stock & capacity: availability
- Orders → Receipts: receipt details
- Orders → Refunds: refund handling
- Customer → Complaints: reports issue
