# thomasalfareno/hki-store architecture

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

- Interactive diagram: https://gitdiagram.com/thomasalfareno/hki-store
- Repository: https://github.com/thomasalfareno/hki-store

## Overview

PlayDisc Store is a PHP/MySQL game-disc shop. The documented path is database setup and seeding, then entering the storefront to browse and manage shopping, orders, accounts, and reviews; the API also exposes SQL simulation and data-management actions. The excerpts show installer-to-schema execution, page loading through the shared database helper, and API database operations. Front-end-to-API wiring is not shown in the sampled source, so that relationship is marked unverified.

Main entry points: [`install.php`](https://github.com/thomasalfareno/hki-store/blob/main/install.php) (Database installer), [`assets/app.js`](https://github.com/thomasalfareno/hki-store/blob/main/assets/app.js) (Store interactions), [`index.php`](https://github.com/thomasalfareno/hki-store/blob/main/index.php) (Store page), [`config/helper_db.php`](https://github.com/thomasalfareno/hki-store/blob/main/config/helper_db.php) (Table data helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Database Setup"]
  node_installer["Database installer<br/>[install.php]"]
  node_schema["Table schema<br/>[01_DDL.sql]"]
  node_seed["Sample data<br/>[02_DML.sql]"]
  node_connection["Connection settings"]
end

subgraph group_shop["Storefront"]
  node_storefront["Store page<br/>[index.php]"]
  node_shop_ui["Store interactions<br/>[app.js]"]
  node_styling["Responsive interface<br/>[style.css]"]
end

subgraph group_commerce["Commerce"]
  node_db_helper["Table data helper<br/>[helper_db.php]"]
  node_commerce_api["Shopping and orders<br/>[api.php]"]
end

subgraph group_management["Data Management"]
  node_catalog_api["Catalog management<br/>[api.php]"]
  node_reviews_api["Reviews and accounts<br/>[api.php]"]
  node_sql_simulator["SQL simulator<br/>[api.php]"]
end

node_operator(("Store operator"))
node_shopper(("Shopper"))
node_mysql[("MySQL database")]

node_operator -->|"configures"| node_installer
node_installer -->|"creates database"| node_mysql
node_installer -->|"executes schema"| node_schema
node_installer -->|"loads seed"| node_seed
node_installer -->|"writes settings"| node_connection
node_shopper -->|"opens store"| node_storefront
node_storefront -->|"loads data helper"| node_db_helper
node_db_helper -->|"reads tables"| node_mysql
node_shop_ui -.->|"sends shop actions"| node_commerce_api
node_shop_ui -.->|"sends management actions"| node_catalog_api
node_shop_ui -.->|"sends review actions"| node_reviews_api
node_shop_ui -.->|"submits SQL"| node_sql_simulator
node_commerce_api -->|"reads and writes"| node_mysql
node_catalog_api -->|"manages records"| node_mysql
node_reviews_api -->|"stores reviews"| node_mysql
node_sql_simulator -->|"executes queries"| node_mysql

click node_installer "https://github.com/thomasalfareno/hki-store/blob/main/install.php"
click node_schema "https://github.com/thomasalfareno/hki-store/blob/main/database/01_DDL.sql"
click node_seed "https://github.com/thomasalfareno/hki-store/blob/main/database/02_DML.sql"
click node_connection "https://github.com/thomasalfareno/hki-store/blob/main/config/koneksi.example.php"
click node_storefront "https://github.com/thomasalfareno/hki-store/blob/main/index.php"
click node_shop_ui "https://github.com/thomasalfareno/hki-store/blob/main/assets/app.js"
click node_styling "https://github.com/thomasalfareno/hki-store/blob/main/assets/style.css"
click node_db_helper "https://github.com/thomasalfareno/hki-store/blob/main/config/helper_db.php"
click node_commerce_api "https://github.com/thomasalfareno/hki-store/blob/main/api.php"
click node_catalog_api "https://github.com/thomasalfareno/hki-store/blob/main/api.php"
click node_reviews_api "https://github.com/thomasalfareno/hki-store/blob/main/api.php"
click node_sql_simulator "https://github.com/thomasalfareno/hki-store/blob/main/api.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_installer,node_schema,node_seed,node_connection toneBlue
class node_storefront,node_shop_ui,node_styling,node_mysql toneAmber
class node_db_helper,node_commerce_api toneMint
class node_catalog_api,node_reviews_api,node_sql_simulator toneRose
class node_operator,node_shopper toneIndigo
```

## Components

### Database Setup

- [Database installer](https://github.com/thomasalfareno/hki-store/blob/main/install.php): `install.php`
- [Table schema](https://github.com/thomasalfareno/hki-store/blob/main/database/01_DDL.sql): `database/01_DDL.sql`
- [Sample data](https://github.com/thomasalfareno/hki-store/blob/main/database/02_DML.sql): `database/02_DML.sql`
- [Connection settings](https://github.com/thomasalfareno/hki-store/blob/main/config/koneksi.example.php): `config/koneksi.example.php`

### Storefront

- [Store page](https://github.com/thomasalfareno/hki-store/blob/main/index.php): `index.php`
- [Store interactions](https://github.com/thomasalfareno/hki-store/blob/main/assets/app.js): `assets/app.js`
- [Responsive interface](https://github.com/thomasalfareno/hki-store/blob/main/assets/style.css): `assets/style.css`

### Commerce

- [Table data helper](https://github.com/thomasalfareno/hki-store/blob/main/config/helper_db.php): `config/helper_db.php`
- [Shopping and orders](https://github.com/thomasalfareno/hki-store/blob/main/api.php): `api.php`

### Data Management

- [Catalog management](https://github.com/thomasalfareno/hki-store/blob/main/api.php): `api.php`
- [Reviews and accounts](https://github.com/thomasalfareno/hki-store/blob/main/api.php): `api.php`
- [SQL simulator](https://github.com/thomasalfareno/hki-store/blob/main/api.php): `api.php`

### Other components

- **Store operator**
- **Shopper**
- **MySQL database**

## Connections

- Store operator → Database installer: configures (evidence: `README.md`)
- Database installer → MySQL database: creates database (evidence: `install.php`)
- Database installer → Table schema: executes schema (evidence: `install.php`)
- Database installer → Sample data: loads seed (evidence: `install.php`)
- Database installer → Connection settings: writes settings (evidence: `install.php`)
- Shopper → Store page: opens store (evidence: `README.md`)
- Store page → Table data helper: loads data helper (evidence: `index.php`)
- Table data helper → MySQL database: reads tables (evidence: `config/helper_db.php`)
- Store interactions → Shopping and orders: sends shop actions
- Store interactions → Catalog management: sends management actions
- Store interactions → Reviews and accounts: sends review actions
- Store interactions → SQL simulator: submits SQL
- Shopping and orders → MySQL database: reads and writes (evidence: `api.php`)
- Catalog management → MySQL database: manages records (evidence: `api.php`)
- Reviews and accounts → MySQL database: stores reviews (evidence: `api.php`)
- SQL simulator → MySQL database: executes queries (evidence: `api.php`)
