# fastaze/restoweb architecture

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

- Interactive diagram: https://gitdiagram.com/fastaze/restoweb
- Repository: https://github.com/fastaze/restoweb

## Overview

RestoWeb is a PHP/MySQL restaurant-ordering application. Customers browse a public or authenticated product catalogue, register or sign in, add products to an active order, edit the cart and select dine-in or takeaway, then submit the payment form; the order advances to preparation. Users can review order history, while restaurant staff have API operations to list, accept, refuse and complete orders. The payment form and order APIs are shown, but no external payment processor or email implementation is evidenced. The graph follows the sampled PHP calls and README workflow; unsampled features are included only where documented.

Main entry points: [`doc/mpd/restoweb.sql`](https://github.com/fastaze/restoweb/blob/lot4/doc/mpd/restoweb.sql) (MySQL database), [`paiement.php`](https://github.com/fastaze/restoweb/blob/lot4/paiement.php) (Payment form), [`accueilConnecte.php`](https://github.com/fastaze/restoweb/blob/lot4/accueilConnecte.php) (Signed-in catalogue), [`panier.php`](https://github.com/fastaze/restoweb/blob/lot4/panier.php) (Cart management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_public_catalog["Public catalogue<br/>[index.php]"]
  node_public_products["Public product list"]
  node_signed_catalog["Signed-in catalogue"]
  node_product_list["Product list"]
  node_cart["Cart management<br/>[panier.php]"]
  node_checkout["Payment form<br/>[paiement.php]"]
end

subgraph group_account["Accounts and history"]
  node_registration["Registration<br/>[inscription.php]"]
  node_sign_in["Sign-in<br/>[connection.php]"]
  node_profile["Order history<br/>[profile.php]"]
end

subgraph group_fulfillment["Order fulfillment"]
  node_order_list_api["Order listing API"]
  node_accept_api["Accept order API"]
  node_refuse_api["Refuse order API"]
  node_complete_api["Complete order API"]
  node_email["Email notification"]
end

subgraph group_platform["Persistence and shared logic"]
  node_order_state["Active order state<br/>[chekEtat.php]"]
  node_database_config["Database connection<br/>[ini.php]"]
  node_mysql[("MySQL database<br/>[restoweb.sql]")]
end

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

node_customer -->|"browses"| node_public_catalog
node_public_catalog -->|"includes"| node_public_products
node_customer -->|"registers"| node_registration
node_customer -->|"signs in"| node_sign_in
node_customer -->|"browses"| node_signed_catalog
node_signed_catalog -->|"includes"| node_product_list
node_signed_catalog -->|"checks state"| node_order_state
node_customer -->|"edits cart"| node_cart
node_cart -->|"redirects"| node_checkout
node_customer -->|"submits payment"| node_checkout
node_registration -->|"creates order"| node_order_state
node_profile -->|"reads history"| node_mysql
node_database_config -->|"connects"| node_mysql
node_public_products -->|"reads products"| node_mysql
node_product_list -->|"reads products"| node_mysql
node_cart -->|"updates order lines"| node_mysql
node_checkout -->|"updates order status"| node_mysql
node_order_state -->|"reads and creates"| node_mysql
node_staff -.->|"lists orders"| node_order_list_api
node_order_list_api -->|"reads pending orders"| node_mysql
node_staff -.->|"accepts order"| node_accept_api
node_accept_api -->|"sets preparation"| node_mysql
node_staff -.->|"refuses order"| node_refuse_api
node_refuse_api -->|"abandons order"| node_mysql
node_staff -.->|"completes order"| node_complete_api
node_complete_api -->|"updates order"| node_mysql
node_checkout -.->|"notifies by email"| node_email

click node_public_catalog "https://github.com/fastaze/restoweb/blob/lot4/index.php"
click node_public_products "https://github.com/fastaze/restoweb/blob/lot4/component/componentArticleIndex.php"
click node_signed_catalog "https://github.com/fastaze/restoweb/blob/lot4/accueilConnecte.php"
click node_product_list "https://github.com/fastaze/restoweb/blob/lot4/component/componentArticle.php"
click node_cart "https://github.com/fastaze/restoweb/blob/lot4/panier.php"
click node_checkout "https://github.com/fastaze/restoweb/blob/lot4/paiement.php"
click node_registration "https://github.com/fastaze/restoweb/blob/lot4/inscription.php"
click node_sign_in "https://github.com/fastaze/restoweb/blob/lot4/connection.php"
click node_profile "https://github.com/fastaze/restoweb/blob/lot4/profile.php"
click node_order_state "https://github.com/fastaze/restoweb/blob/lot4/template/chekEtat.php"
click node_database_config "https://github.com/fastaze/restoweb/blob/lot4/template/ini.php"
click node_mysql "https://github.com/fastaze/restoweb/blob/lot4/doc/mpd/restoweb.sql"
click node_order_list_api "https://github.com/fastaze/restoweb/blob/lot4/api/liste_commandes.php"
click node_accept_api "https://github.com/fastaze/restoweb/blob/lot4/api/commande_accepter.php"
click node_refuse_api "https://github.com/fastaze/restoweb/blob/lot4/api/commande_refuser.php"
click node_complete_api "https://github.com/fastaze/restoweb/blob/lot4/api/commande_terminer.php"

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_public_catalog,node_public_products,node_signed_catalog,node_product_list,node_cart,node_checkout toneBlue
class node_registration,node_sign_in,node_profile toneAmber
class node_order_list_api,node_accept_api,node_refuse_api,node_complete_api,node_email toneMint
class node_order_state,node_database_config,node_mysql toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Customer ordering

- [Public catalogue](https://github.com/fastaze/restoweb/blob/lot4/index.php): `index.php`
- [Public product list](https://github.com/fastaze/restoweb/blob/lot4/component/componentArticleIndex.php): `component/componentArticleIndex.php`
- [Signed-in catalogue](https://github.com/fastaze/restoweb/blob/lot4/accueilConnecte.php): `accueilConnecte.php`
- [Product list](https://github.com/fastaze/restoweb/blob/lot4/component/componentArticle.php): `component/componentArticle.php`
- [Cart management](https://github.com/fastaze/restoweb/blob/lot4/panier.php): `panier.php`
- [Payment form](https://github.com/fastaze/restoweb/blob/lot4/paiement.php): `paiement.php`

### Accounts and history

- [Registration](https://github.com/fastaze/restoweb/blob/lot4/inscription.php): `inscription.php`
- [Sign-in](https://github.com/fastaze/restoweb/blob/lot4/connection.php): `connection.php`
- [Order history](https://github.com/fastaze/restoweb/blob/lot4/profile.php): `profile.php`

### Order fulfillment

- [Order listing API](https://github.com/fastaze/restoweb/blob/lot4/api/liste_commandes.php): `api/liste_commandes.php`
- [Accept order API](https://github.com/fastaze/restoweb/blob/lot4/api/commande_accepter.php): `api/commande_accepter.php`
- [Refuse order API](https://github.com/fastaze/restoweb/blob/lot4/api/commande_refuser.php): `api/commande_refuser.php`
- [Complete order API](https://github.com/fastaze/restoweb/blob/lot4/api/commande_terminer.php): `api/commande_terminer.php`
- **Email notification**

### Persistence and shared logic

- [Active order state](https://github.com/fastaze/restoweb/blob/lot4/template/chekEtat.php): `template/chekEtat.php`
- [Database connection](https://github.com/fastaze/restoweb/blob/lot4/template/ini.php): `template/ini.php`
- [MySQL database](https://github.com/fastaze/restoweb/blob/lot4/doc/mpd/restoweb.sql): `doc/mpd/restoweb.sql`

### Other components

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

## Connections

- Customer → Public catalogue: browses (evidence: `README.md`)
- Public catalogue → Public product list: includes (evidence: `index.php`)
- Customer → Registration: registers (evidence: `README.md`)
- Customer → Sign-in: signs in (evidence: `README.md`)
- Customer → Signed-in catalogue: browses (evidence: `README.md`)
- Signed-in catalogue → Product list: includes (evidence: `accueilConnecte.php`)
- Signed-in catalogue → Active order state: checks state (evidence: `accueilConnecte.php`)
- Customer → Cart management: edits cart (evidence: `README.md`)
- Cart management → Payment form: redirects (evidence: `panier.php`)
- Customer → Payment form: submits payment (evidence: `README.md`)
- Registration → Active order state: creates order (evidence: `inscription.php`)
- Order history → MySQL database: reads history (evidence: `README.md`)
- Database connection → MySQL database: connects (evidence: `template/ini.php`)
- Public product list → MySQL database: reads products (evidence: `component/componentArticleIndex.php`)
- Product list → MySQL database: reads products (evidence: `component/componentArticle.php`)
- Cart management → MySQL database: updates order lines (evidence: `panier.php`)
- Payment form → MySQL database: updates order status (evidence: `paiement.php`)
- Active order state → MySQL database: reads and creates (evidence: `template/chekEtat.php`)
- Restaurant staff → Order listing API: lists orders
- Order listing API → MySQL database: reads pending orders (evidence: `api/liste_commandes.php`)
- Restaurant staff → Accept order API: accepts order
- Accept order API → MySQL database: sets preparation (evidence: `api/commande_accepter.php`)
- Restaurant staff → Refuse order API: refuses order
- Refuse order API → MySQL database: abandons order (evidence: `api/commande_refuser.php`)
- Restaurant staff → Complete order API: completes order
- Complete order API → MySQL database: updates order (evidence: `api/commande_terminer.php`)
- Payment form → Email notification: notifies by email (evidence: `README.md`)
