# thiraphatklineingdee/w13-clinicapp-66012241 architecture

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

## Overview

The checked-in runtime is a board-game reservation app, not the clinic app described by the README. Its main flow is browsing games and reservations, submitting or cancelling a time-slot booking, and refreshing the displayed results. The API checks overlapping reservations and reads or writes SQL through a pooled connection. The graph follows the sampled source; README claims about doctors and clinic appointments do not match it.

Main entry points: [`server/index.js`](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/index.js) (API routes), [`web/src/App.jsx`](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/App.jsx) (Browse and book), [`server/db.js`](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/db.js) (SQL connection pool), [`web/src/main.jsx`](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/main.jsx) (React bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Reservation interface"]
  node_ui["Browse and book<br/>[App.jsx]"]
  node_bootstrap["React bootstrap<br/>[main.jsx]"]
end

subgraph group_api["Booking API"]
  node_routes["API routes<br/>[index.js]"]
end

subgraph group_data["SQL data"]
  node_pool["SQL connection pool<br/>[db.js]"]
  node_sql[("SQL database")]
end

node_player(("Player"))

node_player -->|"uses"| node_ui
node_bootstrap -->|"renders"| node_ui
node_ui -->|"requests games and bookings"| node_routes
node_routes -->|"gets connection"| node_pool
node_routes -->|"queries and modifies"| node_sql
node_pool -->|"connects"| node_sql

click node_ui "https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/App.jsx"
click node_bootstrap "https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/main.jsx"
click node_routes "https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/index.js"
click node_pool "https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/db.js"

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_bootstrap toneBlue
class node_routes toneAmber
class node_pool,node_sql toneMint
class node_player toneIndigo
```

## Components

### Reservation interface

- [Browse and book](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [React bootstrap](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/web/src/main.jsx): `web/src/main.jsx`

### Booking API

- [API routes](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/index.js): `server/index.js`

### SQL data

- [SQL connection pool](https://github.com/thiraphatklineingdee/w13-clinicapp-66012241/blob/main/server/db.js): `server/db.js`
- **SQL database**

### Other components

- **Player**

## Connections

- Player → Browse and book: uses (evidence: `web/src/App.jsx`)
- React bootstrap → Browse and book: renders (evidence: `web/src/main.jsx`)
- Browse and book → API routes: requests games and bookings (evidence: `web/src/App.jsx`)
- API routes → SQL connection pool: gets connection (evidence: `server/index.js`)
- API routes → SQL database: queries and modifies (evidence: `server/index.js`)
- SQL connection pool → SQL database: connects (evidence: `server/db.js`)
