# tishyo77/mentalhealthapp architecture

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

- Interactive diagram: https://gitdiagram.com/tishyo77/mentalhealthapp
- Repository: https://github.com/tishyo77/mentalhealthapp

## Overview

SerenitySync is a wellness web app for account access, mood tracking, journaling, meditation, self-help reading, and therapist discovery or registration. The main user workflow enters through the React router, then uses wellness pages that retrieve or save personal data through the Express API and MongoDB. Meditation also plays YouTube videos. The graph preserves the major product areas visible in the tree; several page and route implementations were not sampled, so their internal behavior and wiring are left unspecified.

Main entry points: [`server/index.js`](https://github.com/tishyo77/mentalhealthapp/blob/main/server/index.js) (Express API), [`client/src/App.jsx`](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/App.jsx) (React router), [`client/src/Meditation/Meditations.jsx`](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Meditation/Meditations.jsx) (Meditation player), [`client/src/Dashboard/Dashboard.jsx`](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Dashboard/Dashboard.jsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Account access"]
  node_app["React router<br/>[App.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
  node_login["Log in<br/>[LogIn.jsx]"]
end

subgraph group_wellness["Personal wellness"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_mood["Mood graph<br/>[Graph.jsx]"]
  node_diary["Personal diary<br/>[DiaryPage.jsx]"]
  node_profile["Profile and avatar<br/>[Profile.jsx]"]
end

subgraph group_content["Wellness resources"]
  node_meditation["Meditation player<br/>[Meditations.jsx]"]
  node_library["Book library<br/>[LibraryPage.jsx]"]
  node_therapists["Therapist directory<br/>[TherapistPage.jsx]"]
  node_register["Therapist registration"]
end

subgraph group_services["API and data"]
  node_api["Express API<br/>[index.js]"]
  node_users["User routes<br/>[userRoute.js]"]
  node_details["Wellness routes<br/>[detailsRoute.js]"]
  node_books["Book routes<br/>[bookRoute.js]"]
  node_meditations["Meditation routes<br/>[meditateRoute.js]"]
  node_therapistapi["Therapist routes<br/>[therapistRoute.js]"]
  node_userstore[("User records<br/>[userSchema.js]")]
  node_detailsstore[("Wellness records<br/>[detailsSchema.js]")]
  node_bookstore[("Book records<br/>[bookSchema.js]")]
  node_medstore[("Meditation records<br/>[meditateSchema.js]")]
  node_therapiststore[("Therapist records<br/>[therapistSchema.js]")]
end

node_user(("User"))
node_youtube["YouTube services"]

node_user -->|"uses"| node_app
node_app -->|"routes"| node_signup
node_app -->|"routes"| node_login
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_diary
node_app -->|"routes"| node_profile
node_app -->|"routes"| node_meditation
node_app -->|"routes"| node_library
node_app -->|"routes"| node_therapists
node_app -->|"routes"| node_register
node_dashboard -->|"renders"| node_mood
node_mood -->|"fetches feelings"| node_api
node_diary -->|"reads and saves"| node_api
node_profile -->|"manages profile"| node_api
node_library -->|"fetches books"| node_api
node_meditation -->|"fetches catalog; saves last played"| node_api
node_meditation -->|"loads videos and durations"| node_youtube
node_register -->|"submits application"| node_api
node_api -->|"mounts"| node_users
node_api -->|"mounts"| node_details
node_api -->|"mounts"| node_books
node_api -->|"mounts"| node_meditations
node_api -->|"mounts"| node_therapistapi
node_users -->|"reads and writes"| node_userstore
node_details -->|"reads and writes"| node_detailsstore
node_books -->|"reads and writes"| node_bookstore
node_meditations -->|"reads and writes"| node_medstore
node_therapistapi -->|"reads and writes"| node_therapiststore

click node_app "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/App.jsx"
click node_signup "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/SignUp.jsx"
click node_login "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/LogIn.jsx"
click node_dashboard "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Dashboard/Dashboard.jsx"
click node_mood "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Dashboard/Graph.jsx"
click node_diary "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Diary/DiaryPage.jsx"
click node_profile "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Profile.jsx"
click node_meditation "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Meditation/Meditations.jsx"
click node_library "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Library/LibraryPage.jsx"
click node_therapists "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Therapist/TherapistPage.jsx"
click node_register "https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Therapist/TherapistRegister.jsx"
click node_api "https://github.com/tishyo77/mentalhealthapp/blob/main/server/index.js"
click node_users "https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/userRoute.js"
click node_details "https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/detailsRoute.js"
click node_books "https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/bookRoute.js"
click node_meditations "https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/meditateRoute.js"
click node_therapistapi "https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/therapistRoute.js"
click node_userstore "https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/userSchema.js"
click node_detailsstore "https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/detailsSchema.js"
click node_bookstore "https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/bookSchema.js"
click node_medstore "https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/meditateSchema.js"
click node_therapiststore "https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/therapistSchema.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_signup,node_login,node_user toneBlue
class node_dashboard,node_mood,node_diary,node_profile toneAmber
class node_meditation,node_library,node_therapists,node_register toneMint
class node_api,node_users,node_details,node_books,node_meditations,node_therapistapi,node_userstore,node_detailsstore,node_bookstore,node_medstore,node_therapiststore toneRose
class node_youtube toneIndigo
```

## Components

### Account access

- [React router](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign up](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/SignUp.jsx): `client/src/SignUp.jsx`
- [Log in](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/LogIn.jsx): `client/src/LogIn.jsx`

### Personal wellness

- [Dashboard](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Dashboard/Dashboard.jsx): `client/src/Dashboard/Dashboard.jsx`
- [Mood graph](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Dashboard/Graph.jsx): `client/src/Dashboard/Graph.jsx`
- [Personal diary](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Diary/DiaryPage.jsx): `client/src/Diary/DiaryPage.jsx`
- [Profile and avatar](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Profile.jsx): `client/src/Profile.jsx`

### Wellness resources

- [Meditation player](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Meditation/Meditations.jsx): `client/src/Meditation/Meditations.jsx`
- [Book library](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Library/LibraryPage.jsx): `client/src/Library/LibraryPage.jsx`
- [Therapist directory](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Therapist/TherapistPage.jsx): `client/src/Therapist/TherapistPage.jsx`
- [Therapist registration](https://github.com/tishyo77/mentalhealthapp/blob/main/client/src/Therapist/TherapistRegister.jsx): `client/src/Therapist/TherapistRegister.jsx`

### API and data

- [Express API](https://github.com/tishyo77/mentalhealthapp/blob/main/server/index.js): `server/index.js`
- [User routes](https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/userRoute.js): `server/controller/userRoute.js`
- [Wellness routes](https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/detailsRoute.js): `server/controller/detailsRoute.js`
- [Book routes](https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/bookRoute.js): `server/controller/bookRoute.js`
- [Meditation routes](https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/meditateRoute.js): `server/controller/meditateRoute.js`
- [Therapist routes](https://github.com/tishyo77/mentalhealthapp/blob/main/server/controller/therapistRoute.js): `server/controller/therapistRoute.js`
- [User records](https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/userSchema.js): `server/models/userSchema.js`
- [Wellness records](https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/detailsSchema.js): `server/models/detailsSchema.js`
- [Book records](https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/bookSchema.js): `server/models/bookSchema.js`
- [Meditation records](https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/meditateSchema.js): `server/models/meditateSchema.js`
- [Therapist records](https://github.com/tishyo77/mentalhealthapp/blob/main/server/models/therapistSchema.js): `server/models/therapistSchema.js`

### Other components

- **User**
- **YouTube services**

## Connections

- User → React router: uses
- React router → Sign up: routes
- React router → Log in: routes
- React router → Dashboard: routes
- React router → Personal diary: routes
- React router → Profile and avatar: routes
- React router → Meditation player: routes
- React router → Book library: routes
- React router → Therapist directory: routes
- React router → Therapist registration: routes
- Dashboard → Mood graph: renders
- Mood graph → Express API: fetches feelings
- Personal diary → Express API: reads and saves
- Profile and avatar → Express API: manages profile
- Book library → Express API: fetches books
- Meditation player → Express API: fetches catalog; saves last played
- Meditation player → YouTube services: loads videos and durations
- Therapist registration → Express API: submits application
- Express API → User routes: mounts
- Express API → Wellness routes: mounts
- Express API → Book routes: mounts
- Express API → Meditation routes: mounts
- Express API → Therapist routes: mounts
- User routes → User records: reads and writes
- Wellness routes → Wellness records: reads and writes
- Book routes → Book records: reads and writes
- Meditation routes → Meditation records: reads and writes
- Therapist routes → Therapist records: reads and writes
