# vishwassk15/healthhub-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/vishwassk15/healthhub-frontend
- Repository: https://github.com/vishwassk15/healthhub-frontend

## Overview

HealthHub is a React frontend for doctor discovery, appointment booking and account management. The user journey runs from browsing doctors and selecting a time slot through booking, then managing or paying for appointments; account registration, login and profile editing support that flow. Shared context loads doctor and user data from the backend, while the appointment-history page integrates payment options. The README also describes profile viewing and availability browsing. Edges reflect shown routing, context use and API calls; some feature pages and integrations are only documented or listed in the source index, so uncertain connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/App.jsx) (Routes and layout), [`src/context/AppContext.jsx`](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/context/AppContext.jsx) (Shared app state), [`src/pages/MyAppointments.jsx`](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/MyAppointments.jsx) (Appointment history), [`src/pages/Appointment.jsx`](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Appointment.jsx) (Doctor and slot selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routes and layout<br/>[App.jsx]"]
  node_navbar["Navigation and auth menu<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_context["Shared app state<br/>[AppContext.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_contact["Contact page<br/>[Contact.jsx]"]
end

subgraph group_discovery["Doctor discovery"]
  node_home["Home page<br/>[Home.jsx]"]
  node_header["Booking banner<br/>[Header.jsx]"]
  node_speciality["Speciality browsing<br/>[SpecialityMenu.jsx]"]
  node_topdoctors["Featured doctors<br/>[TopDoctors.jsx]"]
  node_doctors["Doctor search<br/>[Doctors.jsx]"]
end

subgraph group_booking["Booking and payments"]
  node_appointment["Doctor and slot selection<br/>[Appointment.jsx]"]
  node_related["Related doctors<br/>[RelatedDoctors.jsx]"]
  node_history["Appointment history<br/>[MyAppointments.jsx]"]
  node_payment["Payment providers"]
  node_verify["Payment verification<br/>[Verify.jsx]"]
end

subgraph group_account["Account management"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_profile["Profile editing<br/>[MyProfile.jsx]"]
end

node_user(("Patient"))
node_backend["HealthHub REST API"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_doctors
node_app -->|"routes to"| node_appointment
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_verify
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_contact
node_home -->|"renders"| node_header
node_home -->|"renders"| node_speciality
node_home -->|"renders"| node_topdoctors
node_context -->|"loads doctors and profile"| node_backend
node_doctors -->|"reads doctor list"| node_context
node_topdoctors -->|"reads doctor list"| node_context
node_appointment -->|"reads doctor data"| node_context
node_appointment -->|"renders"| node_related
node_related -->|"reads doctor list"| node_context
node_appointment -->|"books appointment"| node_backend
node_appointment -->|"navigates after booking"| node_history
node_history -->|"loads and cancels appointments"| node_backend
node_history -->|"starts payment"| node_payment
node_history -->|"requests payment and verifies"| node_backend
node_history -.->|"navigates after payment"| node_verify
node_login -->|"uses shared state"| node_context
node_profile -->|"reads and refreshes profile"| node_context
node_profile -->|"updates profile"| node_backend
node_navbar -->|"reads auth state"| node_context
node_navbar -->|"navigates to"| node_profile
node_navbar -->|"navigates to"| node_history

click node_app "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/App.jsx"
click node_navbar "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Navbar.jsx"
click node_footer "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Footer.jsx"
click node_home "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Home.jsx"
click node_header "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Header.jsx"
click node_speciality "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/SpecialityMenu.jsx"
click node_topdoctors "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/TopDoctors.jsx"
click node_doctors "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Doctors.jsx"
click node_appointment "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Appointment.jsx"
click node_related "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/RelatedDoctors.jsx"
click node_history "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/MyAppointments.jsx"
click node_login "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Login.jsx"
click node_profile "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/MyProfile.jsx"
click node_verify "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Verify.jsx"
click node_context "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/context/AppContext.jsx"
click node_about "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/About.jsx"
click node_contact "https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Contact.jsx"

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,node_navbar,node_footer,node_context,node_about,node_contact toneBlue
class node_home,node_header,node_speciality,node_topdoctors,node_doctors toneAmber
class node_appointment,node_related,node_history,node_payment,node_verify,node_backend toneMint
class node_login,node_profile toneRose
class node_user toneIndigo
```

## Components

### Application shell

- [Routes and layout](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation and auth menu](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Footer](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`
- [Shared app state](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`
- [About page](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/About.jsx): `src/pages/About.jsx`
- [Contact page](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Contact.jsx): `src/pages/Contact.jsx`

### Doctor discovery

- [Home page](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Booking banner](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/Header.jsx): `src/components/Header.jsx`
- [Speciality browsing](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/SpecialityMenu.jsx): `src/components/SpecialityMenu.jsx`
- [Featured doctors](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/TopDoctors.jsx): `src/components/TopDoctors.jsx`
- [Doctor search](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Doctors.jsx): `src/pages/Doctors.jsx`

### Booking and payments

- [Doctor and slot selection](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Appointment.jsx): `src/pages/Appointment.jsx`
- [Related doctors](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/components/RelatedDoctors.jsx): `src/components/RelatedDoctors.jsx`
- [Appointment history](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/MyAppointments.jsx): `src/pages/MyAppointments.jsx`
- **Payment providers**
- [Payment verification](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Verify.jsx): `src/pages/Verify.jsx`

### Account management

- [Login and registration](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Profile editing](https://github.com/vishwassk15/healthhub-frontend/blob/main/src/pages/MyProfile.jsx): `src/pages/MyProfile.jsx`

### Other components

- **Patient**
- **HealthHub REST API**

## Connections

- Patient → Routes and layout: uses (evidence: `README.md`)
- Routes and layout → Navigation and auth menu: renders (evidence: `src/App.jsx`)
- Routes and layout → Footer: renders (evidence: `src/App.jsx`)
- Routes and layout → Home page: routes to (evidence: `src/App.jsx`)
- Routes and layout → Doctor search: routes to (evidence: `src/App.jsx`)
- Routes and layout → Doctor and slot selection: routes to (evidence: `src/App.jsx`)
- Routes and layout → Appointment history: routes to (evidence: `src/App.jsx`)
- Routes and layout → Login and registration: routes to (evidence: `src/App.jsx`)
- Routes and layout → Profile editing: routes to (evidence: `src/App.jsx`)
- Routes and layout → Payment verification: routes to (evidence: `src/App.jsx`)
- Routes and layout → About page: routes to (evidence: `src/App.jsx`)
- Routes and layout → Contact page: routes to (evidence: `src/App.jsx`)
- Home page → Booking banner: renders (evidence: `src/pages/Home.jsx`)
- Home page → Speciality browsing: renders (evidence: `src/pages/Home.jsx`)
- Home page → Featured doctors: renders (evidence: `src/pages/Home.jsx`)
- Shared app state → HealthHub REST API: loads doctors and profile (evidence: `src/context/AppContext.jsx`)
- Doctor search → Shared app state: reads doctor list (evidence: `src/pages/Doctors.jsx`)
- Featured doctors → Shared app state: reads doctor list (evidence: `src/components/TopDoctors.jsx`)
- Doctor and slot selection → Shared app state: reads doctor data (evidence: `src/pages/Appointment.jsx`)
- Doctor and slot selection → Related doctors: renders (evidence: `src/pages/Appointment.jsx`)
- Related doctors → Shared app state: reads doctor list (evidence: `src/components/RelatedDoctors.jsx`)
- Doctor and slot selection → HealthHub REST API: books appointment (evidence: `src/pages/Appointment.jsx`)
- Doctor and slot selection → Appointment history: navigates after booking (evidence: `src/pages/Appointment.jsx`)
- Appointment history → HealthHub REST API: loads and cancels appointments (evidence: `src/pages/MyAppointments.jsx`)
- Appointment history → Payment providers: starts payment (evidence: `src/pages/MyAppointments.jsx`)
- Appointment history → HealthHub REST API: requests payment and verifies (evidence: `src/pages/MyAppointments.jsx`)
- Appointment history → Payment verification: navigates after payment
- Login and registration → Shared app state: uses shared state (evidence: `src/pages/Login.jsx`)
- Profile editing → Shared app state: reads and refreshes profile (evidence: `src/pages/MyProfile.jsx`)
- Profile editing → HealthHub REST API: updates profile (evidence: `src/pages/MyProfile.jsx`)
- Navigation and auth menu → Shared app state: reads auth state (evidence: `src/components/Navbar.jsx`)
- Navigation and auth menu → Profile editing: navigates to (evidence: `src/components/Navbar.jsx`)
- Navigation and auth menu → Appointment history: navigates to (evidence: `src/components/Navbar.jsx`)
