# bhavanabc05/sukoon architecture

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

- Interactive diagram: https://gitdiagram.com/bhavanabc05/sukoon
- Repository: https://github.com/bhavanabc05/sukoon

## Overview

Sukoon is a wellbeing platform for tracking emotions and assessments, practicing guided support activities, and engaging with community resources and challenges. Users enter through the routed frontend, submit or retrieve wellbeing data through the shared API client, and the Express backend handles API operations backed by MongoDB models. The graph preserves major documented product areas, including text, audio, and video emotion tools. Backend routes are concentrated in a large server file; the excerpts do not expose all route handlers or model operations, so uncertain links are omitted.

Main entry points: [`frontend/src/utils/api.js`](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/utils/api.js) (API client), [`frontend/src/App.jsx`](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/App.jsx) (Routes and shell), [`backend/server.js`](https://github.com/bhavanabc05/sukoon/blob/main/backend/server.js) (Express API), [`frontend/src/pages/PostShiftDecompression.jsx`](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/PostShiftDecompression.jsx) (Stress and shift tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_app["Routes and shell<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_wellbeing["Wellbeing tools"]
  node_checkins["Check-ins and journal<br/>[MoodCheckin.jsx]"]
  node_emotion["Emotion analysis<br/>[TextEmotion.jsx]"]
  node_audio["Audio emotion<br/>[AudioEmotion.jsx]"]
  node_video["Video emotion<br/>[VideoEmotion.jsx]"]
  node_insights["Emotion insights"]
  node_phq["PHQ-4 assessment<br/>[PHQ4Assessment.jsx]"]
  node_somatic["Stress and shift tools"]
  node_reflection["Guided reflection"]
  node_wheel["Emotion wheel<br/>[EmotionWheel.jsx]"]
  node_reminders["Reminders<br/>[Reminders.jsx]"]
  node_chat["Sukoon chat<br/>[SukoonChat.jsx]"]
end

subgraph group_community["Community and resources"]
  node_community["Community<br/>[Community.jsx]"]
  node_challenges["Challenges<br/>[Challenges.jsx]"]
  node_resources["Resources<br/>[ResourceHub.jsx]"]
end

subgraph group_backend["API and services"]
  node_backend["Express API<br/>[server.js]"]
  node_auth["Token authentication<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistence"]
  node_models["Domain models"]
  node_mongo[("MongoDB")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_insights
node_app -->|"routes"| node_audio
node_app -->|"routes"| node_video
node_app -->|"routes"| node_chat
node_app -->|"routes"| node_resources
node_user -.->|"records"| node_checkins
node_user -.->|"submits text"| node_emotion
node_user -.->|"completes"| node_phq
node_user -->|"uses"| node_somatic
node_somatic -->|"renders"| node_reflection
node_reflection -->|"renders"| node_wheel
node_user -.->|"manages"| node_reminders
node_user -.->|"participates"| node_community
node_user -->|"joins"| node_challenges
node_dashboard -->|"fetches data"| node_api
node_insights -->|"fetches data"| node_api
node_phq -->|"requests data"| node_api
node_somatic -->|"requests data"| node_api
node_reflection -->|"submits reflection"| node_api
node_reminders -->|"requests data"| node_api
node_chat -->|"requests data"| node_api
node_community -->|"requests data"| node_api
node_challenges -->|"requests data"| node_api
node_video -->|"requests data"| node_api
node_api -->|"sends HTTP"| node_backend
node_backend -.->|"uses middleware"| node_auth
node_backend -->|"queries models"| node_models
node_backend -.->|"persists records"| node_mongo
node_models -.->|"map documents"| node_mongo

click node_app "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Dashboard.jsx"
click node_api "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/utils/api.js"
click node_checkins "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/MoodCheckin.jsx"
click node_emotion "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/TextEmotion.jsx"
click node_audio "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/AudioEmotion.jsx"
click node_video "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/VideoEmotion.jsx"
click node_insights "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/EmotionInsights.jsx"
click node_phq "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/PHQ4Assessment.jsx"
click node_somatic "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/PostShiftDecompression.jsx"
click node_reflection "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/components/GuidedReflectionActivity.jsx"
click node_wheel "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/components/EmotionWheel.jsx"
click node_reminders "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Reminders.jsx"
click node_chat "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/SukoonChat.jsx"
click node_community "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Community.jsx"
click node_challenges "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Challenges.jsx"
click node_resources "https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/ResourceHub.jsx"
click node_backend "https://github.com/bhavanabc05/sukoon/blob/main/backend/server.js"
click node_auth "https://github.com/bhavanabc05/sukoon/blob/main/backend/middleware/authMiddleware.js"
click node_models "https://github.com/bhavanabc05/sukoon/tree/main/backend/models"

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_dashboard,node_api,node_user toneBlue
class node_checkins,node_emotion,node_audio,node_video,node_insights,node_phq,node_somatic,node_reflection,node_wheel,node_reminders,node_chat toneAmber
class node_community,node_challenges,node_resources toneMint
class node_backend,node_auth toneRose
class node_models,node_mongo toneIndigo
```

## Components

### User experience

- [Routes and shell](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [API client](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Wellbeing tools

- [Check-ins and journal](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/MoodCheckin.jsx): `frontend/src/pages/MoodCheckin.jsx`
- [Emotion analysis](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/TextEmotion.jsx): `frontend/src/pages/TextEmotion.jsx`
- [Audio emotion](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/AudioEmotion.jsx): `frontend/src/pages/AudioEmotion.jsx`
- [Video emotion](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/VideoEmotion.jsx): `frontend/src/pages/VideoEmotion.jsx`
- [Emotion insights](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/EmotionInsights.jsx): `frontend/src/pages/EmotionInsights.jsx`
- [PHQ-4 assessment](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/PHQ4Assessment.jsx): `frontend/src/pages/PHQ4Assessment.jsx`
- [Stress and shift tools](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/PostShiftDecompression.jsx): `frontend/src/pages/PostShiftDecompression.jsx`
- [Guided reflection](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/components/GuidedReflectionActivity.jsx): `frontend/src/components/GuidedReflectionActivity.jsx`
- [Emotion wheel](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/components/EmotionWheel.jsx): `frontend/src/components/EmotionWheel.jsx`
- [Reminders](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Reminders.jsx): `frontend/src/pages/Reminders.jsx`
- [Sukoon chat](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/SukoonChat.jsx): `frontend/src/pages/SukoonChat.jsx`

### Community and resources

- [Community](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Community.jsx): `frontend/src/pages/Community.jsx`
- [Challenges](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/Challenges.jsx): `frontend/src/pages/Challenges.jsx`
- [Resources](https://github.com/bhavanabc05/sukoon/blob/main/frontend/src/pages/ResourceHub.jsx): `frontend/src/pages/ResourceHub.jsx`

### API and services

- [Express API](https://github.com/bhavanabc05/sukoon/blob/main/backend/server.js): `backend/server.js`
- [Token authentication](https://github.com/bhavanabc05/sukoon/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Persistence

- [Domain models](https://github.com/bhavanabc05/sukoon/tree/main/backend/models): `backend/models`
- **MongoDB**

### Other components

- **User**

## Connections

- User → Routes and shell: uses (evidence: `frontend/src/App.jsx`)
- Routes and shell → Dashboard: routes (evidence: `frontend/src/App.jsx`)
- Routes and shell → Emotion insights: routes (evidence: `frontend/src/App.jsx`)
- Routes and shell → Audio emotion: routes (evidence: `frontend/src/App.jsx`)
- Routes and shell → Video emotion: routes (evidence: `frontend/src/App.jsx`)
- Routes and shell → Sukoon chat: routes (evidence: `frontend/src/App.jsx`)
- Routes and shell → Resources: routes (evidence: `frontend/src/App.jsx`)
- User → Check-ins and journal: records
- User → Emotion analysis: submits text
- User → PHQ-4 assessment: completes
- User → Stress and shift tools: uses (evidence: `frontend/src/pages/PostShiftDecompression.jsx`)
- Stress and shift tools → Guided reflection: renders (evidence: `frontend/src/pages/PostShiftDecompression.jsx`)
- Guided reflection → Emotion wheel: renders (evidence: `frontend/src/components/GuidedReflectionActivity.jsx`)
- User → Reminders: manages
- User → Community: participates
- User → Challenges: joins (evidence: `frontend/src/pages/Challenges.jsx`)
- Dashboard → API client: fetches data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Emotion insights → API client: fetches data (evidence: `frontend/src/pages/EmotionInsights.jsx`)
- PHQ-4 assessment → API client: requests data (evidence: `frontend/src/pages/PHQ4Assessment.jsx`)
- Stress and shift tools → API client: requests data (evidence: `frontend/src/pages/PostShiftDecompression.jsx`)
- Guided reflection → API client: submits reflection (evidence: `frontend/src/components/GuidedReflectionActivity.jsx`)
- Reminders → API client: requests data (evidence: `frontend/src/pages/Reminders.jsx`)
- Sukoon chat → API client: requests data (evidence: `frontend/src/pages/SukoonChat.jsx`)
- Community → API client: requests data (evidence: `frontend/src/pages/Community.jsx`)
- Challenges → API client: requests data (evidence: `frontend/src/pages/Challenges.jsx`)
- Video emotion → API client: requests data (evidence: `frontend/src/pages/VideoEmotion.jsx`)
- API client → Express API: sends HTTP (evidence: `frontend/src/utils/api.js`)
- Express API → Token authentication: uses middleware (evidence: `backend/server.js`)
- Express API → Domain models: queries models (evidence: `backend/server.js`)
- Express API → MongoDB: persists records
- Domain models → MongoDB: map documents
