# syedrahaman92/oop_php architecture

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

- Interactive diagram: https://gitdiagram.com/syedrahaman92/oop_php
- Repository: https://github.com/syedrahaman92/oop_php

## Overview

OOP_PHP is a small PHP/MySQL CRUD application for viewing and managing user records. The browser-facing pages provide the main workflow: list records, add or edit a record with validation, and delete a record; the pages delegate database operations to a shared CRUD class. That class uses a MySQL connection configured by DbConfig. The README identifies database.sql as the schema setup script. Relationships below are grounded in the excerpts or README; database.sql contents were not sampled.

Main entry points: [`includes/Crud.php`](https://github.com/syedrahaman92/oop_php/blob/master/includes/Crud.php) (CRUD Operations), [`index.php`](https://github.com/syedrahaman92/oop_php/blob/master/index.php) (Record List), [`add.php`](https://github.com/syedrahaman92/oop_php/blob/master/add.php) (Add Record), [`edit.php`](https://github.com/syedrahaman92/oop_php/blob/master/edit.php) (Edit Record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["CRUD Pages"]
  node_index["Record List<br/>[index.php]"]
  node_add["Add Record<br/>[add.php]"]
  node_edit["Edit Record<br/>[edit.php]"]
  node_delete["Delete Record<br/>[delete.php]"]
end

subgraph group_validation["Input Validation"]
  node_validation["Validation<br/>[Validation.php]"]
end

subgraph group_persistence["Persistence"]
  node_crud["CRUD Operations<br/>[Crud.php]"]
  node_dbconfig["DB Configuration<br/>[DbConfig.php]"]
  node_mysql[("MySQL Database")]
  node_schema["Database Schema<br/>[database.sql]"]
end

node_user(("User"))

node_user -.->|"views records"| node_index
node_index -->|"fetches records"| node_crud
node_index -->|"links to"| node_add
node_index -->|"links to"| node_edit
node_index -->|"links to"| node_delete
node_add -->|"validates input"| node_validation
node_add -->|"inserts record"| node_crud
node_edit -->|"validates input"| node_validation
node_edit -->|"loads and updates"| node_crud
node_delete -->|"deletes record"| node_crud
node_crud -->|"extends and initializes"| node_dbconfig
node_dbconfig -->|"opens connection"| node_mysql
node_crud -->|"queries records"| node_mysql
node_schema -->|"sets up schema"| node_mysql

click node_index "https://github.com/syedrahaman92/oop_php/blob/master/index.php"
click node_add "https://github.com/syedrahaman92/oop_php/blob/master/add.php"
click node_edit "https://github.com/syedrahaman92/oop_php/blob/master/edit.php"
click node_delete "https://github.com/syedrahaman92/oop_php/blob/master/delete.php"
click node_validation "https://github.com/syedrahaman92/oop_php/blob/master/includes/Validation.php"
click node_crud "https://github.com/syedrahaman92/oop_php/blob/master/includes/Crud.php"
click node_dbconfig "https://github.com/syedrahaman92/oop_php/blob/master/includes/DbConfig.php"
click node_schema "https://github.com/syedrahaman92/oop_php/blob/master/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_index,node_add,node_edit,node_delete,node_user toneBlue
class node_validation toneAmber
class node_crud,node_dbconfig,node_mysql,node_schema toneMint
```

## Components

### CRUD Pages

- [Record List](https://github.com/syedrahaman92/oop_php/blob/master/index.php): `index.php`
- [Add Record](https://github.com/syedrahaman92/oop_php/blob/master/add.php): `add.php`
- [Edit Record](https://github.com/syedrahaman92/oop_php/blob/master/edit.php): `edit.php`
- [Delete Record](https://github.com/syedrahaman92/oop_php/blob/master/delete.php): `delete.php`

### Input Validation

- [Validation](https://github.com/syedrahaman92/oop_php/blob/master/includes/Validation.php): `includes/Validation.php`

### Persistence

- [CRUD Operations](https://github.com/syedrahaman92/oop_php/blob/master/includes/Crud.php): `includes/Crud.php`
- [DB Configuration](https://github.com/syedrahaman92/oop_php/blob/master/includes/DbConfig.php): `includes/DbConfig.php`
- **MySQL Database**
- [Database Schema](https://github.com/syedrahaman92/oop_php/blob/master/database.sql): `database.sql`

### Other components

- **User**

## Connections

- User → Record List: views records
- Record List → CRUD Operations: fetches records (evidence: `index.php`)
- Record List → Add Record: links to (evidence: `index.php`)
- Record List → Edit Record: links to (evidence: `index.php`)
- Record List → Delete Record: links to (evidence: `index.php`)
- Add Record → Validation: validates input (evidence: `add.php`)
- Add Record → CRUD Operations: inserts record (evidence: `add.php`)
- Edit Record → Validation: validates input (evidence: `edit.php`)
- Edit Record → CRUD Operations: loads and updates (evidence: `edit.php`)
- Delete Record → CRUD Operations: deletes record (evidence: `delete.php`)
- CRUD Operations → DB Configuration: extends and initializes (evidence: `includes/Crud.php`)
- DB Configuration → MySQL Database: opens connection (evidence: `includes/DbConfig.php`)
- CRUD Operations → MySQL Database: queries records (evidence: `includes/Crud.php`)
- Database Schema → MySQL Database: sets up schema (evidence: `README.md`)
