# astik01/neuracare architecture

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

- Interactive diagram: https://gitdiagram.com/astik01/neuracare
- Repository: https://github.com/astik01/neuracare

## Overview

Neuracare is a MERN healthcare app. Users browse health information and doctors, create accounts, check symptoms, and book or manage appointments; contact submissions are another user-facing workflow. The React client calls an Express API, whose route handlers apply authentication where required and use Mongoose models backed by MongoDB. The README documents the major capabilities; several client pages and backend modules were not excerpted, so their internal call relationships are omitted or marked unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/astik01/neuracare/blob/main/client/src/App.jsx) (React app), [`backend/src/app.js`](https://github.com/astik01/neuracare/blob/main/backend/src/app.js) (Route registry), [`backend/src/routes/bookings.routes.js`](https://github.com/astik01/neuracare/blob/main/backend/src/routes/bookings.routes.js) (Appointments), [`backend/src/routes/symptomCheck.routes.js`](https://github.com/astik01/neuracare/blob/main/backend/src/routes/symptomCheck.routes.js) (Symptom scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_webapp["React app<br/>[App.jsx]"]
  node_authui["Account access<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_doctorui["Doctor search<br/>[FindDoctors.jsx]"]
  node_bookingui["Booking management<br/>[MyBookings.jsx]"]
  node_symptomui["Symptom checker<br/>[SymptomChecker.jsx]"]
  node_libraryui["Health library<br/>[HealthLibrary.jsx]"]
  node_contactui["Contact form<br/>[Contact.jsx]"]
  node_chatui["Chat widget<br/>[ChatWidget.jsx]"]
end

subgraph group_api["Express API"]
  node_server["API server<br/>[server.js]"]
  node_express["Route registry<br/>[app.js]"]
end

subgraph group_domain["Healthcare workflows"]
  node_authroute["Authentication<br/>[auth.routes.js]"]
  node_userroute["User profile<br/>[users.routes.js]"]
  node_doctorroute["Doctor directory<br/>[doctors.routes.js]"]
  node_bookingroute["Appointments<br/>[bookings.routes.js]"]
  node_symptomroute["Symptom scoring"]
  node_analysis["Condition matching<br/>[symptomAnalysis.js]"]
  node_contactroute["Contact messages<br/>[contacts.routes.js]"]
  node_articlesroute["Article delivery<br/>[articles.routes.js]"]
end

subgraph group_storage["Persistence"]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_users[("User records<br/>[User.js]")]
  node_doctors[("Doctor records<br/>[Doctor.js]")]
  node_bookings[("Booking records<br/>[Booking.js]")]
  node_contacts[("Contact records<br/>[Contact.js]")]
  node_articles[("Article records<br/>[Article.js]")]
end

node_visitor(("User"))
node_mongo[("MongoDB")]

node_visitor -->|"uses"| node_webapp
node_webapp -.->|"calls API"| node_api_client
node_authui -->|"uses"| node_api_client
node_webapp -.->|"provides accounts"| node_authui
node_webapp -.->|"offers search"| node_doctorui
node_webapp -.->|"offers booking"| node_bookingui
node_webapp -.->|"offers checker"| node_symptomui
node_webapp -.->|"offers library"| node_libraryui
node_webapp -.->|"offers contact"| node_contactui
node_webapp -.->|"includes widget"| node_chatui
node_server -->|"connects via"| node_dbconfig
node_server -->|"serves"| node_express
node_express -->|"mounts"| node_authroute
node_express -->|"mounts"| node_userroute
node_express -->|"mounts"| node_doctorroute
node_express -->|"mounts"| node_bookingroute
node_express -->|"mounts"| node_symptomroute
node_express -->|"mounts"| node_contactroute
node_express -->|"mounts"| node_articlesroute
node_authroute -->|"reads/writes"| node_users
node_userroute -->|"reads/writes"| node_users
node_doctorroute -->|"queries"| node_doctors
node_bookingroute -->|"reads/writes"| node_bookings
node_bookingroute -->|"looks up"| node_doctors
node_contactroute -->|"reads/writes"| node_contacts
node_articlesroute -->|"queries"| node_articles
node_symptomroute -.->|"scores with"| node_analysis
node_analysis -.->|"uses condition data"| node_symptomroute
node_dbconfig -.->|"connects"| node_mongo

click node_webapp "https://github.com/astik01/neuracare/blob/main/client/src/App.jsx"
click node_authui "https://github.com/astik01/neuracare/blob/main/client/src/context/AuthContext.jsx"
click node_api_client "https://github.com/astik01/neuracare/blob/main/client/src/api/client.js"
click node_doctorui "https://github.com/astik01/neuracare/blob/main/client/src/pages/FindDoctors/FindDoctors.jsx"
click node_bookingui "https://github.com/astik01/neuracare/blob/main/client/src/pages/MyBookings/MyBookings.jsx"
click node_symptomui "https://github.com/astik01/neuracare/blob/main/client/src/pages/SymptomChecker/SymptomChecker.jsx"
click node_libraryui "https://github.com/astik01/neuracare/blob/main/client/src/pages/HealthLibrary/HealthLibrary.jsx"
click node_contactui "https://github.com/astik01/neuracare/blob/main/client/src/pages/Contact/Contact.jsx"
click node_chatui "https://github.com/astik01/neuracare/blob/main/client/src/components/ChatWidget/ChatWidget.jsx"
click node_server "https://github.com/astik01/neuracare/blob/main/backend/src/server.js"
click node_express "https://github.com/astik01/neuracare/blob/main/backend/src/app.js"
click node_authroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/auth.routes.js"
click node_userroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/users.routes.js"
click node_doctorroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/doctors.routes.js"
click node_bookingroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/bookings.routes.js"
click node_symptomroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/symptomCheck.routes.js"
click node_analysis "https://github.com/astik01/neuracare/blob/main/backend/src/services/symptomAnalysis.js"
click node_contactroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/contacts.routes.js"
click node_articlesroute "https://github.com/astik01/neuracare/blob/main/backend/src/routes/articles.routes.js"
click node_dbconfig "https://github.com/astik01/neuracare/blob/main/backend/src/config/db.js"
click node_users "https://github.com/astik01/neuracare/blob/main/backend/src/models/User.js"
click node_doctors "https://github.com/astik01/neuracare/blob/main/backend/src/models/Doctor.js"
click node_bookings "https://github.com/astik01/neuracare/blob/main/backend/src/models/Booking.js"
click node_contacts "https://github.com/astik01/neuracare/blob/main/backend/src/models/Contact.js"
click node_articles "https://github.com/astik01/neuracare/blob/main/backend/src/models/Article.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_webapp,node_authui,node_api_client,node_doctorui,node_bookingui,node_symptomui,node_libraryui,node_contactui,node_chatui,node_visitor toneBlue
class node_server,node_express,node_mongo toneAmber
class node_authroute,node_userroute,node_doctorroute,node_bookingroute,node_symptomroute,node_analysis,node_contactroute,node_articlesroute toneMint
class node_dbconfig,node_users,node_doctors,node_bookings,node_contacts,node_articles toneRose
```

## Components

### React client

- [React app](https://github.com/astik01/neuracare/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Account access](https://github.com/astik01/neuracare/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API client](https://github.com/astik01/neuracare/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Doctor search](https://github.com/astik01/neuracare/blob/main/client/src/pages/FindDoctors/FindDoctors.jsx): `client/src/pages/FindDoctors/FindDoctors.jsx`
- [Booking management](https://github.com/astik01/neuracare/blob/main/client/src/pages/MyBookings/MyBookings.jsx): `client/src/pages/MyBookings/MyBookings.jsx`
- [Symptom checker](https://github.com/astik01/neuracare/blob/main/client/src/pages/SymptomChecker/SymptomChecker.jsx): `client/src/pages/SymptomChecker/SymptomChecker.jsx`
- [Health library](https://github.com/astik01/neuracare/blob/main/client/src/pages/HealthLibrary/HealthLibrary.jsx): `client/src/pages/HealthLibrary/HealthLibrary.jsx`
- [Contact form](https://github.com/astik01/neuracare/blob/main/client/src/pages/Contact/Contact.jsx): `client/src/pages/Contact/Contact.jsx`
- [Chat widget](https://github.com/astik01/neuracare/blob/main/client/src/components/ChatWidget/ChatWidget.jsx): `client/src/components/ChatWidget/ChatWidget.jsx`

### Express API

- [API server](https://github.com/astik01/neuracare/blob/main/backend/src/server.js): `backend/src/server.js`
- [Route registry](https://github.com/astik01/neuracare/blob/main/backend/src/app.js): `backend/src/app.js`

### Healthcare workflows

- [Authentication](https://github.com/astik01/neuracare/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [User profile](https://github.com/astik01/neuracare/blob/main/backend/src/routes/users.routes.js): `backend/src/routes/users.routes.js`
- [Doctor directory](https://github.com/astik01/neuracare/blob/main/backend/src/routes/doctors.routes.js): `backend/src/routes/doctors.routes.js`
- [Appointments](https://github.com/astik01/neuracare/blob/main/backend/src/routes/bookings.routes.js): `backend/src/routes/bookings.routes.js`
- [Symptom scoring](https://github.com/astik01/neuracare/blob/main/backend/src/routes/symptomCheck.routes.js): `backend/src/routes/symptomCheck.routes.js`
- [Condition matching](https://github.com/astik01/neuracare/blob/main/backend/src/services/symptomAnalysis.js): `backend/src/services/symptomAnalysis.js`
- [Contact messages](https://github.com/astik01/neuracare/blob/main/backend/src/routes/contacts.routes.js): `backend/src/routes/contacts.routes.js`
- [Article delivery](https://github.com/astik01/neuracare/blob/main/backend/src/routes/articles.routes.js): `backend/src/routes/articles.routes.js`

### Persistence

- [Database connection](https://github.com/astik01/neuracare/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [User records](https://github.com/astik01/neuracare/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Doctor records](https://github.com/astik01/neuracare/blob/main/backend/src/models/Doctor.js): `backend/src/models/Doctor.js`
- [Booking records](https://github.com/astik01/neuracare/blob/main/backend/src/models/Booking.js): `backend/src/models/Booking.js`
- [Contact records](https://github.com/astik01/neuracare/blob/main/backend/src/models/Contact.js): `backend/src/models/Contact.js`
- [Article records](https://github.com/astik01/neuracare/blob/main/backend/src/models/Article.js): `backend/src/models/Article.js`

### Other components

- **User**
- **MongoDB**

## Connections

- User → React app: uses
- React app → API client: calls API
- Account access → API client: uses (evidence: `client/src/context/AuthContext.jsx`)
- React app → Account access: provides accounts
- React app → Doctor search: offers search
- React app → Booking management: offers booking
- React app → Symptom checker: offers checker
- React app → Health library: offers library
- React app → Contact form: offers contact
- React app → Chat widget: includes widget
- API server → Database connection: connects via (evidence: `backend/src/server.js`)
- API server → Route registry: serves (evidence: `backend/src/server.js`)
- Route registry → Authentication: mounts (evidence: `backend/src/app.js`)
- Route registry → User profile: mounts (evidence: `backend/src/app.js`)
- Route registry → Doctor directory: mounts (evidence: `backend/src/app.js`)
- Route registry → Appointments: mounts (evidence: `backend/src/app.js`)
- Route registry → Symptom scoring: mounts (evidence: `backend/src/app.js`)
- Route registry → Contact messages: mounts (evidence: `backend/src/app.js`)
- Route registry → Article delivery: mounts (evidence: `backend/src/app.js`)
- Authentication → User records: reads/writes (evidence: `backend/src/routes/auth.routes.js`)
- User profile → User records: reads/writes (evidence: `backend/src/routes/users.routes.js`)
- Doctor directory → Doctor records: queries (evidence: `backend/src/routes/doctors.routes.js`)
- Appointments → Booking records: reads/writes (evidence: `backend/src/routes/bookings.routes.js`)
- Appointments → Doctor records: looks up (evidence: `backend/src/routes/bookings.routes.js`)
- Contact messages → Contact records: reads/writes (evidence: `backend/src/routes/contacts.routes.js`)
- Article delivery → Article records: queries (evidence: `backend/src/routes/articles.routes.js`)
- Symptom scoring → Condition matching: scores with
- Condition matching → Symptom scoring: uses condition data
- Database connection → MongoDB: connects
