# yash-raj07/curepro architecture

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

- Interactive diagram: https://gitdiagram.com/yash-raj07/curepro
- Repository: https://github.com/yash-raj07/curepro

## Overview

CurePro is a patient healthcare web app backed by an Express/MongoDB service. The visible workflow is account registration or login, browsing hospitals and booking appointments, then reviewing appointments in the dashboard or a confirmation view. The voice-assistant UI is another major product branch. README claims disease prediction and real-time communication, but the supplied tree and excerpts do not show their runtime implementations, so they are not mapped as working subsystems. Some UI-to-API behavior is visible; other links are omitted where evidence is unavailable.

Main entry points: [`my-react-app/src/Routes.jsx`](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/Routes.jsx) (Page routing), [`backend/routes/authRoutes.js`](https://github.com/yash-raj07/curepro/blob/main/backend/routes/authRoutes.js) (Auth routes), [`backend/routes/appointmentRoutes.js`](https://github.com/yash-raj07/curepro/blob/main/backend/routes/appointmentRoutes.js) (Appointment routes), [`backend/models/User.js`](https://github.com/yash-raj07/curepro/blob/main/backend/models/User.js) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Patient web app"]
  node_app["React app entry<br/>[App.jsx]"]
  node_routing["Page routing<br/>[Routes.jsx]"]
  node_registration["Registration<br/>[index.jsx]"]
  node_login["Login UI<br/>[index.jsx]"]
  node_dashboard["User dashboard<br/>[index.jsx]"]
  node_voice["Voice assistant<br/>[VoiceAssistant.jsx]"]
  node_hospitalui["Hospital browser<br/>[HospitalList.jsx]"]
  node_confirmation["Booking confirmation<br/>[index.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authlogic["Auth controller<br/>[authController.js]"]
  node_authguard["JWT guard<br/>[authMiddleware.js]"]
  node_token["Token generator<br/>[generateToken.js]"]
  node_oauth["Google OAuth config<br/>[passport.js]"]
end

subgraph group_appointments["Hospital appointments"]
  node_approutes["Appointment routes"]
  node_applogic["Appointment controller"]
end

subgraph group_persistence["Data persistence"]
  node_userstore[("User records<br/>[User.js]")]
  node_apptstore[("Appointment records<br/>[Appointment.js]")]
  node_hospitalstore[("Hospital records<br/>[Hospital.js]")]
  node_server["API server<br/>[server.js]"]
end

node_patient(("Patient"))
node_mongodb[("MongoDB")]

node_patient -->|"uses"| node_app
node_app -->|"renders"| node_routing
node_routing -->|"routes to"| node_registration
node_routing -->|"routes to"| node_login
node_routing -->|"protects route"| node_dashboard
node_routing -->|"protects route"| node_voice
node_patient -.->|"browses"| node_hospitalui
node_patient -.->|"views"| node_confirmation
node_registration -->|"posts registration"| node_authroutes
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_approutes
node_authroutes -->|"dispatches"| node_authlogic
node_authroutes -->|"authenticates with"| node_oauth
node_authroutes -->|"creates token"| node_token
node_authlogic -->|"reads and writes"| node_userstore
node_authlogic -->|"generates token"| node_token
node_oauth -->|"uses user model"| node_userstore
node_dashboard -->|"requests appointments"| node_approutes
node_approutes -->|"guards routes"| node_authguard
node_approutes -->|"dispatches"| node_applogic
node_applogic -->|"reads and writes"| node_apptstore
node_applogic -->|"reads and updates"| node_hospitalstore
node_authguard -->|"loads user"| node_userstore
node_server -->|"connects"| node_mongodb
node_userstore -.->|"persists via Mongoose"| node_mongodb
node_apptstore -.->|"persists via Mongoose"| node_mongodb
node_hospitalstore -.->|"persists via Mongoose"| node_mongodb

click node_app "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/App.jsx"
click node_routing "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/Routes.jsx"
click node_registration "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/register/index.jsx"
click node_login "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/login/index.jsx"
click node_dashboard "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/user-dashboard/index.jsx"
click node_voice "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/voice-assistant/VoiceAssistant.jsx"
click node_hospitalui "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/components/HospitalList.jsx"
click node_confirmation "https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/appointment-confirmation/index.jsx"
click node_authroutes "https://github.com/yash-raj07/curepro/blob/main/backend/routes/authRoutes.js"
click node_authlogic "https://github.com/yash-raj07/curepro/blob/main/backend/controllers/authController.js"
click node_authguard "https://github.com/yash-raj07/curepro/blob/main/backend/middleware/authMiddleware.js"
click node_token "https://github.com/yash-raj07/curepro/blob/main/backend/utils/generateToken.js"
click node_oauth "https://github.com/yash-raj07/curepro/blob/main/backend/config/passport.js"
click node_approutes "https://github.com/yash-raj07/curepro/blob/main/backend/routes/appointmentRoutes.js"
click node_applogic "https://github.com/yash-raj07/curepro/blob/main/backend/controllers/appointmentController.js"
click node_userstore "https://github.com/yash-raj07/curepro/blob/main/backend/models/User.js"
click node_apptstore "https://github.com/yash-raj07/curepro/blob/main/backend/models/Appointment.js"
click node_hospitalstore "https://github.com/yash-raj07/curepro/blob/main/backend/models/Hospital.js"
click node_server "https://github.com/yash-raj07/curepro/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_app,node_routing,node_registration,node_login,node_dashboard,node_voice,node_hospitalui,node_confirmation toneBlue
class node_authroutes,node_authlogic,node_authguard,node_token,node_oauth,node_mongodb toneAmber
class node_approutes,node_applogic toneMint
class node_userstore,node_apptstore,node_hospitalstore,node_server toneRose
class node_patient toneIndigo
```

## Components

### Patient web app

- [React app entry](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/App.jsx): `my-react-app/src/App.jsx`
- [Page routing](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/Routes.jsx): `my-react-app/src/Routes.jsx`
- [Registration](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/register/index.jsx): `my-react-app/src/pages/register/index.jsx`
- [Login UI](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/login/index.jsx): `my-react-app/src/pages/login/index.jsx`
- [User dashboard](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/user-dashboard/index.jsx): `my-react-app/src/pages/user-dashboard/index.jsx`
- [Voice assistant](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/voice-assistant/VoiceAssistant.jsx): `my-react-app/src/pages/voice-assistant/VoiceAssistant.jsx`
- [Hospital browser](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/components/HospitalList.jsx): `my-react-app/src/components/HospitalList.jsx`
- [Booking confirmation](https://github.com/yash-raj07/curepro/blob/main/my-react-app/src/pages/appointment-confirmation/index.jsx): `my-react-app/src/pages/appointment-confirmation/index.jsx`

### Identity and access

- [Auth routes](https://github.com/yash-raj07/curepro/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth controller](https://github.com/yash-raj07/curepro/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT guard](https://github.com/yash-raj07/curepro/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Token generator](https://github.com/yash-raj07/curepro/blob/main/backend/utils/generateToken.js): `backend/utils/generateToken.js`
- [Google OAuth config](https://github.com/yash-raj07/curepro/blob/main/backend/config/passport.js): `backend/config/passport.js`

### Hospital appointments

- [Appointment routes](https://github.com/yash-raj07/curepro/blob/main/backend/routes/appointmentRoutes.js): `backend/routes/appointmentRoutes.js`
- [Appointment controller](https://github.com/yash-raj07/curepro/blob/main/backend/controllers/appointmentController.js): `backend/controllers/appointmentController.js`

### Data persistence

- [User records](https://github.com/yash-raj07/curepro/blob/main/backend/models/User.js): `backend/models/User.js`
- [Appointment records](https://github.com/yash-raj07/curepro/blob/main/backend/models/Appointment.js): `backend/models/Appointment.js`
- [Hospital records](https://github.com/yash-raj07/curepro/blob/main/backend/models/Hospital.js): `backend/models/Hospital.js`
- [API server](https://github.com/yash-raj07/curepro/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Patient**
- **MongoDB**

## Connections

- Patient → React app entry: uses
- React app entry → Page routing: renders (evidence: `my-react-app/src/App.jsx`)
- Page routing → Registration: routes to (evidence: `my-react-app/src/Routes.jsx`)
- Page routing → Login UI: routes to (evidence: `my-react-app/src/Routes.jsx`)
- Page routing → User dashboard: protects route (evidence: `my-react-app/src/Routes.jsx`)
- Page routing → Voice assistant: protects route (evidence: `my-react-app/src/Routes.jsx`)
- Patient → Hospital browser: browses
- Patient → Booking confirmation: views
- Registration → Auth routes: posts registration (evidence: `my-react-app/src/pages/register/index.jsx`)
- API server → Auth routes: mounts (evidence: `backend/server.js`)
- API server → Appointment routes: mounts (evidence: `backend/server.js`)
- Auth routes → Auth controller: dispatches (evidence: `backend/routes/authRoutes.js`)
- Auth routes → Google OAuth config: authenticates with (evidence: `backend/routes/authRoutes.js`)
- Auth routes → Token generator: creates token (evidence: `backend/routes/authRoutes.js`)
- Auth controller → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Auth controller → Token generator: generates token (evidence: `backend/controllers/authController.js`)
- Google OAuth config → User records: uses user model (evidence: `backend/config/passport.js`)
- User dashboard → Appointment routes: requests appointments (evidence: `my-react-app/src/pages/user-dashboard/index.jsx`)
- Appointment routes → JWT guard: guards routes (evidence: `backend/routes/appointmentRoutes.js`)
- Appointment routes → Appointment controller: dispatches (evidence: `backend/routes/appointmentRoutes.js`)
- Appointment controller → Appointment records: reads and writes (evidence: `backend/controllers/appointmentController.js`)
- Appointment controller → Hospital records: reads and updates (evidence: `backend/controllers/appointmentController.js`)
- JWT guard → User records: loads user (evidence: `backend/middleware/authMiddleware.js`)
- API server → MongoDB: connects (evidence: `backend/server.js`)
- User records → MongoDB: persists via Mongoose
- Appointment records → MongoDB: persists via Mongoose
- Hospital records → MongoDB: persists via Mongoose
