# dailedreamer/opsolutions_crud_exam architecture

> Architecture diagram of the GitHub repository dailedreamer/opsolutions_crud_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/dailedreamer/opsolutions_crud_exam
- Repository: https://github.com/dailedreamer/opsolutions_crud_exam

## Overview

This PHP product-inventory CRUD app serves product listing and create, edit, and delete workflows through PHP pages. Those pages validate form input and delegate product operations to a PDO-backed model, which obtains its connection from the database configuration and accesses MySQL. The README documents the schema and the CRUD capabilities; the sampled pages also show inline validation, flash messages, and listing-table search/sort integration. Relationships for unsampled delete and schema details are based on the README and source index, not inspected implementations.

Main entry points: [`classes/Product.php`](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/classes/Product.php) (Product model), [`index.php`](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/index.php) (Product listing), [`create.php`](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/create.php) (Create product), [`update.php`](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/update.php) (Edit product)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_listing["Product listing<br/>[index.php]"]
  node_create["Create product<br/>[create.php]"]
  node_edit["Edit product<br/>[update.php]"]
  node_delete["Delete product<br/>[delete.php]"]
  node_styling["Page styling<br/>[style.css]"]
end

subgraph group_domain["Product operations"]
  node_product["Product model<br/>[Product.php]"]
end

subgraph group_storage["Persistence"]
  node_database_config["PDO connection<br/>[database.php]"]
  node_schema["Database schema<br/>[database.sql]"]
end

node_visitor(("Browser user"))
node_tablelib["DataTables library"]
node_mysql[("MySQL database")]

node_visitor -->|"opens app"| node_listing
node_visitor -->|"submits form"| node_create
node_visitor -->|"submits form"| node_edit
node_visitor -->|"requests deletion"| node_delete
node_listing -->|"fetches products"| node_product
node_create -->|"creates product"| node_product
node_edit -->|"loads and updates"| node_product
node_delete -->|"deletes product"| node_product
node_listing -->|"loads styles"| node_styling
node_create -->|"loads styles"| node_styling
node_edit -->|"loads styles"| node_styling
node_listing -->|"uses table search"| node_tablelib
node_product -->|"gets connection"| node_database_config
node_database_config -->|"connects via PDO"| node_mysql
node_schema -->|"defines schema"| node_mysql

click node_listing "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/index.php"
click node_create "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/create.php"
click node_edit "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/update.php"
click node_delete "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/delete.php"
click node_styling "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/assets/css/style.css"
click node_product "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/classes/Product.php"
click node_database_config "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/config/database.php"
click node_schema "https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/database.sql"

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_listing,node_create,node_edit,node_delete,node_styling,node_visitor toneBlue
class node_product,node_mysql toneAmber
class node_database_config,node_schema toneMint
class node_tablelib toneIndigo
```

## Components

### Web interface

- [Product listing](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/index.php): `index.php`
- [Create product](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/create.php): `create.php`
- [Edit product](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/update.php): `update.php`
- [Delete product](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/delete.php): `delete.php`
- [Page styling](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/assets/css/style.css): `assets/css/style.css`

### Product operations

- [Product model](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/classes/Product.php): `classes/Product.php`

### Persistence

- [PDO connection](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/config/database.php): `config/database.php`
- [Database schema](https://github.com/dailedreamer/opsolutions_crud_exam/blob/main/database.sql): `database.sql`

### Other components

- **Browser user**
- **DataTables library**
- **MySQL database**

## Connections

- Browser user → Product listing: opens app (evidence: `README.md`)
- Browser user → Create product: submits form (evidence: `create.php`)
- Browser user → Edit product: submits form (evidence: `update.php`)
- Browser user → Delete product: requests deletion (evidence: `README.md`)
- Product listing → Product model: fetches products (evidence: `index.php`)
- Create product → Product model: creates product (evidence: `create.php`)
- Edit product → Product model: loads and updates (evidence: `update.php`)
- Delete product → Product model: deletes product (evidence: `delete.php`)
- Product listing → Page styling: loads styles (evidence: `index.php`)
- Create product → Page styling: loads styles (evidence: `create.php`)
- Edit product → Page styling: loads styles (evidence: `update.php`)
- Product listing → DataTables library: uses table search (evidence: `index.php`)
- Product model → PDO connection: gets connection (evidence: `classes/Product.php`)
- PDO connection → MySQL database: connects via PDO (evidence: `config/database.php`)
- Database schema → MySQL database: defines schema (evidence: `README.md`)
