# comp-alex/labscentique architecture

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

- Interactive diagram: https://gitdiagram.com/comp-alex/labscentique
- Repository: https://github.com/comp-alex/labscentique

## Overview

LabScentique is a PHP perfume storefront and inventory-management application. Customers browse the catalog, manage accounts and favorites, and submit reviews; staff use a dashboard to adjust stock and manage purchase lists. The sampled code shows page entry points, JSON endpoints, and PDO-backed persistence. The README documents the wider product capabilities, but several frontend-to-endpoint connections and the accreditation page’s role are not established by the excerpts, so those links are omitted or marked unverified.

Main entry points: [`config/config.php`](https://github.com/comp-alex/labscentique/blob/main/config/config.php) (Database Configuration), [`database/init.sql`](https://github.com/comp-alex/labscentique/blob/main/database/init.sql) (Application Database), [`public/index.php`](https://github.com/comp-alex/labscentique/blob/main/public/index.php) (Storefront Entry), [`api/reviews.php`](https://github.com/comp-alex/labscentique/blob/main/api/reviews.php) (Reviews API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_storefront_entry["Storefront Entry<br/>[index.php]"]
  node_catalog_view["Catalog View<br/>[index_view.php]"]
  node_catalog_data["Catalog and Purchase API<br/>[data.php]"]
  node_accreditation["Accreditation Page<br/>[accreditation.php]"]
  node_review_api["Reviews API<br/>[reviews.php]"]
  node_review_route["Reviews Route<br/>[reviews.php]"]
end

subgraph group_accounts["Customer Accounts"]
  node_profile_page["Profile Page<br/>[profile.php]"]
  node_profile_api["Profile API<br/>[user-profile.php]"]
  node_favorites_api["Favorites and Purchases API<br/>[user-favorites.php]"]
end

subgraph group_operations["Store Operations"]
  node_dashboard_page["Staff Dashboard<br/>[dashboard.php]"]
  node_dashboard_api["Dashboard API<br/>[dashboard.php]"]
end

subgraph group_platform["Application Data"]
  node_db_config["Database Configuration<br/>[config.php]"]
  node_db_store[("Application Database<br/>[init.sql]")]
end

node_customer(("Customer"))
node_staff(("Store Staff"))
node_browser["Web Browser"]

node_customer -->|"uses"| node_browser
node_staff -->|"uses"| node_browser
node_browser -->|"opens"| node_storefront_entry
node_storefront_entry -->|"loads"| node_db_config
node_storefront_entry -->|"renders"| node_catalog_view
node_browser -.->|"browses"| node_catalog_view
node_browser -.->|"submits reviews"| node_review_route
node_review_route -->|"delegates"| node_review_api
node_review_api -->|"loads"| node_db_config
node_review_api -->|"reads and updates"| node_db_store
node_browser -.->|"opens"| node_profile_page
node_profile_page -->|"fetches purchases"| node_favorites_api
node_profile_page -.->|"updates profile"| node_profile_api
node_profile_api -->|"loads"| node_db_config
node_profile_api -->|"reads and updates"| node_db_store
node_favorites_api -.->|"loads"| node_db_config
node_favorites_api -->|"reads and updates"| node_db_store
node_staff -->|"manages stock"| node_dashboard_page
node_dashboard_page -->|"refreshes data"| node_dashboard_api
node_dashboard_page -->|"updates inventory"| node_db_store
node_dashboard_api -->|"loads"| node_db_config
node_dashboard_api -.->|"reads and updates"| node_db_store
node_catalog_data -->|"loads"| node_db_config
node_catalog_data -->|"reads and updates"| node_db_store
node_browser -.->|"requests catalog"| node_catalog_data

click node_storefront_entry "https://github.com/comp-alex/labscentique/blob/main/public/index.php"
click node_catalog_view "https://github.com/comp-alex/labscentique/blob/main/public/index_view.php"
click node_catalog_data "https://github.com/comp-alex/labscentique/blob/main/api/data.php"
click node_accreditation "https://github.com/comp-alex/labscentique/blob/main/public/accreditation.php"
click node_review_api "https://github.com/comp-alex/labscentique/blob/main/api/reviews.php"
click node_review_route "https://github.com/comp-alex/labscentique/blob/main/public/api/reviews.php"
click node_profile_page "https://github.com/comp-alex/labscentique/blob/main/public/profile.php"
click node_profile_api "https://github.com/comp-alex/labscentique/blob/main/api/user-profile.php"
click node_favorites_api "https://github.com/comp-alex/labscentique/blob/main/api/user-favorites.php"
click node_dashboard_page "https://github.com/comp-alex/labscentique/blob/main/public/dashboard.php"
click node_dashboard_api "https://github.com/comp-alex/labscentique/blob/main/api/dashboard.php"
click node_db_config "https://github.com/comp-alex/labscentique/blob/main/config/config.php"
click node_db_store "https://github.com/comp-alex/labscentique/blob/main/database/init.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_storefront_entry,node_catalog_view,node_catalog_data,node_accreditation,node_review_api,node_review_route,node_browser toneBlue
class node_profile_page,node_profile_api,node_favorites_api toneAmber
class node_dashboard_page,node_dashboard_api toneMint
class node_db_config,node_db_store toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Storefront

- [Storefront Entry](https://github.com/comp-alex/labscentique/blob/main/public/index.php): `public/index.php`
- [Catalog View](https://github.com/comp-alex/labscentique/blob/main/public/index_view.php): `public/index_view.php`
- [Catalog and Purchase API](https://github.com/comp-alex/labscentique/blob/main/api/data.php): `api/data.php`
- [Accreditation Page](https://github.com/comp-alex/labscentique/blob/main/public/accreditation.php): `public/accreditation.php`
- [Reviews API](https://github.com/comp-alex/labscentique/blob/main/api/reviews.php): `api/reviews.php`
- [Reviews Route](https://github.com/comp-alex/labscentique/blob/main/public/api/reviews.php): `public/api/reviews.php`

### Customer Accounts

- [Profile Page](https://github.com/comp-alex/labscentique/blob/main/public/profile.php): `public/profile.php`
- [Profile API](https://github.com/comp-alex/labscentique/blob/main/api/user-profile.php): `api/user-profile.php`
- [Favorites and Purchases API](https://github.com/comp-alex/labscentique/blob/main/api/user-favorites.php): `api/user-favorites.php`

### Store Operations

- [Staff Dashboard](https://github.com/comp-alex/labscentique/blob/main/public/dashboard.php): `public/dashboard.php`
- [Dashboard API](https://github.com/comp-alex/labscentique/blob/main/api/dashboard.php): `api/dashboard.php`

### Application Data

- [Database Configuration](https://github.com/comp-alex/labscentique/blob/main/config/config.php): `config/config.php`
- [Application Database](https://github.com/comp-alex/labscentique/blob/main/database/init.sql): `database/init.sql`

### Other components

- **Customer**
- **Store Staff**
- **Web Browser**

## Connections

- Customer → Web Browser: uses (evidence: `README.md`)
- Store Staff → Web Browser: uses (evidence: `README.md`)
- Web Browser → Storefront Entry: opens (evidence: `README.md`)
- Storefront Entry → Database Configuration: loads (evidence: `public/index.php`)
- Storefront Entry → Catalog View: renders (evidence: `public/index.php`)
- Web Browser → Catalog View: browses (evidence: `README.md`)
- Web Browser → Reviews Route: submits reviews (evidence: `README.md`)
- Reviews Route → Reviews API: delegates (evidence: `public/api/reviews.php`)
- Reviews API → Database Configuration: loads (evidence: `api/reviews.php`)
- Reviews API → Application Database: reads and updates (evidence: `api/reviews.php`)
- Web Browser → Profile Page: opens (evidence: `README.md`)
- Profile Page → Favorites and Purchases API: fetches purchases (evidence: `public/profile.php`)
- Profile Page → Profile API: updates profile
- Profile API → Database Configuration: loads (evidence: `api/user-profile.php`)
- Profile API → Application Database: reads and updates (evidence: `api/user-profile.php`)
- Favorites and Purchases API → Database Configuration: loads (evidence: `api/user-favorites.php`)
- Favorites and Purchases API → Application Database: reads and updates (evidence: `api/user-favorites.php`)
- Store Staff → Staff Dashboard: manages stock (evidence: `README.md`)
- Staff Dashboard → Dashboard API: refreshes data (evidence: `public/dashboard.php`)
- Staff Dashboard → Application Database: updates inventory (evidence: `public/dashboard.php`)
- Dashboard API → Database Configuration: loads (evidence: `api/dashboard.php`)
- Dashboard API → Application Database: reads and updates
- Catalog and Purchase API → Database Configuration: loads (evidence: `api/data.php`)
- Catalog and Purchase API → Application Database: reads and updates (evidence: `api/data.php`)
- Web Browser → Catalog and Purchase API: requests catalog
