# dj28p/doctor-bot architecture

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

- Interactive diagram: https://gitdiagram.com/dj28p/doctor-bot
- Repository: https://github.com/dj28p/doctor-bot

## Overview

Doctor Bot is a Next.js health-chat interface. Users sign in through Auth0, then the home page routes authenticated users to a chat where they can submit text or choose suggested health topics. The sampled chat page only adds user messages to local state; it does not show AI responses or a backend request. The README describes OpenAI-powered advice, but that integration is not visible in the sampled source, so it is shown as unverified.

Main entry points: [`app/page.js`](https://github.com/dj28p/doctor-bot/blob/main/app/page.js) (Sign-in page), [`app/chat/page.js`](https://github.com/dj28p/doctor-bot/blob/main/app/chat/page.js) (Chat interface), [`app/AuthProvider.js`](https://github.com/dj28p/doctor-bot/blob/main/app/AuthProvider.js) (Auth provider), [`app/layout.js`](https://github.com/dj28p/doctor-bot/blob/main/app/layout.js) (Root layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_layout["Root layout<br/>[layout.js]"]
end

subgraph group_access["Sign-in flow"]
  node_authprovider["Auth provider<br/>[AuthProvider.js]"]
  node_auth0["Auth0"]
  node_home["Sign-in page<br/>[page.js]"]
end

subgraph group_conversation["Health chat"]
  node_chat["Chat interface<br/>[page.js]"]
  node_openai["OpenAI"]
end

node_user(("User"))

node_layout -->|"wraps children"| node_authprovider
node_authprovider -->|"configures provider"| node_auth0
node_user -->|"signs in"| node_home
node_home -->|"starts login"| node_auth0
node_home -->|"routes authenticated users"| node_chat
node_user -->|"submits health query"| node_chat
node_chat -.->|"AI response integration"| node_openai

click node_layout "https://github.com/dj28p/doctor-bot/blob/main/app/layout.js"
click node_authprovider "https://github.com/dj28p/doctor-bot/blob/main/app/AuthProvider.js"
click node_home "https://github.com/dj28p/doctor-bot/blob/main/app/page.js"
click node_chat "https://github.com/dj28p/doctor-bot/blob/main/app/chat/page.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_layout,node_user toneBlue
class node_authprovider,node_auth0,node_home toneAmber
class node_chat,node_openai toneMint
```

## Components

### App shell

- [Root layout](https://github.com/dj28p/doctor-bot/blob/main/app/layout.js): `app/layout.js`

### Sign-in flow

- [Auth provider](https://github.com/dj28p/doctor-bot/blob/main/app/AuthProvider.js): `app/AuthProvider.js`
- **Auth0**
- [Sign-in page](https://github.com/dj28p/doctor-bot/blob/main/app/page.js): `app/page.js`

### Health chat

- [Chat interface](https://github.com/dj28p/doctor-bot/blob/main/app/chat/page.js): `app/chat/page.js`
- **OpenAI**

### Other components

- **User**

## Connections

- Root layout → Auth provider: wraps children (evidence: `app/layout.js`)
- Auth provider → Auth0: configures provider (evidence: `app/AuthProvider.js`)
- User → Sign-in page: signs in (evidence: `app/page.js`)
- Sign-in page → Auth0: starts login (evidence: `app/page.js`)
- Sign-in page → Chat interface: routes authenticated users (evidence: `app/page.js`)
- User → Chat interface: submits health query (evidence: `app/chat/page.js`)
- Chat interface → OpenAI: AI response integration
