# kittapat-deein/w13-clinicapp-66025560 architecture

> Architecture diagram of the GitHub repository kittapat-deein/w13-clinicapp-66025560, 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/kittapat-deein/w13-clinicapp-66025560
- Repository: https://github.com/kittapat-deein/w13-clinicapp-66025560

## Overview

This repository is a whiskey reservation app presented as a clinic-app starter: the sampled UI and API use whiskey and order terminology, while the README describes the Azure clinic deployment and legacy appointment endpoints. The user workflow is to browse and select a whiskey, submit reservation details, then review or cancel an order; the API reads and writes SQL data. Some UI request code was not excerpted, so the frontend-to-API relationship follows the README’s proxy/API description rather than a sampled call.

Main entry points: [`server/index.js`](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js) (Express API), [`server/db.js`](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/db.js) (SQL pool), [`web/src/App.jsx`](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/App.jsx) (Reservation UI), [`web/src/main.jsx`](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web app"]
  node_app_entry["React entry<br/>[main.jsx]"]
  node_reservation_ui["Reservation UI<br/>[App.jsx]"]
end

subgraph group_api["Reservation API"]
  node_api_service["Express API<br/>[index.js]"]
  node_catalog["Whiskey catalog<br/>[index.js]"]
  node_order_listing["Order history<br/>[index.js]"]
  node_order_booking["Create reservation<br/>[index.js]"]
  node_order_cancellation["Cancel reservation<br/>[index.js]"]
end

subgraph group_data["SQL persistence"]
  node_pool["SQL pool<br/>[db.js]"]
  node_sql_store[("Azure SQL<br/>[schema.sql]")]
  node_schema_seed["Schema and seed data<br/>[seed-data.sql]"]
end

node_visitor(("Visitor"))
node_azure_sql[("Azure SQL service")]

node_visitor -->|"opens app"| node_app_entry
node_app_entry -->|"renders"| node_reservation_ui
node_visitor -->|"uses"| node_reservation_ui
node_reservation_ui -->|"calls API"| node_api_service
node_api_service -->|"routes catalog"| node_catalog
node_api_service -->|"routes history"| node_order_listing
node_api_service -->|"routes booking"| node_order_booking
node_api_service -->|"routes cancellation"| node_order_cancellation
node_api_service -->|"gets pool"| node_pool
node_catalog -->|"queries"| node_pool
node_order_listing -->|"queries"| node_pool
node_order_booking -->|"checks and inserts"| node_pool
node_order_cancellation -->|"deletes"| node_pool
node_pool -->|"connects"| node_azure_sql
node_schema_seed -.->|"initializes"| node_sql_store

click node_app_entry "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/main.jsx"
click node_reservation_ui "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/App.jsx"
click node_api_service "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js"
click node_catalog "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js"
click node_order_listing "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js"
click node_order_booking "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js"
click node_order_cancellation "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js"
click node_pool "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/db.js"
click node_sql_store "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/db/schema.sql"
click node_schema_seed "https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/db/seed-data.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_app_entry,node_reservation_ui toneBlue
class node_api_service,node_catalog,node_order_listing,node_order_booking,node_order_cancellation,node_azure_sql toneAmber
class node_pool,node_sql_store,node_schema_seed toneMint
class node_visitor toneIndigo
```

## Components

### Web app

- [React entry](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/main.jsx): `web/src/main.jsx`
- [Reservation UI](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/web/src/App.jsx): `web/src/App.jsx`

### Reservation API

- [Express API](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js): `server/index.js`
- [Whiskey catalog](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js): `server/index.js`
- [Order history](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js): `server/index.js`
- [Create reservation](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js): `server/index.js`
- [Cancel reservation](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/index.js): `server/index.js`

### SQL persistence

- [SQL pool](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/server/db.js): `server/db.js`
- [Azure SQL](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/db/schema.sql): `db/schema.sql`
- [Schema and seed data](https://github.com/kittapat-deein/w13-clinicapp-66025560/blob/main/db/seed-data.sql): `db/seed-data.sql`

### Other components

- **Visitor**
- **Azure SQL service**

## Connections

- Visitor → React entry: opens app (evidence: `README.md`)
- React entry → Reservation UI: renders (evidence: `web/src/main.jsx`)
- Visitor → Reservation UI: uses (evidence: `web/src/App.jsx`)
- Reservation UI → Express API: calls API (evidence: `README.md`)
- Express API → Whiskey catalog: routes catalog (evidence: `server/index.js`)
- Express API → Order history: routes history (evidence: `server/index.js`)
- Express API → Create reservation: routes booking (evidence: `server/index.js`)
- Express API → Cancel reservation: routes cancellation (evidence: `server/index.js`)
- Express API → SQL pool: gets pool (evidence: `server/index.js`)
- Whiskey catalog → SQL pool: queries (evidence: `server/index.js`)
- Order history → SQL pool: queries (evidence: `server/index.js`)
- Create reservation → SQL pool: checks and inserts (evidence: `server/index.js`)
- Cancel reservation → SQL pool: deletes (evidence: `server/index.js`)
- SQL pool → Azure SQL service: connects (evidence: `server/db.js`)
- Schema and seed data → Azure SQL: initializes (evidence: `README.md`)
