# lutsun/project_php_exam architecture

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

- Interactive diagram: https://gitdiagram.com/lutsun/project_php_exam
- Repository: https://github.com/lutsun/project_php_exam

## Overview

Stock Nova is a PHP/MySQL inventory-management web application for administrators and users. The main workflow is sign-in, then role-specific access to inventory and product management, order tracking, deliveries, and invoices. Separate screens also manage clients and suppliers. The graph preserves the README’s documented capabilities and major indexed modules; most page internals were not excerpted, so uncertain database interactions are shown as unverified rather than asserted.

Main entry points: [`includes/connexion.php`](https://github.com/lutsun/project_php_exam/blob/main/includes/connexion.php) (PDO connection), [`index.php`](https://github.com/lutsun/project_php_exam/blob/main/index.php) (Sign-in), [`inventaire.php`](https://github.com/lutsun/project_php_exam/blob/main/inventaire.php) (Inventory overview), [`commande.php`](https://github.com/lutsun/project_php_exam/blob/main/commande.php) (Create order)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and dashboard"]
  node_login["Sign-in<br/>[index.php]"]
  node_registration["Registration<br/>[inscription.php]"]
  node_dashboard["Admin dashboard<br/>[acceuil_admin.php]"]
end

subgraph group_stock["Stock and records"]
  node_inventory["Inventory overview<br/>[inventaire.php]"]
  node_products["Product management<br/>[listprod.php]"]
  node_product_update["Product updates<br/>[updateprod.php]"]
  node_clients["Client management<br/>[listclient.php]"]
  node_client_add["Add client<br/>[ajoutclient.php]"]
  node_suppliers["Supplier management"]
  node_supplies["Supply management<br/>[fourniture.php]"]
  node_supply_search["Supply lookup<br/>[findfourniture.php]"]
end

subgraph group_orders["Orders and delivery"]
  node_new_order["Create order<br/>[commande.php]"]
  node_cart_validation["Validate cart<br/>[valider_panier.php]"]
  node_open_orders["Orders in progress"]
  node_my_orders["User orders<br/>[mes_commandes.php]"]
  node_delivery["Deliveries<br/>[livraison.php]"]
  node_delivered_orders["Delivered orders<br/>[commandelivre.php]"]
end

subgraph group_billing["Invoices"]
  node_invoices["Invoice management<br/>[facture.php]"]
  node_my_invoices["User invoices<br/>[mes_factures.php]"]
  node_invoice_data["Invoice retrieval<br/>[get_facture.php]"]
end

subgraph group_shared["Shared runtime"]
  node_database[("MySQL database<br/>[gestion_stock.sql]")]
  node_db_connection["PDO connection<br/>[connexion.php]"]
  node_session["Session security<br/>[session_init.php]"]
  node_navigation["Role-based navigation<br/>[header.php]"]
  node_page_scripts["Shared browser scripts<br/>[main.js]"]
end

node_user(("Administrator or user"))

node_user -->|"signs in"| node_login
node_user -->|"registers"| node_registration
node_login -->|"initializes session"| node_session
node_user -->|"uses admin view"| node_dashboard
node_user -->|"manages stock"| node_inventory
node_user -->|"manages products"| node_products
node_user -->|"tracks orders"| node_open_orders
node_user -->|"tracks deliveries"| node_delivery
node_user -->|"manages invoices"| node_invoices
node_new_order -.->|"submits cart"| node_cart_validation
node_login -.->|"uses PDO"| node_db_connection
node_inventory -.->|"queries stock"| node_db_connection
node_products -.->|"queries products"| node_db_connection
node_product_update -.->|"updates products"| node_db_connection
node_clients -.->|"queries clients"| node_db_connection
node_client_add -.->|"writes clients"| node_db_connection
node_suppliers -.->|"queries suppliers"| node_db_connection
node_supplies -.->|"manages supplies"| node_db_connection
node_supply_search -.->|"looks up supplies"| node_db_connection
node_new_order -.->|"persists orders"| node_db_connection
node_cart_validation -.->|"records checkout"| node_db_connection
node_open_orders -.->|"queries orders"| node_db_connection
node_my_orders -.->|"queries user orders"| node_db_connection
node_delivery -.->|"queries deliveries"| node_db_connection
node_delivered_orders -.->|"queries delivered orders"| node_db_connection
node_invoices -.->|"queries invoices"| node_db_connection
node_my_invoices -.->|"queries user invoices"| node_db_connection
node_invoice_data -.->|"retrieves invoice"| node_db_connection
node_db_connection -.->|"connects to"| node_database
node_dashboard -.->|"renders navigation"| node_navigation
node_inventory -.->|"loads shared scripts"| node_page_scripts

click node_login "https://github.com/lutsun/project_php_exam/blob/main/index.php"
click node_registration "https://github.com/lutsun/project_php_exam/blob/main/inscription.php"
click node_dashboard "https://github.com/lutsun/project_php_exam/blob/main/acceuil_admin.php"
click node_inventory "https://github.com/lutsun/project_php_exam/blob/main/inventaire.php"
click node_products "https://github.com/lutsun/project_php_exam/blob/main/listprod.php"
click node_product_update "https://github.com/lutsun/project_php_exam/blob/main/updateprod.php"
click node_clients "https://github.com/lutsun/project_php_exam/blob/main/listclient.php"
click node_client_add "https://github.com/lutsun/project_php_exam/blob/main/ajoutclient.php"
click node_suppliers "https://github.com/lutsun/project_php_exam/blob/main/listfournisseur.php"
click node_supplies "https://github.com/lutsun/project_php_exam/blob/main/fourniture.php"
click node_supply_search "https://github.com/lutsun/project_php_exam/blob/main/findfourniture.php"
click node_new_order "https://github.com/lutsun/project_php_exam/blob/main/commande.php"
click node_cart_validation "https://github.com/lutsun/project_php_exam/blob/main/valider_panier.php"
click node_open_orders "https://github.com/lutsun/project_php_exam/blob/main/commandes_en_cours.php"
click node_my_orders "https://github.com/lutsun/project_php_exam/blob/main/mes_commandes.php"
click node_delivery "https://github.com/lutsun/project_php_exam/blob/main/livraison.php"
click node_delivered_orders "https://github.com/lutsun/project_php_exam/blob/main/commandelivre.php"
click node_invoices "https://github.com/lutsun/project_php_exam/blob/main/facture.php"
click node_my_invoices "https://github.com/lutsun/project_php_exam/blob/main/mes_factures.php"
click node_invoice_data "https://github.com/lutsun/project_php_exam/blob/main/get_facture.php"
click node_database "https://github.com/lutsun/project_php_exam/blob/main/database/gestion_stock.sql"
click node_db_connection "https://github.com/lutsun/project_php_exam/blob/main/includes/connexion.php"
click node_session "https://github.com/lutsun/project_php_exam/blob/main/includes/session_init.php"
click node_navigation "https://github.com/lutsun/project_php_exam/blob/main/includes/header.php"
click node_page_scripts "https://github.com/lutsun/project_php_exam/blob/main/js/main.js"

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_login,node_registration,node_dashboard,node_user toneBlue
class node_inventory,node_products,node_product_update,node_clients,node_client_add,node_suppliers,node_supplies,node_supply_search toneAmber
class node_new_order,node_cart_validation,node_open_orders,node_my_orders,node_delivery,node_delivered_orders toneMint
class node_invoices,node_my_invoices,node_invoice_data toneRose
class node_database,node_db_connection,node_session,node_navigation,node_page_scripts toneIndigo
```

## Components

### Access and dashboard

- [Sign-in](https://github.com/lutsun/project_php_exam/blob/main/index.php): `index.php`
- [Registration](https://github.com/lutsun/project_php_exam/blob/main/inscription.php): `inscription.php`
- [Admin dashboard](https://github.com/lutsun/project_php_exam/blob/main/acceuil_admin.php): `acceuil_admin.php`

### Stock and records

- [Inventory overview](https://github.com/lutsun/project_php_exam/blob/main/inventaire.php): `inventaire.php`
- [Product management](https://github.com/lutsun/project_php_exam/blob/main/listprod.php): `listprod.php`
- [Product updates](https://github.com/lutsun/project_php_exam/blob/main/updateprod.php): `updateprod.php`
- [Client management](https://github.com/lutsun/project_php_exam/blob/main/listclient.php): `listclient.php`
- [Add client](https://github.com/lutsun/project_php_exam/blob/main/ajoutclient.php): `ajoutclient.php`
- [Supplier management](https://github.com/lutsun/project_php_exam/blob/main/listfournisseur.php): `listfournisseur.php`
- [Supply management](https://github.com/lutsun/project_php_exam/blob/main/fourniture.php): `fourniture.php`
- [Supply lookup](https://github.com/lutsun/project_php_exam/blob/main/findfourniture.php): `findfourniture.php`

### Orders and delivery

- [Create order](https://github.com/lutsun/project_php_exam/blob/main/commande.php): `commande.php`
- [Validate cart](https://github.com/lutsun/project_php_exam/blob/main/valider_panier.php): `valider_panier.php`
- [Orders in progress](https://github.com/lutsun/project_php_exam/blob/main/commandes_en_cours.php): `commandes_en_cours.php`
- [User orders](https://github.com/lutsun/project_php_exam/blob/main/mes_commandes.php): `mes_commandes.php`
- [Deliveries](https://github.com/lutsun/project_php_exam/blob/main/livraison.php): `livraison.php`
- [Delivered orders](https://github.com/lutsun/project_php_exam/blob/main/commandelivre.php): `commandelivre.php`

### Invoices

- [Invoice management](https://github.com/lutsun/project_php_exam/blob/main/facture.php): `facture.php`
- [User invoices](https://github.com/lutsun/project_php_exam/blob/main/mes_factures.php): `mes_factures.php`
- [Invoice retrieval](https://github.com/lutsun/project_php_exam/blob/main/get_facture.php): `get_facture.php`

### Shared runtime

- [MySQL database](https://github.com/lutsun/project_php_exam/blob/main/database/gestion_stock.sql): `database/gestion_stock.sql`
- [PDO connection](https://github.com/lutsun/project_php_exam/blob/main/includes/connexion.php): `includes/connexion.php`
- [Session security](https://github.com/lutsun/project_php_exam/blob/main/includes/session_init.php): `includes/session_init.php`
- [Role-based navigation](https://github.com/lutsun/project_php_exam/blob/main/includes/header.php): `includes/header.php`
- [Shared browser scripts](https://github.com/lutsun/project_php_exam/blob/main/js/main.js): `js/main.js`

### Other components

- **Administrator or user**

## Connections

- Administrator or user → Sign-in: signs in (evidence: `README.md`)
- Administrator or user → Registration: registers (evidence: `README.md`)
- Sign-in → Session security: initializes session (evidence: `index.php`)
- Administrator or user → Admin dashboard: uses admin view (evidence: `README.md`)
- Administrator or user → Inventory overview: manages stock (evidence: `README.md`)
- Administrator or user → Product management: manages products (evidence: `README.md`)
- Administrator or user → Orders in progress: tracks orders (evidence: `README.md`)
- Administrator or user → Deliveries: tracks deliveries (evidence: `README.md`)
- Administrator or user → Invoice management: manages invoices (evidence: `README.md`)
- Create order → Validate cart: submits cart
- Sign-in → PDO connection: uses PDO (evidence: `index.php`)
- Inventory overview → PDO connection: queries stock (evidence: `inventaire.php`)
- Product management → PDO connection: queries products (evidence: `listprod.php`)
- Product updates → PDO connection: updates products (evidence: `updateprod.php`)
- Client management → PDO connection: queries clients (evidence: `listclient.php`)
- Add client → PDO connection: writes clients (evidence: `ajoutclient.php`)
- Supplier management → PDO connection: queries suppliers (evidence: `listfournisseur.php`)
- Supply management → PDO connection: manages supplies (evidence: `fourniture.php`)
- Supply lookup → PDO connection: looks up supplies (evidence: `findfourniture.php`)
- Create order → PDO connection: persists orders (evidence: `commande.php`)
- Validate cart → PDO connection: records checkout (evidence: `valider_panier.php`)
- Orders in progress → PDO connection: queries orders (evidence: `commandes_en_cours.php`)
- User orders → PDO connection: queries user orders (evidence: `mes_commandes.php`)
- Deliveries → PDO connection: queries deliveries (evidence: `livraison.php`)
- Delivered orders → PDO connection: queries delivered orders (evidence: `commandelivre.php`)
- Invoice management → PDO connection: queries invoices (evidence: `facture.php`)
- User invoices → PDO connection: queries user invoices (evidence: `mes_factures.php`)
- Invoice retrieval → PDO connection: retrieves invoice (evidence: `get_facture.php`)
- PDO connection → MySQL database: connects to
- Admin dashboard → Role-based navigation: renders navigation (evidence: `acceuil_admin.php`)
- Inventory overview → Shared browser scripts: loads shared scripts
