# danuphonchatphueak/w13-clinicapp-starter architecture

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

- Interactive diagram: https://gitdiagram.com/danuphonchatphueak/w13-clinicapp-starter
- Repository: https://github.com/danuphonchatphueak/w13-clinicapp-starter

## Overview

This is a small clinic appointment application: patients view doctors and appointments, book or cancel appointments, and see the refreshed results. The React app calls Express routes; those route handlers obtain a pooled Azure SQL connection and perform the doctor and appointment queries or mutations. The README documents the SQL schema and sample-doctor seed data. Source excerpts show the client and API behavior; database setup relationships are documented in the README, while SQL file contents were not sampled.

Main entry points: [`web/src/App.jsx`](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/App.jsx) (Clinic interface), [`server/db.js`](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/db.js) (SQL connection pool), [`server/index.js`](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js) (Doctor listing), [`web/src/main.jsx`](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_web_entry["React entry<br/>[main.jsx]"]
  node_clinic_ui["Clinic interface<br/>[App.jsx]"]
end

subgraph group_api["Clinic API"]
  node_doctor_list["Doctor listing<br/>[index.js]"]
  node_appointment_list["Appointment listing<br/>[index.js]"]
  node_appointment_booking["Appointment booking<br/>[index.js]"]
  node_appointment_cancel["Appointment cancellation<br/>[index.js]"]
  node_sql_pool["SQL connection pool<br/>[db.js]"]
end

subgraph group_data["SQL data"]
  node_schema["Table schema<br/>[schema.sql]"]
  node_seed["Doctor seed data<br/>[seed-data.sql]"]
  node_azure_sql[("Azure SQL")]
end

node_patient(("Patient"))

node_patient -->|"uses"| node_clinic_ui
node_web_entry -->|"renders"| node_clinic_ui
node_clinic_ui -->|"requests doctors"| node_doctor_list
node_clinic_ui -->|"requests appointments"| node_appointment_list
node_clinic_ui -->|"submits booking"| node_appointment_booking
node_clinic_ui -->|"requests cancellation"| node_appointment_cancel
node_doctor_list -->|"gets connection"| node_sql_pool
node_appointment_list -->|"gets connection"| node_sql_pool
node_appointment_booking -->|"gets connection"| node_sql_pool
node_appointment_cancel -->|"gets connection"| node_sql_pool
node_sql_pool -->|"connects"| node_azure_sql
node_schema -->|"defines tables for"| node_azure_sql
node_seed -->|"loads sample doctors"| node_azure_sql

click node_web_entry "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/main.jsx"
click node_clinic_ui "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/App.jsx"
click node_doctor_list "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js"
click node_appointment_list "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js"
click node_appointment_booking "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js"
click node_appointment_cancel "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js"
click node_sql_pool "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/db.js"
click node_schema "https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/db/schema.sql"
click node_seed "https://github.com/danuphonchatphueak/w13-clinicapp-starter/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_web_entry,node_clinic_ui toneBlue
class node_doctor_list,node_appointment_list,node_appointment_booking,node_appointment_cancel,node_sql_pool toneAmber
class node_schema,node_seed,node_azure_sql toneMint
class node_patient toneIndigo
```

## Components

### Web app

- [React entry](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/main.jsx): `web/src/main.jsx`
- [Clinic interface](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/web/src/App.jsx): `web/src/App.jsx`

### Clinic API

- [Doctor listing](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js): `server/index.js`
- [Appointment listing](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js): `server/index.js`
- [Appointment booking](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js): `server/index.js`
- [Appointment cancellation](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/index.js): `server/index.js`
- [SQL connection pool](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/server/db.js): `server/db.js`

### SQL data

- [Table schema](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/db/schema.sql): `db/schema.sql`
- [Doctor seed data](https://github.com/danuphonchatphueak/w13-clinicapp-starter/blob/main/db/seed-data.sql): `db/seed-data.sql`
- **Azure SQL**

### Other components

- **Patient**

## Connections

- Patient → Clinic interface: uses
- React entry → Clinic interface: renders (evidence: `web/src/main.jsx`)
- Clinic interface → Doctor listing: requests doctors (evidence: `web/src/App.jsx`)
- Clinic interface → Appointment listing: requests appointments (evidence: `web/src/App.jsx`)
- Clinic interface → Appointment booking: submits booking (evidence: `web/src/App.jsx`)
- Clinic interface → Appointment cancellation: requests cancellation (evidence: `web/src/App.jsx`)
- Doctor listing → SQL connection pool: gets connection (evidence: `server/index.js`)
- Appointment listing → SQL connection pool: gets connection (evidence: `server/index.js`)
- Appointment booking → SQL connection pool: gets connection (evidence: `server/index.js`)
- Appointment cancellation → SQL connection pool: gets connection (evidence: `server/index.js`)
- SQL connection pool → Azure SQL: connects (evidence: `server/db.js`)
- Table schema → Azure SQL: defines tables for (evidence: `README.md`)
- Doctor seed data → Azure SQL: loads sample doctors (evidence: `README.md`)
