# realjoker0921/blessedpastore architecture

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

- Interactive diagram: https://gitdiagram.com/realjoker0921/blessedpastore
- Repository: https://github.com/realjoker0921/blessedpastore

## Overview

This is a PHP web app for managing store products, suppliers, sales, and reports. A user signs in or creates an account, reaches the dashboard, then manages inventory or suppliers and records sales; the app also presents dashboard summaries and sales reports. Page handlers share a PDO connection to MySQL, while session checks protect the operational pages. The excerpts show authentication and dashboard queries directly; several operational handlers are partial, so their database links rely on the source index rather than complete excerpts.

Main entry points: [`index.php`](https://github.com/realjoker0921/blessedpastore/blob/main/index.php) (Sign in / sign up), [`dbcon.php`](https://github.com/realjoker0921/blessedpastore/blob/main/dbcon.php) (PDO connection), [`dashboard.php`](https://github.com/realjoker0921/blessedpastore/blob/main/dashboard.php) (Dashboard), [`product.php`](https://github.com/realjoker0921/blessedpastore/blob/main/product.php) (Product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_auth["Sign in / sign up<br/>[index.php]"]
  node_auth_ui["Auth interactions<br/>[script.js]"]
  node_logout["Session logout<br/>[logout.php]"]
end

subgraph group_operations["Store Operations"]
  node_products["Product management<br/>[product.php]"]
  node_suppliers["Supplier management<br/>[suppliers.php]"]
  node_sales["Sale recording<br/>[sales.php]"]
end

subgraph group_insights["Store Insights"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_reports["Sales reports<br/>[reports.php]"]
end

subgraph group_persistence["Persistence"]
  node_connection["PDO connection<br/>[dbcon.php]"]
  node_mysql[("MySQL database")]
end

node_user(("Store user"))

node_user -->|"submits credentials"| node_auth
node_auth_ui -->|"controls form"| node_auth
node_auth -->|"queries users"| node_connection
node_auth -->|"redirects on success"| node_dashboard
node_user -.->|"opens workspace"| node_dashboard
node_dashboard -->|"queries summaries"| node_connection
node_products -->|"uses database"| node_connection
node_suppliers -->|"uses database"| node_connection
node_sales -->|"uses database"| node_connection
node_reports -->|"uses database"| node_connection
node_connection -->|"connects PDO"| node_mysql
node_products -->|"redirects unauthenticated"| node_auth
node_suppliers -->|"redirects unauthenticated"| node_auth
node_sales -->|"redirects unauthenticated"| node_auth
node_reports -->|"redirects unauthenticated"| node_auth
node_user -->|"requests sign out"| node_logout
node_logout -->|"redirects after clearing session"| node_auth

click node_auth "https://github.com/realjoker0921/blessedpastore/blob/main/index.php"
click node_auth_ui "https://github.com/realjoker0921/blessedpastore/blob/main/script.js"
click node_logout "https://github.com/realjoker0921/blessedpastore/blob/main/logout.php"
click node_dashboard "https://github.com/realjoker0921/blessedpastore/blob/main/dashboard.php"
click node_products "https://github.com/realjoker0921/blessedpastore/blob/main/product.php"
click node_suppliers "https://github.com/realjoker0921/blessedpastore/blob/main/suppliers.php"
click node_sales "https://github.com/realjoker0921/blessedpastore/blob/main/sales.php"
click node_reports "https://github.com/realjoker0921/blessedpastore/blob/main/reports.php"
click node_connection "https://github.com/realjoker0921/blessedpastore/blob/main/dbcon.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_auth,node_auth_ui,node_logout,node_user toneBlue
class node_products,node_suppliers,node_sales toneAmber
class node_dashboard,node_reports toneMint
class node_connection,node_mysql toneRose
```

## Components

### Authentication

- [Sign in / sign up](https://github.com/realjoker0921/blessedpastore/blob/main/index.php): `index.php`
- [Auth interactions](https://github.com/realjoker0921/blessedpastore/blob/main/script.js): `script.js`
- [Session logout](https://github.com/realjoker0921/blessedpastore/blob/main/logout.php): `logout.php`

### Store Operations

- [Product management](https://github.com/realjoker0921/blessedpastore/blob/main/product.php): `product.php`
- [Supplier management](https://github.com/realjoker0921/blessedpastore/blob/main/suppliers.php): `suppliers.php`
- [Sale recording](https://github.com/realjoker0921/blessedpastore/blob/main/sales.php): `sales.php`

### Store Insights

- [Dashboard](https://github.com/realjoker0921/blessedpastore/blob/main/dashboard.php): `dashboard.php`
- [Sales reports](https://github.com/realjoker0921/blessedpastore/blob/main/reports.php): `reports.php`

### Persistence

- [PDO connection](https://github.com/realjoker0921/blessedpastore/blob/main/dbcon.php): `dbcon.php`
- **MySQL database**

### Other components

- **Store user**

## Connections

- Store user → Sign in / sign up: submits credentials (evidence: `index.php`)
- Auth interactions → Sign in / sign up: controls form (evidence: `index.php`)
- Sign in / sign up → PDO connection: queries users (evidence: `index.php`)
- Sign in / sign up → Dashboard: redirects on success (evidence: `index.php`)
- Store user → Dashboard: opens workspace
- Dashboard → PDO connection: queries summaries (evidence: `dashboard.php`)
- Product management → PDO connection: uses database (evidence: `product.php`)
- Supplier management → PDO connection: uses database (evidence: `suppliers.php`)
- Sale recording → PDO connection: uses database (evidence: `sales.php`)
- Sales reports → PDO connection: uses database (evidence: `reports.php`)
- PDO connection → MySQL database: connects PDO (evidence: `dbcon.php`)
- Product management → Sign in / sign up: redirects unauthenticated (evidence: `product.php`)
- Supplier management → Sign in / sign up: redirects unauthenticated (evidence: `suppliers.php`)
- Sale recording → Sign in / sign up: redirects unauthenticated (evidence: `sales.php`)
- Sales reports → Sign in / sign up: redirects unauthenticated (evidence: `reports.php`)
- Store user → Session logout: requests sign out (evidence: `logout.php`)
- Session logout → Sign in / sign up: redirects after clearing session (evidence: `logout.php`)
