# hugobossdev/elcorazon architecture

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

- Interactive diagram: https://gitdiagram.com/hugobossdev/elcorazon
- Repository: https://github.com/hugobossdev/elcorazon

## Overview

El Corazon is a multi-restaurant ordering and delivery platform with customer, staff, and operational capabilities. The principal flow is cart pricing and availability assessment, followed by server-side order creation and its production/inventory implications. The graph includes important backend domains visible in the repository tree, but their detailed runtime wiring is not asserted where source evidence was not supplied; dashed links mark those unverified entry points. The mobile app trees contain platform shells only in the supplied evidence.

Main entry points: [`projet/el-corazon/backend/apps/orders/services.py`](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/services.py) (Order lifecycle), [`projet/el-corazon/backend/apps/carts/services.py`](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/carts/services.py) (Cart pricing), [`projet/el-corazon/backend/apps/production/services.py`](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/production/services.py) (Production planning), [`projet/el-corazon/backend/apps/inventory/services.py`](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/inventory/services.py) (Inventory control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ordering["Ordering"]
  node_cart_api["Cart API<br/>[views.py]"]
  node_cart_service["Cart pricing<br/>[services.py]"]
  node_catalog[("Menu catalog<br/>[models.py]")]
  node_availability["Order availability<br/>[services.py]"]
  node_orders_api["Order API<br/>[views.py]"]
  node_order_service["Order lifecycle<br/>[services.py]"]
  node_orders_store[("Orders<br/>[models.py]")]
  node_payments["Payments<br/>[services.py]"]
end

subgraph group_operations["Restaurant operations"]
  node_restaurants[("Restaurants<br/>[models.py]")]
  node_production["Production planning<br/>[services.py]"]
  node_inventory["Inventory control<br/>[services.py]"]
  node_delivery["Delivery dispatch<br/>[dispatch.py]"]
  node_tracking["Live tracking<br/>[consumers.py]"]
  node_inventory_data[("Stock records<br/>[models.py]")]
  node_geography[("Delivery geography<br/>[models.py]")]
end

subgraph group_platform["Accounts and engagement"]
  node_accounts[("Accounts and access<br/>[models.py]")]
  node_loyalty["Loyalty and rewards<br/>[services.py]"]
  node_notifications["Notifications<br/>[services.py]"]
  node_analytics["Analytics<br/>[reports.py]"]
  node_social["Social features<br/>[services.py]"]
end

subgraph group_shared["Shared backend"]
  node_money["Money rules<br/>[money.py]"]
  node_errors["Business errors<br/>[exceptions.py]"]
  node_storage["Object storage<br/>[storage.py]"]
end

node_customer(("Customer"))
node_staff(("Restaurant staff"))

node_customer -.->|"manages cart"| node_cart_api
node_cart_api -.->|"uses pricing"| node_cart_service
node_cart_service -->|"reads menu"| node_catalog
node_cart_service -->|"checks orderability"| node_availability
node_customer -.->|"places order"| node_orders_api
node_orders_api -.->|"creates order"| node_order_service
node_order_service -->|"writes order"| node_orders_store
node_order_service -->|"prices cart"| node_cart_service
node_order_service -->|"plans production"| node_production
node_production -->|"uses stock service"| node_inventory
node_inventory -->|"writes movements"| node_inventory_data
node_order_service -->|"gets delivery quote"| node_geography
node_order_service -->|"uses restaurant"| node_restaurants
node_staff -.->|"records stock"| node_inventory
node_staff -.->|"handles dispatch"| node_delivery
node_delivery -.->|"reports progress"| node_tracking
node_order_service -.->|"coordinates payment"| node_payments
node_order_service -->|"signals order event"| node_notifications
node_customer -.->|"earns rewards"| node_loyalty
node_customer -.->|"uses social features"| node_social
node_staff -.->|"views reports"| node_analytics
node_cart_service -->|"uses amounts"| node_money
node_order_service -->|"uses amounts"| node_money
node_production -->|"raises rule errors"| node_errors
node_accounts -->|"uses file fields"| node_storage

click node_cart_api "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/carts/views.py"
click node_cart_service "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/carts/services.py"
click node_catalog "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/catalog/models.py"
click node_availability "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/availability/services.py"
click node_orders_api "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/views.py"
click node_order_service "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/services.py"
click node_orders_store "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/models.py"
click node_payments "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/payments/services.py"
click node_restaurants "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/restaurants/models.py"
click node_production "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/production/services.py"
click node_inventory "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/inventory/services.py"
click node_delivery "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/delivery/dispatch.py"
click node_tracking "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/tracking/consumers.py"
click node_accounts "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/accounts/models.py"
click node_loyalty "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/loyalty/services.py"
click node_notifications "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/notifications/services.py"
click node_analytics "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/analytics/reports.py"
click node_social "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/social/services.py"
click node_money "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/money.py"
click node_errors "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/exceptions.py"
click node_storage "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/storage.py"
click node_inventory_data "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/inventory/models.py"
click node_geography "https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/geography/models.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_cart_api,node_cart_service,node_catalog,node_availability,node_orders_api,node_order_service,node_orders_store,node_payments toneBlue
class node_restaurants,node_production,node_inventory,node_delivery,node_tracking,node_inventory_data,node_geography toneAmber
class node_accounts,node_loyalty,node_notifications,node_analytics,node_social toneMint
class node_money,node_errors,node_storage toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Ordering

- [Cart API](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/carts/views.py): `projet/el-corazon/backend/apps/carts/views.py`
- [Cart pricing](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/carts/services.py): `projet/el-corazon/backend/apps/carts/services.py`
- [Menu catalog](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/catalog/models.py): `projet/el-corazon/backend/apps/catalog/models.py`
- [Order availability](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/availability/services.py): `projet/el-corazon/backend/apps/availability/services.py`
- [Order API](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/views.py): `projet/el-corazon/backend/apps/orders/views.py`
- [Order lifecycle](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/services.py): `projet/el-corazon/backend/apps/orders/services.py`
- [Orders](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/orders/models.py): `projet/el-corazon/backend/apps/orders/models.py`
- [Payments](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/payments/services.py): `projet/el-corazon/backend/apps/payments/services.py`

### Restaurant operations

- [Restaurants](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/restaurants/models.py): `projet/el-corazon/backend/apps/restaurants/models.py`
- [Production planning](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/production/services.py): `projet/el-corazon/backend/apps/production/services.py`
- [Inventory control](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/inventory/services.py): `projet/el-corazon/backend/apps/inventory/services.py`
- [Delivery dispatch](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/delivery/dispatch.py): `projet/el-corazon/backend/apps/delivery/dispatch.py`
- [Live tracking](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/tracking/consumers.py): `projet/el-corazon/backend/apps/tracking/consumers.py`
- [Stock records](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/inventory/models.py): `projet/el-corazon/backend/apps/inventory/models.py`
- [Delivery geography](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/geography/models.py): `projet/el-corazon/backend/apps/geography/models.py`

### Accounts and engagement

- [Accounts and access](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/accounts/models.py): `projet/el-corazon/backend/apps/accounts/models.py`
- [Loyalty and rewards](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/loyalty/services.py): `projet/el-corazon/backend/apps/loyalty/services.py`
- [Notifications](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/notifications/services.py): `projet/el-corazon/backend/apps/notifications/services.py`
- [Analytics](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/analytics/reports.py): `projet/el-corazon/backend/apps/analytics/reports.py`
- [Social features](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/apps/social/services.py): `projet/el-corazon/backend/apps/social/services.py`

### Shared backend

- [Money rules](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/money.py): `projet/el-corazon/backend/common/money.py`
- [Business errors](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/exceptions.py): `projet/el-corazon/backend/common/exceptions.py`
- [Object storage](https://github.com/hugobossdev/elcorazon/blob/fix/audit-2026-09-15/projet/el-corazon/backend/common/storage.py): `projet/el-corazon/backend/common/storage.py`

### Other components

- **Customer**
- **Restaurant staff**

## Connections

- Customer → Cart API: manages cart
- Cart API → Cart pricing: uses pricing
- Cart pricing → Menu catalog: reads menu (evidence: `projet/el-corazon/backend/apps/carts/services.py`)
- Cart pricing → Order availability: checks orderability (evidence: `projet/el-corazon/backend/apps/carts/services.py`)
- Customer → Order API: places order
- Order API → Order lifecycle: creates order
- Order lifecycle → Orders: writes order (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Order lifecycle → Cart pricing: prices cart (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Order lifecycle → Production planning: plans production (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Production planning → Inventory control: uses stock service (evidence: `projet/el-corazon/backend/apps/production/services.py`)
- Inventory control → Stock records: writes movements (evidence: `projet/el-corazon/backend/apps/inventory/services.py`)
- Order lifecycle → Delivery geography: gets delivery quote (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Order lifecycle → Restaurants: uses restaurant (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Restaurant staff → Inventory control: records stock
- Restaurant staff → Delivery dispatch: handles dispatch
- Delivery dispatch → Live tracking: reports progress
- Order lifecycle → Payments: coordinates payment
- Order lifecycle → Notifications: signals order event (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Customer → Loyalty and rewards: earns rewards
- Customer → Social features: uses social features
- Restaurant staff → Analytics: views reports
- Cart pricing → Money rules: uses amounts (evidence: `projet/el-corazon/backend/apps/carts/services.py`)
- Order lifecycle → Money rules: uses amounts (evidence: `projet/el-corazon/backend/apps/orders/services.py`)
- Production planning → Business errors: raises rule errors (evidence: `projet/el-corazon/backend/apps/production/services.py`)
- Accounts and access → Object storage: uses file fields (evidence: `projet/el-corazon/backend/apps/accounts/models.py`)
