# parthkprogrammer/mindease--ai architecture

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

- Interactive diagram: https://gitdiagram.com/parthkprogrammer/mindease--ai
- Repository: https://github.com/parthkprogrammer/mindease--ai

## Overview

Mental Wellness Backend is a NestJS API for patient self-service and psychologist care, backed by MongoDB. The main workflow is an authenticated request entering through the Vercel catch-all, reaching a domain controller and service, and reading or changing domain data; patient journal and mood entries are also inputs to wellness and clinician views. The README documents additional engagement, AI, appointment, assessment, messaging, and crisis features. Those unsampled feature modules are shown as capabilities, but their internal calls are not inferred. Edges reflect shown imports/calls or README statements.

Main entry points: [`src/app.module.ts`](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/app.module.ts) (Module registry), [`src/modules/psychologist/psychologist.controller.ts`](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/psychologist/psychologist.controller.ts) (Psychologist portal), [`src/modules/mood/mood.controller.ts`](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood.controller.ts) (Mood tracking), [`src/modules/users/users.controller.ts`](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/users/users.controller.ts) (Users and profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_vercel["Catch-all route<br/>[&#91;...path&#93;.ts]"]
  node_bootstrap["Nest app setup<br/>[create-app.ts]"]
  node_app["Module registry<br/>[app.module.ts]"]
  node_database["Database connection<br/>[database.module.ts]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["Users and profiles"]
  node_userstore[("User records<br/>[user.schema.ts]")]
end

subgraph group_patient["Patient wellness"]
  node_journal["Journal entries"]
  node_journalservice["Journal operations<br/>[journal.service.ts]"]
  node_mood["Mood tracking<br/>[mood.controller.ts]"]
  node_moodservice["Mood operations<br/>[mood.service.ts]"]
  node_moodanalysis["Image mood analysis"]
  node_wellness["Wellness records"]
  node_tasks["Patient tasks<br/>[tasks.service.ts]"]
end

subgraph group_care["Care and engagement"]
  node_psychologist["Psychologist portal"]
  node_psychologistservice["Clinician services"]
  node_appointments["Appointments"]
  node_assessments["Assessments"]
  node_crisis["Crisis alerts"]
  node_messages["Care messages"]
  node_engagement["Engagement features"]
  node_activities["Activities and mindfulness"]
  node_community["Community"]
  node_badges["Badges"]
  node_ai["AI features"]
end

node_client(("API client"))
node_mongo[("MongoDB Atlas")]

node_client -->|"sends request"| node_vercel
node_vercel -->|"routes to"| node_bootstrap
node_bootstrap -->|"creates"| node_app
node_app -->|"registers"| node_database
node_database -->|"connects"| node_mongo
node_app -->|"registers"| node_users
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_journal
node_app -->|"registers"| node_wellness
node_app -->|"registers"| node_mood
node_app -->|"registers"| node_tasks
node_app -->|"registers"| node_psychologist
node_app -->|"registers"| node_appointments
node_app -->|"registers"| node_assessments
node_app -->|"registers"| node_crisis
node_app -->|"registers"| node_messages
node_app -->|"registers"| node_engagement
node_app -->|"registers"| node_activities
node_app -->|"registers"| node_community
node_app -->|"registers"| node_badges
node_app -->|"registers"| node_ai
node_auth -->|"uses accounts"| node_users
node_users -->|"persists profiles"| node_userstore
node_journal -->|"calls"| node_journalservice
node_journalservice -.->|"feeds records"| node_wellness
node_mood -->|"calls"| node_moodservice
node_mood -->|"analyzes image"| node_moodanalysis
node_psychologist -->|"calls"| node_psychologistservice
node_psychologist -->|"assigns tasks"| node_tasks
node_psychologist -->|"reads entries"| node_journalservice
node_psychologist -->|"reads records"| node_wellness
node_psychologist -->|"reads entries"| node_moodservice

click node_vercel "https://github.com/parthkprogrammer/mindease--ai/blob/main/api/%5B...path%5D.ts"
click node_bootstrap "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/create-app.ts"
click node_app "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/app.module.ts"
click node_database "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/database/database.module.ts"
click node_auth "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/auth/auth.service.ts"
click node_users "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/users/users.controller.ts"
click node_userstore "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/users/schemas/user.schema.ts"
click node_journal "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/journal/journal.controller.ts"
click node_journalservice "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/journal/journal.service.ts"
click node_mood "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood.controller.ts"
click node_moodservice "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood.service.ts"
click node_moodanalysis "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood-analyzer.service.ts"
click node_wellness "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/wellness/wellness.service.ts"
click node_tasks "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/tasks/tasks.service.ts"
click node_psychologist "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/psychologist/psychologist.controller.ts"
click node_psychologistservice "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/psychologist/psychologist.service.ts"
click node_appointments "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/appointments/appointments.controller.ts"
click node_assessments "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/assessments/assessments.controller.ts"
click node_crisis "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/crisis-alerts/crisis-alerts.controller.ts"
click node_messages "https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/messages/messages.controller.ts"
click node_engagement "https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/challenges"
click node_activities "https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/activities"
click node_community "https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/community"
click node_badges "https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/badges"
click node_ai "https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/ai"

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_vercel,node_bootstrap,node_app,node_database,node_client toneBlue
class node_auth,node_users,node_userstore,node_mongo toneAmber
class node_journal,node_journalservice,node_mood,node_moodservice,node_moodanalysis,node_wellness,node_tasks toneMint
class node_psychologist,node_psychologistservice,node_appointments,node_assessments,node_crisis,node_messages,node_engagement,node_activities,node_community,node_badges,node_ai toneRose
```

## Components

### API runtime

- [Catch-all route](https://github.com/parthkprogrammer/mindease--ai/blob/main/api/%5B...path%5D.ts): `api/[...path].ts`
- [Nest app setup](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/create-app.ts): `src/create-app.ts`
- [Module registry](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/app.module.ts): `src/app.module.ts`
- [Database connection](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/database/database.module.ts): `src/database/database.module.ts`

### Identity and profiles

- [Authentication](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/auth/auth.service.ts): `src/modules/auth/auth.service.ts`
- [Users and profiles](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/users/users.controller.ts): `src/modules/users/users.controller.ts`
- [User records](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/users/schemas/user.schema.ts): `src/modules/users/schemas/user.schema.ts`

### Patient wellness

- [Journal entries](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/journal/journal.controller.ts): `src/modules/journal/journal.controller.ts`
- [Journal operations](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/journal/journal.service.ts): `src/modules/journal/journal.service.ts`
- [Mood tracking](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood.controller.ts): `src/modules/mood/mood.controller.ts`
- [Mood operations](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood.service.ts): `src/modules/mood/mood.service.ts`
- [Image mood analysis](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/mood/mood-analyzer.service.ts): `src/modules/mood/mood-analyzer.service.ts`
- [Wellness records](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/wellness/wellness.service.ts): `src/modules/wellness/wellness.service.ts`
- [Patient tasks](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/tasks/tasks.service.ts): `src/modules/tasks/tasks.service.ts`

### Care and engagement

- [Psychologist portal](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/psychologist/psychologist.controller.ts): `src/modules/psychologist/psychologist.controller.ts`
- [Clinician services](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/psychologist/psychologist.service.ts): `src/modules/psychologist/psychologist.service.ts`
- [Appointments](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/appointments/appointments.controller.ts): `src/modules/appointments/appointments.controller.ts`
- [Assessments](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/assessments/assessments.controller.ts): `src/modules/assessments/assessments.controller.ts`
- [Crisis alerts](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/crisis-alerts/crisis-alerts.controller.ts): `src/modules/crisis-alerts/crisis-alerts.controller.ts`
- [Care messages](https://github.com/parthkprogrammer/mindease--ai/blob/main/src/modules/messages/messages.controller.ts): `src/modules/messages/messages.controller.ts`
- [Engagement features](https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/challenges): `src/modules/challenges`
- [Activities and mindfulness](https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/activities): `src/modules/activities`
- [Community](https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/community): `src/modules/community`
- [Badges](https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/badges): `src/modules/badges`
- [AI features](https://github.com/parthkprogrammer/mindease--ai/tree/main/src/modules/ai): `src/modules/ai`

### Other components

- **API client**
- **MongoDB Atlas**

## Connections

- API client → Catch-all route: sends request
- Catch-all route → Nest app setup: routes to (evidence: `api/[...path].ts`)
- Nest app setup → Module registry: creates (evidence: `src/create-app.ts`)
- Module registry → Database connection: registers (evidence: `src/app.module.ts`)
- Database connection → MongoDB Atlas: connects (evidence: `src/database/database.module.ts`)
- Module registry → Users and profiles: registers (evidence: `src/app.module.ts`)
- Module registry → Authentication: registers (evidence: `src/app.module.ts`)
- Module registry → Journal entries: registers (evidence: `src/app.module.ts`)
- Module registry → Wellness records: registers (evidence: `src/app.module.ts`)
- Module registry → Mood tracking: registers (evidence: `src/app.module.ts`)
- Module registry → Patient tasks: registers (evidence: `src/app.module.ts`)
- Module registry → Psychologist portal: registers (evidence: `src/app.module.ts`)
- Module registry → Appointments: registers (evidence: `src/app.module.ts`)
- Module registry → Assessments: registers (evidence: `src/app.module.ts`)
- Module registry → Crisis alerts: registers (evidence: `src/app.module.ts`)
- Module registry → Care messages: registers (evidence: `src/app.module.ts`)
- Module registry → Engagement features: registers (evidence: `src/app.module.ts`)
- Module registry → Activities and mindfulness: registers (evidence: `src/app.module.ts`)
- Module registry → Community: registers (evidence: `src/app.module.ts`)
- Module registry → Badges: registers (evidence: `src/app.module.ts`)
- Module registry → AI features: registers (evidence: `src/app.module.ts`)
- Authentication → Users and profiles: uses accounts (evidence: `src/modules/auth/auth.service.ts`)
- Users and profiles → User records: persists profiles
- Journal entries → Journal operations: calls (evidence: `src/modules/journal/journal.controller.ts`)
- Journal operations → Wellness records: feeds records
- Mood tracking → Mood operations: calls (evidence: `src/modules/mood/mood.controller.ts`)
- Mood tracking → Image mood analysis: analyzes image (evidence: `src/modules/mood/mood.controller.ts`)
- Psychologist portal → Clinician services: calls (evidence: `src/modules/psychologist/psychologist.controller.ts`)
- Psychologist portal → Patient tasks: assigns tasks (evidence: `src/modules/psychologist/psychologist.controller.ts`)
- Psychologist portal → Journal operations: reads entries (evidence: `src/modules/psychologist/psychologist.controller.ts`)
- Psychologist portal → Wellness records: reads records (evidence: `src/modules/psychologist/psychologist.controller.ts`)
- Psychologist portal → Mood operations: reads entries (evidence: `src/modules/psychologist/psychologist.controller.ts`)
