# makan-dianka/pizzeria architecture

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

- Interactive diagram: https://gitdiagram.com/makan-dianka/pizzeria
- Repository: https://github.com/makan-dianka/pizzeria

## Overview

This is a Django pizzeria ordering application with a custom Stripe checkout. The customer browses food, builds a session-backed basket, submits payment, and on success the app records the order and generates a QR-coded PDF receipt before emailing it. The excerpts show the food and payment handlers and receipt helpers, but not URL routing or the basket, order-history, and login view implementations; those capabilities are represented cautiously from the README and tree, with uncertain links omitted or dashed.

Main entry points: [`pizzeria/views/paiement.py`](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/paiement.py) (Payment handler), [`pizzeria/models/food.py`](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/food.py) (Food items), [`pizzeria/views/food.py`](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/food.py) (Browse food), [`pizzeria/models/order.py`](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/order.py) (Ordered food)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Food catalog"]
  node_food_browse["Browse food<br/>[food.py]"]
  node_food_types["Food categories<br/>[typefood.py]"]
  node_food_items["Food items<br/>[food.py]"]
end

subgraph group_checkout["Checkout"]
  node_basket["Session basket<br/>[panier.py]"]
  node_payment_ui["Card form<br/>[paiement.js]"]
  node_payment_handler["Payment handler<br/>[paiement.py]"]
end

subgraph group_orders["Orders and receipts"]
  node_order_record["Order record<br/>[commande.py]"]
  node_ordered_food["Ordered food<br/>[order.py]"]
  node_receipt_tools["Receipt tools<br/>[func.py]"]
  node_receipt_files["Receipt files"]
  node_order_history["Order history<br/>[orders.py]"]
end

subgraph group_identity["Accounts"]
  node_login["Login<br/>[connexion.py]"]
  node_accounts_data["Account models<br/>[models.py]"]
end

node_customer(("Customer"))
node_stripe{{"Stripe"}}
node_mail_service{{"Email service"}}
node_database[("SQLite database<br/>[settings.py]")]

node_customer -->|"browses"| node_food_browse
node_food_browse -->|"queries"| node_food_types
node_food_browse -->|"queries"| node_food_items
node_food_browse -.->|"redirects"| node_basket
node_customer -.->|"enters card"| node_payment_ui
node_payment_ui -->|"creates token"| node_stripe
node_payment_handler -->|"charges card"| node_stripe
node_payment_handler -->|"saves order"| node_order_record
node_payment_handler -->|"saves items"| node_ordered_food
node_payment_handler -->|"loads food"| node_food_items
node_payment_handler -->|"generates receipt"| node_receipt_tools
node_receipt_tools -->|"writes PDF and QR"| node_receipt_files
node_receipt_tools -->|"sends email"| node_mail_service
node_food_items -->|"references category"| node_food_types
node_ordered_food -->|"references food"| node_food_items
node_customer -.->|"logs in"| node_login
node_login -.->|"authenticates"| node_accounts_data
node_customer -.->|"views orders"| node_order_history
node_food_items -.->|"stored in"| node_database
node_order_record -.->|"stored in"| node_database
node_ordered_food -.->|"stored in"| node_database

click node_food_browse "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/food.py"
click node_food_types "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/typefood.py"
click node_food_items "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/food.py"
click node_basket "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/panier.py"
click node_payment_ui "https://github.com/makan-dianka/pizzeria/blob/master/static/js/paiement.js"
click node_payment_handler "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/paiement.py"
click node_order_record "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/commande.py"
click node_ordered_food "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/order.py"
click node_receipt_tools "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/func.py"
click node_receipt_files "https://github.com/makan-dianka/pizzeria/tree/master/static/recu"
click node_order_history "https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/orders.py"
click node_login "https://github.com/makan-dianka/pizzeria/blob/master/accounts/views/connexion.py"
click node_accounts_data "https://github.com/makan-dianka/pizzeria/blob/master/accounts/models.py"
click node_database "https://github.com/makan-dianka/pizzeria/blob/master/boulange/settings.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_food_browse,node_food_types,node_food_items toneBlue
class node_basket,node_payment_ui,node_payment_handler,node_database toneAmber
class node_order_record,node_ordered_food,node_receipt_tools,node_receipt_files,node_order_history toneMint
class node_login,node_accounts_data toneRose
class node_customer,node_stripe,node_mail_service toneIndigo
```

## Components

### Food catalog

- [Browse food](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/food.py): `pizzeria/views/food.py`
- [Food categories](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/typefood.py): `pizzeria/models/typefood.py`
- [Food items](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/food.py): `pizzeria/models/food.py`

### Checkout

- [Session basket](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/panier.py): `pizzeria/views/panier.py`
- [Card form](https://github.com/makan-dianka/pizzeria/blob/master/static/js/paiement.js): `static/js/paiement.js`
- [Payment handler](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/paiement.py): `pizzeria/views/paiement.py`

### Orders and receipts

- [Order record](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/commande.py): `pizzeria/models/commande.py`
- [Ordered food](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/models/order.py): `pizzeria/models/order.py`
- [Receipt tools](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/func.py): `pizzeria/views/func.py`
- [Receipt files](https://github.com/makan-dianka/pizzeria/tree/master/static/recu): `static/recu`
- [Order history](https://github.com/makan-dianka/pizzeria/blob/master/pizzeria/views/orders.py): `pizzeria/views/orders.py`

### Accounts

- [Login](https://github.com/makan-dianka/pizzeria/blob/master/accounts/views/connexion.py): `accounts/views/connexion.py`
- [Account models](https://github.com/makan-dianka/pizzeria/blob/master/accounts/models.py): `accounts/models.py`

### Other components

- **Customer**
- **Stripe**
- **Email service**
- [SQLite database](https://github.com/makan-dianka/pizzeria/blob/master/boulange/settings.py): `boulange/settings.py`

## Connections

- Customer → Browse food: browses (evidence: `README.md`)
- Browse food → Food categories: queries (evidence: `pizzeria/views/food.py`)
- Browse food → Food items: queries (evidence: `pizzeria/views/food.py`)
- Browse food → Session basket: redirects
- Customer → Card form: enters card
- Card form → Stripe: creates token (evidence: `static/js/paiement.js`)
- Payment handler → Stripe: charges card (evidence: `pizzeria/views/paiement.py`)
- Payment handler → Order record: saves order (evidence: `pizzeria/views/paiement.py`)
- Payment handler → Ordered food: saves items (evidence: `pizzeria/views/paiement.py`)
- Payment handler → Food items: loads food (evidence: `pizzeria/views/paiement.py`)
- Payment handler → Receipt tools: generates receipt (evidence: `pizzeria/views/paiement.py`)
- Receipt tools → Receipt files: writes PDF and QR (evidence: `pizzeria/views/func.py`)
- Receipt tools → Email service: sends email (evidence: `pizzeria/views/func.py`)
- Food items → Food categories: references category (evidence: `pizzeria/models/food.py`)
- Ordered food → Food items: references food (evidence: `pizzeria/models/order.py`)
- Customer → Login: logs in
- Login → Account models: authenticates
- Customer → Order history: views orders
- Food items → SQLite database: stored in
- Order record → SQLite database: stored in
- Ordered food → SQLite database: stored in
