# dec-olgen/website architecture

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

- Interactive diagram: https://gitdiagram.com/dec-olgen/website
- Repository: https://github.com/dec-olgen/website

## Overview

employeedb is a PHP employee and department management application. Users enter through the dashboard and sidebar, then view/search records or follow separate insert, update, and delete flows; successful mutations return to a confirmation page. Reporting pages present aggregate and relationship queries, while the query runner exposes a numbered SQL exercise registry whose mutations affect the live database. The sampled pages connect directly to a shared PDO setup. The README provides no capability details, and some chooser and report implementations were not sampled, so their internal wiring is shown only where supported by the tree and navigation.

Main entry points: [`includes/db.php`](https://github.com/dec-olgen/website/blob/main/includes/db.php) (PDO connection), [`includes/sidebar.php`](https://github.com/dec-olgen/website/blob/main/includes/sidebar.php) (Sidebar navigation), [`pages/select_update.php`](https://github.com/dec-olgen/website/blob/main/pages/select_update.php) (Find update record), [`pages/success.php`](https://github.com/dec-olgen/website/blob/main/pages/success.php) (Mutation status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation"]
  node_dashboard["Dashboard<br/>[index.php]"]
  node_sidebar["Sidebar navigation<br/>[sidebar.php]"]
end

subgraph group_management["Record management"]
  node_choose_insert["Choose insert type<br/>[choose_insert.php]"]
  node_insert["Insert records<br/>[insert.php]"]
  node_choose_update["Choose update type<br/>[choose_update.php]"]
  node_select_update["Find update record<br/>[select_update.php]"]
  node_update["Update employee<br/>[update.php]"]
  node_update_department["Update department"]
  node_choose_delete["Choose delete type<br/>[choose_delete.php]"]
  node_select_delete["Find delete record<br/>[select_delete.php]"]
  node_delete["Confirm and delete<br/>[delete.php]"]
  node_view["View and search<br/>[view.php]"]
  node_success["Mutation status<br/>[success.php]"]
end

subgraph group_analysis["Reports and queries"]
  node_reports["Reports<br/>[reports.php]"]
  node_queries["Query runner<br/>[queries.php]"]
  node_query_functions["Query registry"]
end

subgraph group_data["Persistence"]
  node_pdo["PDO connection<br/>[db.php]"]
  node_mysql[("MySQL database")]
end

node_user(("User"))

node_user -->|"opens"| node_dashboard
node_dashboard -->|"includes"| node_sidebar
node_user -->|"navigates"| node_sidebar
node_sidebar -->|"links"| node_choose_insert
node_sidebar -->|"links"| node_choose_update
node_sidebar -->|"links"| node_choose_delete
node_sidebar -->|"links"| node_view
node_sidebar -->|"links"| node_reports
node_sidebar -->|"links"| node_queries
node_choose_insert -->|"routes"| node_insert
node_choose_update -->|"routes"| node_select_update
node_select_update -->|"selects employee"| node_update
node_select_update -->|"selects department"| node_update_department
node_choose_delete -->|"routes"| node_select_delete
node_select_delete -->|"selects record"| node_delete
node_insert -->|"uses"| node_pdo
node_update -->|"uses"| node_pdo
node_update_department -->|"uses"| node_pdo
node_select_update -->|"queries"| node_pdo
node_select_delete -->|"queries"| node_pdo
node_delete -->|"uses"| node_pdo
node_view -->|"queries"| node_pdo
node_reports -->|"queries"| node_pdo
node_queries -->|"dispatches"| node_query_functions
node_queries -->|"provides connection"| node_pdo
node_query_functions -->|"runs SQL"| node_pdo
node_dashboard -->|"counts records"| node_pdo
node_pdo -->|"reads and writes"| node_mysql
node_insert -->|"redirects after save"| node_success
node_update -->|"redirects after save"| node_success
node_update_department -->|"redirects after save"| node_success
node_delete -->|"redirects after delete"| node_success

click node_dashboard "https://github.com/dec-olgen/website/blob/main/index.php"
click node_sidebar "https://github.com/dec-olgen/website/blob/main/includes/sidebar.php"
click node_choose_insert "https://github.com/dec-olgen/website/blob/main/pages/choose_insert.php"
click node_insert "https://github.com/dec-olgen/website/blob/main/pages/insert.php"
click node_choose_update "https://github.com/dec-olgen/website/blob/main/pages/choose_update.php"
click node_select_update "https://github.com/dec-olgen/website/blob/main/pages/select_update.php"
click node_update "https://github.com/dec-olgen/website/blob/main/pages/update.php"
click node_update_department "https://github.com/dec-olgen/website/blob/main/pages/update_department.php"
click node_choose_delete "https://github.com/dec-olgen/website/blob/main/pages/choose_delete.php"
click node_select_delete "https://github.com/dec-olgen/website/blob/main/pages/select_delete.php"
click node_delete "https://github.com/dec-olgen/website/blob/main/pages/delete.php"
click node_view "https://github.com/dec-olgen/website/blob/main/pages/view.php"
click node_success "https://github.com/dec-olgen/website/blob/main/pages/success.php"
click node_reports "https://github.com/dec-olgen/website/blob/main/pages/reports.php"
click node_queries "https://github.com/dec-olgen/website/blob/main/pages/queries.php"
click node_query_functions "https://github.com/dec-olgen/website/blob/main/includes/query_functions.php"
click node_pdo "https://github.com/dec-olgen/website/blob/main/includes/db.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_dashboard,node_sidebar,node_user toneBlue
class node_choose_insert,node_insert,node_choose_update,node_select_update,node_update,node_update_department,node_choose_delete,node_select_delete,node_delete,node_view,node_success toneAmber
class node_reports,node_queries,node_query_functions toneMint
class node_pdo,node_mysql toneRose
```

## Components

### Navigation

- [Dashboard](https://github.com/dec-olgen/website/blob/main/index.php): `index.php`
- [Sidebar navigation](https://github.com/dec-olgen/website/blob/main/includes/sidebar.php): `includes/sidebar.php`

### Record management

- [Choose insert type](https://github.com/dec-olgen/website/blob/main/pages/choose_insert.php): `pages/choose_insert.php`
- [Insert records](https://github.com/dec-olgen/website/blob/main/pages/insert.php): `pages/insert.php`
- [Choose update type](https://github.com/dec-olgen/website/blob/main/pages/choose_update.php): `pages/choose_update.php`
- [Find update record](https://github.com/dec-olgen/website/blob/main/pages/select_update.php): `pages/select_update.php`
- [Update employee](https://github.com/dec-olgen/website/blob/main/pages/update.php): `pages/update.php`
- [Update department](https://github.com/dec-olgen/website/blob/main/pages/update_department.php): `pages/update_department.php`
- [Choose delete type](https://github.com/dec-olgen/website/blob/main/pages/choose_delete.php): `pages/choose_delete.php`
- [Find delete record](https://github.com/dec-olgen/website/blob/main/pages/select_delete.php): `pages/select_delete.php`
- [Confirm and delete](https://github.com/dec-olgen/website/blob/main/pages/delete.php): `pages/delete.php`
- [View and search](https://github.com/dec-olgen/website/blob/main/pages/view.php): `pages/view.php`
- [Mutation status](https://github.com/dec-olgen/website/blob/main/pages/success.php): `pages/success.php`

### Reports and queries

- [Reports](https://github.com/dec-olgen/website/blob/main/pages/reports.php): `pages/reports.php`
- [Query runner](https://github.com/dec-olgen/website/blob/main/pages/queries.php): `pages/queries.php`
- [Query registry](https://github.com/dec-olgen/website/blob/main/includes/query_functions.php): `includes/query_functions.php`

### Persistence

- [PDO connection](https://github.com/dec-olgen/website/blob/main/includes/db.php): `includes/db.php`
- **MySQL database**

### Other components

- **User**

## Connections

- User → Dashboard: opens
- Dashboard → Sidebar navigation: includes
- User → Sidebar navigation: navigates
- Sidebar navigation → Choose insert type: links
- Sidebar navigation → Choose update type: links
- Sidebar navigation → Choose delete type: links
- Sidebar navigation → View and search: links
- Sidebar navigation → Reports: links
- Sidebar navigation → Query runner: links
- Choose insert type → Insert records: routes
- Choose update type → Find update record: routes
- Find update record → Update employee: selects employee
- Find update record → Update department: selects department
- Choose delete type → Find delete record: routes
- Find delete record → Confirm and delete: selects record
- Insert records → PDO connection: uses
- Update employee → PDO connection: uses
- Update department → PDO connection: uses
- Find update record → PDO connection: queries
- Find delete record → PDO connection: queries
- Confirm and delete → PDO connection: uses
- View and search → PDO connection: queries
- Reports → PDO connection: queries
- Query runner → Query registry: dispatches
- Query runner → PDO connection: provides connection
- Query registry → PDO connection: runs SQL
- Dashboard → PDO connection: counts records
- PDO connection → MySQL database: reads and writes
- Insert records → Mutation status: redirects after save
- Update employee → Mutation status: redirects after save
- Update department → Mutation status: redirects after save
- Confirm and delete → Mutation status: redirects after delete
