# madan9482/mental-wellness architecture

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

- Interactive diagram: https://gitdiagram.com/madan9482/mental-wellness
- Repository: https://github.com/madan9482/mental-wellness

## Overview

This is a mental-wellness platform with user, therapist, and administrator experiences. Users register or log in, then can book and manage appointments, consult a wellness chatbot, and join online meetings; therapists manage availability, appointments, patients, and profiles, while administrators manage users, therapists, analytics, and settings. The React router dispatches to these screens, which use a shared Axios API client to reach the server. The server implementation was not excerpted, so its relationship to the client is shown as unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/madan9482/mental-wellness/blob/main/client/src/App.jsx) (Route dispatcher), [`client/src/services/api.js`](https://github.com/madan9482/mental-wellness/blob/main/client/src/services/api.js) (HTTP API client), [`client/src/components/auth/Login.jsx`](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Login.jsx) (Login), [`client/src/components/auth/Register.jsx`](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Register.jsx) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App and access"]
  node_app["Route dispatcher<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_guard["Route protection<br/>[ProtectedRoute.jsx]"]
  node_dashboard["Role dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_care["User and therapist care"]
  node_userappointments["Book appointments<br/>[Appointments.jsx]"]
  node_myappointments["My appointments<br/>[MyAppointments.jsx]"]
  node_userprofile["User profile<br/>[Profile.jsx]"]
  node_therapistappointments["Therapist appointments"]
  node_availability["Availability management"]
  node_patients["Patient management"]
  node_therapistprofile["Therapist profile"]
  node_chat["Wellness chatbot<br/>[ChatBot.jsx]"]
  node_meeting["Online meeting<br/>[OnlineMeeting.jsx]"]
end

subgraph group_operations["Administration"]
  node_adminusers["User administration<br/>[AdminUsers.jsx]"]
  node_admintherapists["Therapist administration"]
  node_analytics["Analytics<br/>[AdminAnalytics.jsx]"]
  node_adminprofile["Admin profile<br/>[AdminProfile.jsx]"]
  node_settings["System settings<br/>[SystemSettings.jsx]"]
end

subgraph group_platform["Shared platform"]
  node_api["HTTP API client<br/>[api.js]"]
  node_backend["Application server<br/>[index.ts]"]
end

node_visitor(("Platform user"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"protects routes"| node_guard
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_userappointments
node_app -->|"routes to"| node_myappointments
node_app -->|"routes to"| node_userprofile
node_app -->|"routes to"| node_therapistappointments
node_app -->|"routes to"| node_availability
node_app -->|"routes to"| node_patients
node_app -->|"routes to"| node_adminusers
node_app -->|"routes to"| node_admintherapists
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_settings
node_login -->|"auth requests"| node_api
node_register -->|"registers via"| node_api
node_userappointments -->|"appointment requests"| node_api
node_myappointments -->|"appointment requests"| node_api
node_userprofile -->|"profile requests"| node_api
node_therapistappointments -->|"appointment requests"| node_api
node_availability -->|"availability requests"| node_api
node_patients -->|"patient requests"| node_api
node_therapistprofile -->|"profile requests"| node_api
node_chat -->|"sends messages"| node_api
node_meeting -->|"meeting requests"| node_api
node_adminusers -->|"admin requests"| node_api
node_admintherapists -->|"admin requests"| node_api
node_analytics -->|"analytics requests"| node_api
node_adminprofile -->|"profile requests"| node_api
node_settings -->|"settings requests"| node_api
node_api -.->|"HTTP API"| node_backend

click node_app "https://github.com/madan9482/mental-wellness/blob/main/client/src/App.jsx"
click node_login "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Login.jsx"
click node_register "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Register.jsx"
click node_guard "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/ProtectedRoute.jsx"
click node_dashboard "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/Dashboard.jsx"
click node_userappointments "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/Appointments.jsx"
click node_myappointments "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/MyAppointments.jsx"
click node_userprofile "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/Profile.jsx"
click node_therapistappointments "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistAppointments.jsx"
click node_availability "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistAvailability.jsx"
click node_patients "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistPatients.jsx"
click node_therapistprofile "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistProfile.jsx"
click node_chat "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/chat/ChatBot.jsx"
click node_meeting "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/meeting/OnlineMeeting.jsx"
click node_adminusers "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminUsers.jsx"
click node_admintherapists "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminTherapists.jsx"
click node_analytics "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminAnalytics.jsx"
click node_adminprofile "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminProfile.jsx"
click node_settings "https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/SystemSettings.jsx"
click node_api "https://github.com/madan9482/mental-wellness/blob/main/client/src/services/api.js"
click node_backend "https://github.com/madan9482/mental-wellness/blob/main/server/index.ts"

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_login,node_register,node_guard,node_dashboard,node_visitor toneBlue
class node_userappointments,node_myappointments,node_userprofile,node_therapistappointments,node_availability,node_patients,node_therapistprofile,node_chat,node_meeting toneAmber
class node_adminusers,node_admintherapists,node_analytics,node_adminprofile,node_settings toneMint
class node_api,node_backend toneRose
```

## Components

### App and access

- [Route dispatcher](https://github.com/madan9482/mental-wellness/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Login.jsx): `client/src/components/auth/Login.jsx`
- [Registration](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/Register.jsx): `client/src/components/auth/Register.jsx`
- [Route protection](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/auth/ProtectedRoute.jsx): `client/src/components/auth/ProtectedRoute.jsx`
- [Role dashboard](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/Dashboard.jsx): `client/src/components/Dashboard.jsx`

### User and therapist care

- [Book appointments](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/Appointments.jsx): `client/src/components/user/Appointments.jsx`
- [My appointments](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/MyAppointments.jsx): `client/src/components/user/MyAppointments.jsx`
- [User profile](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/user/Profile.jsx): `client/src/components/user/Profile.jsx`
- [Therapist appointments](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistAppointments.jsx): `client/src/components/therapist/TherapistAppointments.jsx`
- [Availability management](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistAvailability.jsx): `client/src/components/therapist/TherapistAvailability.jsx`
- [Patient management](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistPatients.jsx): `client/src/components/therapist/TherapistPatients.jsx`
- [Therapist profile](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/therapist/TherapistProfile.jsx): `client/src/components/therapist/TherapistProfile.jsx`
- [Wellness chatbot](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/chat/ChatBot.jsx): `client/src/components/chat/ChatBot.jsx`
- [Online meeting](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/meeting/OnlineMeeting.jsx): `client/src/components/meeting/OnlineMeeting.jsx`

### Administration

- [User administration](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminUsers.jsx): `client/src/components/admin/AdminUsers.jsx`
- [Therapist administration](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminTherapists.jsx): `client/src/components/admin/AdminTherapists.jsx`
- [Analytics](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminAnalytics.jsx): `client/src/components/admin/AdminAnalytics.jsx`
- [Admin profile](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/AdminProfile.jsx): `client/src/components/admin/AdminProfile.jsx`
- [System settings](https://github.com/madan9482/mental-wellness/blob/main/client/src/components/admin/SystemSettings.jsx): `client/src/components/admin/SystemSettings.jsx`

### Shared platform

- [HTTP API client](https://github.com/madan9482/mental-wellness/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Application server](https://github.com/madan9482/mental-wellness/blob/main/server/index.ts): `server/index.ts`

### Other components

- **Platform user**

## Connections

- Platform user → Route dispatcher: opens
- Route dispatcher → Login: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Registration: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Route protection: protects routes (evidence: `client/src/App.jsx`)
- Route dispatcher → Role dashboard: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Book appointments: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → My appointments: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → User profile: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Therapist appointments: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Availability management: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Patient management: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → User administration: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Therapist administration: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → Analytics: routes to (evidence: `client/src/App.jsx`)
- Route dispatcher → System settings: routes to (evidence: `client/src/App.jsx`)
- Login → HTTP API client: auth requests (evidence: `client/src/components/auth/Login.jsx`)
- Registration → HTTP API client: registers via (evidence: `client/src/components/auth/Register.jsx`)
- Book appointments → HTTP API client: appointment requests (evidence: `client/src/components/user/Appointments.jsx`)
- My appointments → HTTP API client: appointment requests (evidence: `client/src/components/user/MyAppointments.jsx`)
- User profile → HTTP API client: profile requests (evidence: `client/src/components/user/Profile.jsx`)
- Therapist appointments → HTTP API client: appointment requests (evidence: `client/src/components/therapist/TherapistAppointments.jsx`)
- Availability management → HTTP API client: availability requests (evidence: `client/src/components/therapist/TherapistAvailability.jsx`)
- Patient management → HTTP API client: patient requests (evidence: `client/src/components/therapist/TherapistPatients.jsx`)
- Therapist profile → HTTP API client: profile requests (evidence: `client/src/components/therapist/TherapistProfile.jsx`)
- Wellness chatbot → HTTP API client: sends messages (evidence: `client/src/components/chat/ChatBot.jsx`)
- Online meeting → HTTP API client: meeting requests (evidence: `client/src/components/meeting/OnlineMeeting.jsx`)
- User administration → HTTP API client: admin requests (evidence: `client/src/components/admin/AdminUsers.jsx`)
- Therapist administration → HTTP API client: admin requests (evidence: `client/src/components/admin/AdminTherapists.jsx`)
- Analytics → HTTP API client: analytics requests (evidence: `client/src/components/admin/AdminAnalytics.jsx`)
- Admin profile → HTTP API client: profile requests (evidence: `client/src/components/admin/AdminProfile.jsx`)
- System settings → HTTP API client: settings requests (evidence: `client/src/components/admin/SystemSettings.jsx`)
- HTTP API client → Application server: HTTP API
