# asadmulani5/emotionverse architecture

> Architecture diagram of the GitHub repository asadmulani5/emotionverse, 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/asadmulani5/emotionverse
- Repository: https://github.com/asadmulani5/emotionverse

## Overview

EmotionVerse is a real-time emotion analytics application. A user selects an analysis mode, types text and grants camera access; the frontend sends captured frames and text over Socket.IO. The backend analyzes supplied modalities, combines scores for fusion results, and returns them for smoothing, timeline updates, and dashboard display. The backend also exposes separate REST prediction endpoints, including voice analysis, although the shown frontend does not capture or send audio. The graph follows the sampled source; it does not assume an unshown audio workflow.

Main entry points: [`frontend/src/App.js`](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/App.js) (App and Socket Client), [`backend/main.py`](https://github.com/asadmulani5/emotionverse/blob/main/backend/main.py) (API and Socket Handler), [`frontend/src/components/WebcamCapture.jsx`](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/WebcamCapture.jsx) (Webcam Capture), [`frontend/src/components/EmotionDashboard.jsx`](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/EmotionDashboard.jsx) (Emotion Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App and Socket Client<br/>[App.js]"]
  node_webcam["Webcam Capture<br/>[WebcamCapture.jsx]"]
  node_dashboard["Emotion Dashboard"]
end

subgraph group_backend["Backend"]
  node_api["API and Socket Handler<br/>[main.py]"]
end

subgraph group_models["Emotion Models"]
  node_text["Text Analysis<br/>[text_model.py]"]
  node_face["Face Analysis<br/>[face_model.py]"]
  node_voice["Voice Analysis<br/>[voice_model.py]"]
  node_fusion["Weighted Fusion<br/>[fusion.py]"]
end

subgraph group_results["Results"]
  node_state["Smoothing and Timeline<br/>[App.js]"]
end

node_user(("User"))
node_camera(("Browser Camera"))

node_user -->|"enters text, selects mode"| node_app
node_camera -->|"provides video stream"| node_webcam
node_app -->|"renders, passes callback"| node_webcam
node_webcam -->|"sends captured frame"| node_app
node_app -->|"emits analyze event"| node_api
node_api -->|"emits emotion result"| node_app
node_api -->|"calls prediction"| node_text
node_api -->|"calls prediction"| node_face
node_api -->|"calls prediction"| node_voice
node_api -->|"passes modality scores"| node_fusion
node_app -->|"updates history and log"| node_state
node_state -->|"supplies smoothed scores"| node_dashboard
node_app -->|"renders results"| node_dashboard

click node_app "https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/App.js"
click node_webcam "https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/WebcamCapture.jsx"
click node_dashboard "https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/EmotionDashboard.jsx"
click node_api "https://github.com/asadmulani5/emotionverse/blob/main/backend/main.py"
click node_text "https://github.com/asadmulani5/emotionverse/blob/main/backend/models/text_model.py"
click node_face "https://github.com/asadmulani5/emotionverse/blob/main/backend/models/face_model.py"
click node_voice "https://github.com/asadmulani5/emotionverse/blob/main/backend/models/voice_model.py"
click node_fusion "https://github.com/asadmulani5/emotionverse/blob/main/backend/fusion.py"
click node_state "https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/App.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_webcam,node_dashboard,node_user,node_camera toneBlue
class node_api toneAmber
class node_text,node_face,node_voice,node_fusion toneMint
class node_state toneRose
```

## Components

### Frontend

- [App and Socket Client](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Webcam Capture](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/WebcamCapture.jsx): `frontend/src/components/WebcamCapture.jsx`
- [Emotion Dashboard](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/components/EmotionDashboard.jsx): `frontend/src/components/EmotionDashboard.jsx`

### Backend

- [API and Socket Handler](https://github.com/asadmulani5/emotionverse/blob/main/backend/main.py): `backend/main.py`

### Emotion Models

- [Text Analysis](https://github.com/asadmulani5/emotionverse/blob/main/backend/models/text_model.py): `backend/models/text_model.py`
- [Face Analysis](https://github.com/asadmulani5/emotionverse/blob/main/backend/models/face_model.py): `backend/models/face_model.py`
- [Voice Analysis](https://github.com/asadmulani5/emotionverse/blob/main/backend/models/voice_model.py): `backend/models/voice_model.py`
- [Weighted Fusion](https://github.com/asadmulani5/emotionverse/blob/main/backend/fusion.py): `backend/fusion.py`

### Results

- [Smoothing and Timeline](https://github.com/asadmulani5/emotionverse/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Other components

- **User**
- **Browser Camera**

## Connections

- User → App and Socket Client: enters text, selects mode (evidence: `frontend/src/App.js`)
- Browser Camera → Webcam Capture: provides video stream (evidence: `frontend/src/components/WebcamCapture.jsx`)
- App and Socket Client → Webcam Capture: renders, passes callback (evidence: `frontend/src/App.js`)
- Webcam Capture → App and Socket Client: sends captured frame (evidence: `frontend/src/components/WebcamCapture.jsx`)
- App and Socket Client → API and Socket Handler: emits analyze event (evidence: `frontend/src/App.js`)
- API and Socket Handler → App and Socket Client: emits emotion result (evidence: `backend/main.py`)
- API and Socket Handler → Text Analysis: calls prediction (evidence: `backend/main.py`)
- API and Socket Handler → Face Analysis: calls prediction (evidence: `backend/main.py`)
- API and Socket Handler → Voice Analysis: calls prediction (evidence: `backend/main.py`)
- API and Socket Handler → Weighted Fusion: passes modality scores (evidence: `backend/main.py`)
- App and Socket Client → Smoothing and Timeline: updates history and log (evidence: `frontend/src/App.js`)
- Smoothing and Timeline → Emotion Dashboard: supplies smoothed scores (evidence: `frontend/src/App.js`)
- App and Socket Client → Emotion Dashboard: renders results (evidence: `frontend/src/App.js`)
