# ganadharshan/hidoctor architecture

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

- Interactive diagram: https://gitdiagram.com/ganadharshan/hidoctor
- Repository: https://github.com/ganadharshan/hidoctor

## Overview

HiDoctor lets a patient describe symptoms in a React chat, sends the conversation to the backend, and returns Groq-generated general triage guidance to the chat. The backend supplies instructions to ask clarifying questions, suggest levels of care, avoid diagnosis, and recommend professional advice. The frontend source shows the deployed chat URL; the backend excerpt shows its matching chat route and Groq call. Other documented UI details and deployment behavior are not mapped as separate components.

Main entry points: [`symptom-checker/src/App.js`](https://github.com/ganadharshan/hidoctor/blob/main/symptom-checker/src/App.js) (Chat interface), [`backend/server.js`](https://github.com/ganadharshan/hidoctor/blob/main/backend/server.js) (Chat endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat experience"]
  node_chat_ui["Chat interface<br/>[App.js]"]
end

subgraph group_triage["Triage service"]
  node_chat_api["Chat endpoint<br/>[server.js]"]
end

node_patient(("Patient"))
node_groq["Groq AI API"]

node_patient -->|"describes symptoms"| node_chat_ui
node_chat_ui -->|"posts messages"| node_chat_api
node_chat_api -->|"requests completion"| node_groq
node_groq -->|"returns completion"| node_chat_api
node_chat_api -->|"returns reply"| node_chat_ui
node_chat_ui -->|"shows conversation"| node_patient

click node_chat_ui "https://github.com/ganadharshan/hidoctor/blob/main/symptom-checker/src/App.js"
click node_chat_api "https://github.com/ganadharshan/hidoctor/blob/main/backend/server.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_chat_ui toneBlue
class node_chat_api toneAmber
class node_patient toneIndigo
class node_groq toneMint
```

## Components

### Chat experience

- [Chat interface](https://github.com/ganadharshan/hidoctor/blob/main/symptom-checker/src/App.js): `symptom-checker/src/App.js`

### Triage service

- [Chat endpoint](https://github.com/ganadharshan/hidoctor/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Patient**
- **Groq AI API**

## Connections

- Patient → Chat interface: describes symptoms (evidence: `symptom-checker/src/App.js`)
- Chat interface → Chat endpoint: posts messages (evidence: `symptom-checker/src/App.js`)
- Chat endpoint → Groq AI API: requests completion (evidence: `backend/server.js`)
- Groq AI API → Chat endpoint: returns completion (evidence: `backend/server.js`)
- Chat endpoint → Chat interface: returns reply (evidence: `backend/server.js`)
- Chat interface → Patient: shows conversation (evidence: `symptom-checker/src/App.js`)
