# lacdudinh23-jimo/indexing-strategy architecture

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

- Interactive diagram: https://gitdiagram.com/lacdudinh23-jimo/indexing-strategy
- Repository: https://github.com/lacdudinh23-jimo/indexing-strategy

## Overview

This is a browser-based MySQL indexing demo. Users generate sample book rows, choose a query scenario, and compare full-scan and indexed benchmark results, including plans, timing, build cost, and index size. The frontend coordinates the workflow through a PHP JSON API; the API performs database setup, generation, query planning, and measurement against MySQL. Other advertised algorithm descriptions are frontend content, while the executable benchmark scenarios shown are ISBN, price, and title. HTML and styling are present in the tree, but their behavior is not established by the excerpts.

Main entry points: [`api.php`](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/api.php) (JSON API), [`db.php`](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/db.php) (DB connection), [`script.js`](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/script.js) (Workflow controller), [`index.html`](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/index.html) (Demo interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser interface"]
  node_ui["Demo interface<br/>[index.html]"]
  node_frontend_flow["Workflow controller<br/>[script.js]"]
end

subgraph group_backend["API and benchmark"]
  node_api["JSON API<br/>[api.php]"]
end

subgraph group_storage["MySQL storage"]
  node_connection["DB connection<br/>[db.php]"]
  node_books[("Books table<br/>[db.php]")]
end

node_user(("Demo user"))
node_mysql[("MySQL server")]

node_user -->|"uses"| node_ui
node_ui -.->|"hosts controller"| node_frontend_flow
node_frontend_flow -->|"POST actions"| node_api
node_api -->|"requires setup"| node_connection
node_api -->|"queries and mutates"| node_books
node_connection -->|"connects"| node_mysql
node_connection -->|"creates and selects"| node_books
node_api -->|"returns JSON results"| node_frontend_flow

click node_ui "https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/index.html"
click node_frontend_flow "https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/script.js"
click node_api "https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/api.php"
click node_connection "https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/db.php"
click node_books "https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/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_ui,node_frontend_flow,node_user toneBlue
class node_api,node_mysql toneAmber
class node_connection,node_books toneMint
```

## Components

### Browser interface

- [Demo interface](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/index.html): `index.html`
- [Workflow controller](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/script.js): `script.js`

### API and benchmark

- [JSON API](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/api.php): `api.php`

### MySQL storage

- [DB connection](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/db.php): `db.php`
- [Books table](https://github.com/lacdudinh23-jimo/indexing-strategy/blob/main/db.php): `db.php`

### Other components

- **Demo user**
- **MySQL server**

## Connections

- Demo user → Demo interface: uses
- Demo interface → Workflow controller: hosts controller
- Workflow controller → JSON API: POST actions (evidence: `script.js`)
- JSON API → DB connection: requires setup (evidence: `api.php`)
- JSON API → Books table: queries and mutates (evidence: `api.php`)
- DB connection → MySQL server: connects (evidence: `db.php`)
- DB connection → Books table: creates and selects (evidence: `db.php`)
- JSON API → Workflow controller: returns JSON results (evidence: `script.js`)
