# josephamuasi001/php-crud architecture

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

- Interactive diagram: https://gitdiagram.com/josephamuasi001/php-crud
- Repository: https://github.com/josephamuasi001/php-crud

## Overview

The repository contains two small PHP student-record applications: a CRUD example and a student-management variant. Their main workflow is listing/searching students, opening a record, and adding or editing records; the CRUD example also supports deletion. Each page issues SQL through a locally configured PDO connection, and the student-management listing uses a separate grading helper. The README is empty, and the SQL files were not sampled, so schema details and any relationship to those files are not asserted.

Main entry points: [`student/public/index.php`](https://github.com/josephamuasi001/php-crud/blob/main/student/public/index.php) (List and search), [`crud/config/database.php`](https://github.com/josephamuasi001/php-crud/blob/main/crud/config/database.php) (PDO connection), [`crud/public/index.php`](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/index.php) (List and search), [`crud/public/view.php`](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/view.php) (View student)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crud_pages["CRUD pages"]
  node_crud_index["List and search<br/>[index.php]"]
  node_crud_add["Add student<br/>[add.php]"]
  node_crud_view["View student<br/>[view.php]"]
  node_crud_edit["Edit student<br/>[edit.php]"]
  node_crud_delete["Delete student<br/>[delete.php]"]
end

subgraph group_crud_data["CRUD data access"]
  node_crud_config["PDO connection<br/>[database.php]"]
end

subgraph group_student_pages["Student pages"]
  node_student_index["List and search<br/>[index.php]"]
  node_student_add["Add student<br/>[add.php]"]
  node_student_view["View student<br/>[view.php]"]
  node_student_edit["Edit student<br/>[edit.php]"]
  node_grader["Grade score<br/>[grader.php]"]
end

subgraph group_student_data["Student data access"]
  node_student_config["PDO connection<br/>[database.php]"]
end

node_user(("User"))
node_mysql[("MySQL database")]

node_user -->|"opens"| node_crud_index
node_crud_index -->|"links to"| node_crud_add
node_crud_index -->|"opens record"| node_crud_view
node_crud_view -->|"links to"| node_crud_edit
node_crud_view -->|"submits delete"| node_crud_delete
node_crud_index -->|"requires"| node_crud_config
node_crud_add -->|"requires"| node_crud_config
node_crud_view -->|"requires"| node_crud_config
node_crud_edit -->|"requires"| node_crud_config
node_crud_delete -->|"requires"| node_crud_config
node_crud_index -->|"queries students"| node_mysql
node_crud_add -->|"inserts student"| node_mysql
node_crud_view -->|"fetches student"| node_mysql
node_crud_edit -->|"updates student"| node_mysql
node_crud_delete -->|"deletes student"| node_mysql
node_crud_config -->|"connects to"| node_mysql
node_user -->|"opens"| node_student_index
node_student_index -->|"links to"| node_student_add
node_student_index -->|"opens record"| node_student_view
node_student_view -->|"links to"| node_student_edit
node_student_index -->|"grades scores"| node_grader
node_student_index -->|"requires"| node_student_config
node_student_add -->|"requires"| node_student_config
node_student_view -->|"requires"| node_student_config
node_student_edit -->|"requires"| node_student_config
node_student_index -->|"queries students"| node_mysql
node_student_add -->|"inserts student"| node_mysql
node_student_view -->|"fetches student"| node_mysql
node_student_edit -->|"updates student"| node_mysql
node_student_config -->|"connects to"| node_mysql

click node_crud_index "https://github.com/josephamuasi001/php-crud/blob/main/crud/public/index.php"
click node_crud_add "https://github.com/josephamuasi001/php-crud/blob/main/crud/public/add.php"
click node_crud_view "https://github.com/josephamuasi001/php-crud/blob/main/crud/public/view.php"
click node_crud_edit "https://github.com/josephamuasi001/php-crud/blob/main/crud/public/edit.php"
click node_crud_delete "https://github.com/josephamuasi001/php-crud/blob/main/crud/public/delete.php"
click node_crud_config "https://github.com/josephamuasi001/php-crud/blob/main/crud/config/database.php"
click node_student_index "https://github.com/josephamuasi001/php-crud/blob/main/student/public/index.php"
click node_student_add "https://github.com/josephamuasi001/php-crud/blob/main/student/public/add.php"
click node_student_view "https://github.com/josephamuasi001/php-crud/blob/main/student/public/view.php"
click node_student_edit "https://github.com/josephamuasi001/php-crud/blob/main/student/public/edit.php"
click node_grader "https://github.com/josephamuasi001/php-crud/blob/main/student/src/grader.php"
click node_student_config "https://github.com/josephamuasi001/php-crud/blob/main/student/config/database.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_crud_index,node_crud_add,node_crud_view,node_crud_edit,node_crud_delete,node_user toneBlue
class node_crud_config,node_mysql toneAmber
class node_student_index,node_student_add,node_student_view,node_student_edit,node_grader toneMint
class node_student_config toneRose
```

## Components

### CRUD pages

- [List and search](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/index.php): `crud/public/index.php`
- [Add student](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/add.php): `crud/public/add.php`
- [View student](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/view.php): `crud/public/view.php`
- [Edit student](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/edit.php): `crud/public/edit.php`
- [Delete student](https://github.com/josephamuasi001/php-crud/blob/main/crud/public/delete.php): `crud/public/delete.php`

### CRUD data access

- [PDO connection](https://github.com/josephamuasi001/php-crud/blob/main/crud/config/database.php): `crud/config/database.php`

### Student pages

- [List and search](https://github.com/josephamuasi001/php-crud/blob/main/student/public/index.php): `student/public/index.php`
- [Add student](https://github.com/josephamuasi001/php-crud/blob/main/student/public/add.php): `student/public/add.php`
- [View student](https://github.com/josephamuasi001/php-crud/blob/main/student/public/view.php): `student/public/view.php`
- [Edit student](https://github.com/josephamuasi001/php-crud/blob/main/student/public/edit.php): `student/public/edit.php`
- [Grade score](https://github.com/josephamuasi001/php-crud/blob/main/student/src/grader.php): `student/src/grader.php`

### Student data access

- [PDO connection](https://github.com/josephamuasi001/php-crud/blob/main/student/config/database.php): `student/config/database.php`

### Other components

- **User**
- **MySQL database**

## Connections

- User → List and search: opens (evidence: `crud/public/index.php`)
- List and search → Add student: links to (evidence: `crud/public/index.php`)
- List and search → View student: opens record (evidence: `crud/public/index.php`)
- View student → Edit student: links to (evidence: `crud/public/view.php`)
- View student → Delete student: submits delete (evidence: `crud/public/view.php`)
- List and search → PDO connection: requires (evidence: `crud/public/index.php`)
- Add student → PDO connection: requires (evidence: `crud/public/add.php`)
- View student → PDO connection: requires (evidence: `crud/public/view.php`)
- Edit student → PDO connection: requires (evidence: `crud/public/edit.php`)
- Delete student → PDO connection: requires (evidence: `crud/public/delete.php`)
- List and search → MySQL database: queries students (evidence: `crud/public/index.php`)
- Add student → MySQL database: inserts student (evidence: `crud/public/add.php`)
- View student → MySQL database: fetches student (evidence: `crud/public/view.php`)
- Edit student → MySQL database: updates student (evidence: `crud/public/edit.php`)
- Delete student → MySQL database: deletes student (evidence: `crud/public/delete.php`)
- PDO connection → MySQL database: connects to (evidence: `crud/config/database.php`)
- User → List and search: opens (evidence: `student/public/index.php`)
- List and search → Add student: links to (evidence: `student/public/index.php`)
- List and search → View student: opens record (evidence: `student/public/index.php`)
- View student → Edit student: links to (evidence: `student/public/view.php`)
- List and search → Grade score: grades scores (evidence: `student/public/index.php`)
- List and search → PDO connection: requires (evidence: `student/public/index.php`)
- Add student → PDO connection: requires (evidence: `student/public/add.php`)
- View student → PDO connection: requires (evidence: `student/public/view.php`)
- Edit student → PDO connection: requires (evidence: `student/public/edit.php`)
- List and search → MySQL database: queries students (evidence: `student/public/index.php`)
- Add student → MySQL database: inserts student (evidence: `student/public/add.php`)
- View student → MySQL database: fetches student (evidence: `student/public/view.php`)
- Edit student → MySQL database: updates student (evidence: `student/public/edit.php`)
- PDO connection → MySQL database: connects to (evidence: `student/config/database.php`)
