# radanpro/onlone-shopping architecture

> Architecture diagram of the GitHub repository radanpro/onlone-shopping, 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/radanpro/onlone-shopping
- Repository: https://github.com/radanpro/onlone-shopping

## Overview

This is a PHP/PDO online shop. Visitors browse category-led product listings and product details; registered users can manage accounts, save products to a wishlist, add items to a cart, and view orders. Administrators manage catalog categories and products, users, and orders. The graph separates storefront, account and shopping, administration, and shared infrastructure. Some workflow links rely on README or source-index evidence because relevant files were not excerpted; checkout completion is not shown and is not modeled as implemented.

Main entry points: [`config.php`](https://github.com/radanpro/onlone-shopping/blob/main/config.php) (PDO and sessions), [`index.php`](https://github.com/radanpro/onlone-shopping/blob/main/index.php) (Product catalog), [`admin/dashboard.php`](https://github.com/radanpro/onlone-shopping/blob/main/admin/dashboard.php) (Admin dashboard), [`product_details.php`](https://github.com/radanpro/onlone-shopping/blob/main/product_details.php) (Product details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Product catalog<br/>[index.php]"]
  node_details["Product details"]
end

subgraph group_accounts["Accounts and shopping"]
  node_registration["Registration<br/>[register.php]"]
  node_login["Login<br/>[login.php]"]
  node_logout["Logout<br/>[logout.php]"]
  node_profile["Profile management<br/>[profile.php]"]
  node_cart["Cart actions<br/>[add_to_cart.php]"]
  node_wishlist_action["Wishlist actions"]
  node_wishlist["Wishlist view<br/>[wishlist.php]"]
  node_my_orders["Order history<br/>[my_orders.php]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[dashboard.php]"]
  node_admin_catalog["Product management<br/>[products.php]"]
  node_admin_categories["Category management<br/>[categories.php]"]
  node_admin_users["User management<br/>[users.php]"]
  node_admin_orders["Order management<br/>[orders.php]"]
  node_order_details["Order details<br/>[order_details.php]"]
end

subgraph group_shared["Shared infrastructure"]
  node_functions["Auth and sanitization<br/>[functions.php]"]
  node_header["Shared navigation<br/>[header.php]"]
  node_footer["Shared footer<br/>[footer.php]"]
  node_database[("MySQL database<br/>[db.sql]")]
  node_connection["PDO and sessions<br/>[config.php]"]
end

node_visitor(("Shopper"))

node_visitor -->|"browses"| node_catalog
node_catalog -->|"opens product"| node_details
node_visitor -->|"creates account"| node_registration
node_visitor -->|"signs in"| node_login
node_visitor -->|"adds product"| node_catalog
node_details -->|"posts cart action"| node_cart
node_details -->|"posts wishlist action"| node_wishlist_action
node_visitor -->|"edits profile"| node_profile
node_visitor -->|"views saved items"| node_wishlist
node_visitor -->|"views orders"| node_my_orders
node_my_orders -->|"reads order items"| node_database
node_wishlist -->|"reads saved products"| node_database
node_profile -->|"reads and updates"| node_database
node_visitor -->|"administers shop"| node_admin_dashboard
node_admin_dashboard -.->|"manages products"| node_admin_catalog
node_admin_dashboard -.->|"manages categories"| node_admin_categories
node_admin_dashboard -.->|"manages users"| node_admin_users
node_admin_dashboard -.->|"manages orders"| node_admin_orders
node_admin_orders -->|"opens order"| node_order_details
node_catalog -->|"loads PDO"| node_connection
node_details -->|"loads PDO"| node_connection
node_registration -->|"loads PDO"| node_connection
node_cart -->|"loads PDO"| node_connection
node_wishlist_action -->|"loads PDO"| node_connection
node_admin_catalog -->|"loads PDO"| node_connection
node_admin_categories -->|"loads PDO"| node_connection
node_connection -->|"connects"| node_database
node_catalog -->|"uses auth helpers"| node_functions
node_profile -->|"uses auth helpers"| node_functions
node_admin_catalog -->|"checks admin"| node_functions
node_catalog -->|"includes navigation"| node_header
node_details -->|"includes navigation"| node_header
node_profile -->|"includes footer"| node_footer
node_catalog -.->|"includes footer"| node_footer
node_login -->|"loads PDO"| node_connection
node_logout -->|"loads helpers"| node_functions
node_admin_dashboard -->|"loads PDO"| node_connection
node_admin_users -->|"loads PDO"| node_connection
node_admin_orders -->|"loads PDO"| node_connection
node_order_details -->|"loads PDO"| node_connection

click node_catalog "https://github.com/radanpro/onlone-shopping/blob/main/index.php"
click node_details "https://github.com/radanpro/onlone-shopping/blob/main/product_details.php"
click node_registration "https://github.com/radanpro/onlone-shopping/blob/main/register.php"
click node_login "https://github.com/radanpro/onlone-shopping/blob/main/login.php"
click node_logout "https://github.com/radanpro/onlone-shopping/blob/main/logout.php"
click node_profile "https://github.com/radanpro/onlone-shopping/blob/main/user/profile.php"
click node_cart "https://github.com/radanpro/onlone-shopping/blob/main/add_to_cart.php"
click node_wishlist_action "https://github.com/radanpro/onlone-shopping/blob/main/add_to_wishlist.php"
click node_wishlist "https://github.com/radanpro/onlone-shopping/blob/main/user/wishlist.php"
click node_my_orders "https://github.com/radanpro/onlone-shopping/blob/main/user/my_orders.php"
click node_admin_dashboard "https://github.com/radanpro/onlone-shopping/blob/main/admin/dashboard.php"
click node_admin_catalog "https://github.com/radanpro/onlone-shopping/blob/main/admin/products.php"
click node_admin_categories "https://github.com/radanpro/onlone-shopping/blob/main/admin/categories.php"
click node_admin_users "https://github.com/radanpro/onlone-shopping/blob/main/admin/users.php"
click node_admin_orders "https://github.com/radanpro/onlone-shopping/blob/main/admin/orders.php"
click node_order_details "https://github.com/radanpro/onlone-shopping/blob/main/admin/order_details.php"
click node_functions "https://github.com/radanpro/onlone-shopping/blob/main/includes/functions.php"
click node_header "https://github.com/radanpro/onlone-shopping/blob/main/includes/header.php"
click node_footer "https://github.com/radanpro/onlone-shopping/blob/main/includes/footer.php"
click node_database "https://github.com/radanpro/onlone-shopping/blob/main/db.sql"
click node_connection "https://github.com/radanpro/onlone-shopping/blob/main/config.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_catalog,node_details toneBlue
class node_registration,node_login,node_logout,node_profile,node_cart,node_wishlist_action,node_wishlist,node_my_orders toneAmber
class node_admin_dashboard,node_admin_catalog,node_admin_categories,node_admin_users,node_admin_orders,node_order_details toneMint
class node_functions,node_header,node_footer,node_database,node_connection toneRose
class node_visitor toneIndigo
```

## Components

### Storefront

- [Product catalog](https://github.com/radanpro/onlone-shopping/blob/main/index.php): `index.php`
- [Product details](https://github.com/radanpro/onlone-shopping/blob/main/product_details.php): `product_details.php`

### Accounts and shopping

- [Registration](https://github.com/radanpro/onlone-shopping/blob/main/register.php): `register.php`
- [Login](https://github.com/radanpro/onlone-shopping/blob/main/login.php): `login.php`
- [Logout](https://github.com/radanpro/onlone-shopping/blob/main/logout.php): `logout.php`
- [Profile management](https://github.com/radanpro/onlone-shopping/blob/main/user/profile.php): `user/profile.php`
- [Cart actions](https://github.com/radanpro/onlone-shopping/blob/main/add_to_cart.php): `add_to_cart.php`
- [Wishlist actions](https://github.com/radanpro/onlone-shopping/blob/main/add_to_wishlist.php): `add_to_wishlist.php`
- [Wishlist view](https://github.com/radanpro/onlone-shopping/blob/main/user/wishlist.php): `user/wishlist.php`
- [Order history](https://github.com/radanpro/onlone-shopping/blob/main/user/my_orders.php): `user/my_orders.php`

### Administration

- [Admin dashboard](https://github.com/radanpro/onlone-shopping/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Product management](https://github.com/radanpro/onlone-shopping/blob/main/admin/products.php): `admin/products.php`
- [Category management](https://github.com/radanpro/onlone-shopping/blob/main/admin/categories.php): `admin/categories.php`
- [User management](https://github.com/radanpro/onlone-shopping/blob/main/admin/users.php): `admin/users.php`
- [Order management](https://github.com/radanpro/onlone-shopping/blob/main/admin/orders.php): `admin/orders.php`
- [Order details](https://github.com/radanpro/onlone-shopping/blob/main/admin/order_details.php): `admin/order_details.php`

### Shared infrastructure

- [Auth and sanitization](https://github.com/radanpro/onlone-shopping/blob/main/includes/functions.php): `includes/functions.php`
- [Shared navigation](https://github.com/radanpro/onlone-shopping/blob/main/includes/header.php): `includes/header.php`
- [Shared footer](https://github.com/radanpro/onlone-shopping/blob/main/includes/footer.php): `includes/footer.php`
- [MySQL database](https://github.com/radanpro/onlone-shopping/blob/main/db.sql): `db.sql`
- [PDO and sessions](https://github.com/radanpro/onlone-shopping/blob/main/config.php): `config.php`

### Other components

- **Shopper**

## Connections

- Shopper → Product catalog: browses (evidence: `README.md`)
- Product catalog → Product details: opens product (evidence: `index.php`)
- Shopper → Registration: creates account (evidence: `README.md`)
- Shopper → Login: signs in (evidence: `README.md`)
- Shopper → Product catalog: adds product
- Product details → Cart actions: posts cart action (evidence: `product_details.php`)
- Product details → Wishlist actions: posts wishlist action (evidence: `product_details.php`)
- Shopper → Profile management: edits profile (evidence: `README.md`)
- Shopper → Wishlist view: views saved items (evidence: `README.md`)
- Shopper → Order history: views orders (evidence: `README.md`)
- Order history → MySQL database: reads order items (evidence: `user/my_orders.php`)
- Wishlist view → MySQL database: reads saved products (evidence: `user/wishlist.php`)
- Profile management → MySQL database: reads and updates (evidence: `user/profile.php`)
- Shopper → Admin dashboard: administers shop (evidence: `README.md`)
- Admin dashboard → Product management: manages products
- Admin dashboard → Category management: manages categories
- Admin dashboard → User management: manages users
- Admin dashboard → Order management: manages orders
- Order management → Order details: opens order (evidence: `admin/orders.php`)
- Product catalog → PDO and sessions: loads PDO (evidence: `index.php`)
- Product details → PDO and sessions: loads PDO (evidence: `product_details.php`)
- Registration → PDO and sessions: loads PDO (evidence: `register.php`)
- Cart actions → PDO and sessions: loads PDO (evidence: `add_to_cart.php`)
- Wishlist actions → PDO and sessions: loads PDO (evidence: `add_to_wishlist.php`)
- Product management → PDO and sessions: loads PDO (evidence: `admin/products.php`)
- Category management → PDO and sessions: loads PDO (evidence: `admin/categories.php`)
- PDO and sessions → MySQL database: connects (evidence: `config.php`)
- Product catalog → Auth and sanitization: uses auth helpers (evidence: `index.php`)
- Profile management → Auth and sanitization: uses auth helpers (evidence: `user/profile.php`)
- Product management → Auth and sanitization: checks admin (evidence: `admin/products.php`)
- Product catalog → Shared navigation: includes navigation (evidence: `index.php`)
- Product details → Shared navigation: includes navigation (evidence: `product_details.php`)
- Profile management → Shared footer: includes footer (evidence: `user/profile.php`)
- Product catalog → Shared footer: includes footer (evidence: `index.php`)
- Login → PDO and sessions: loads PDO (evidence: `login.php`)
- Logout → Auth and sanitization: loads helpers (evidence: `logout.php`)
- Admin dashboard → PDO and sessions: loads PDO (evidence: `admin/dashboard.php`)
- User management → PDO and sessions: loads PDO (evidence: `admin/users.php`)
- Order management → PDO and sessions: loads PDO (evidence: `admin/orders.php`)
- Order details → PDO and sessions: loads PDO (evidence: `admin/order_details.php`)
