# pradeepkumarh-17/project_csm architecture

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

- Interactive diagram: https://gitdiagram.com/pradeepkumarh-17/project_csm
- Repository: https://github.com/pradeepkumarh-17/project_csm

## Overview

This repository combines an emotion/stress assessment product with a Flask service, browser screens, and standalone desktop predictors. The documented web workflow is image submission followed by emotion/stress results; the backend also exposes voice, survey, authentication, and assessment-history capabilities. The sampled backend excerpts show audio preprocessing and survey prediction, but not every route or frontend connection. Dashed links mark plausible user navigation or prediction paths that the available evidence does not establish directly.

Main entry points: [`model project/app.py`](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/app.py) (Flask API), [`frontend/index.html`](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/index.html) (Web application), [`model project/db/auth_routes.py`](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/auth_routes.py) (Authentication routes), [`model project/db/__init__.py`](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/__init__.py) (Database extensions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_web["Web application<br/>[index.html]"]
  node_face_screen["Face assessment<br/>[face.html]"]
  node_voice_screen["Voice assessment<br/>[voice.html]"]
  node_survey_screen["Survey assessment<br/>[survey.html]"]
  node_results["Results screen<br/>[results.html]"]
  node_browser_state["Result state<br/>[sessionStorage.js]"]
  node_desktop_face["Desktop face predictor"]
  node_desktop_voice["Desktop voice predictor"]
end

subgraph group_service["Flask service"]
  node_flask["Flask API<br/>[app.py]"]
end

subgraph group_prediction["Prediction capabilities"]
  node_face_model["Face emotion model<br/>[face.py]"]
  node_voice_model["Voice emotion model<br/>[voice.py]"]
  node_survey_model["Stress survey model<br/>[survey.py]"]
end

subgraph group_identity["Identity and records"]
  node_auth_routes["Authentication routes<br/>[auth_routes.py]"]
  node_db_setup["Database extensions<br/>[__init__.py]"]
  node_db_models[("User and assessment records<br/>[models.py]")]
end

node_user(("User"))
node_database[("MySQL database")]

node_user -.->|"uses"| node_web
node_web -.->|"opens"| node_face_screen
node_web -.->|"opens"| node_voice_screen
node_web -.->|"opens"| node_survey_screen
node_face_screen -.->|"submits image"| node_flask
node_voice_screen -.->|"submits audio"| node_flask
node_survey_screen -.->|"submits answers"| node_flask
node_flask -.->|"returns results"| node_results
node_results -.->|"stores results"| node_browser_state
node_user -->|"uses"| node_desktop_face
node_user -.->|"uses"| node_desktop_voice
node_flask -->|"registers routes"| node_auth_routes
node_auth_routes -->|"queries records"| node_db_models
node_auth_routes -->|"uses session"| node_db_setup
node_db_models -->|"uses extensions"| node_db_setup
node_db_setup -->|"configures connection"| node_database
node_flask -->|"saves assessments"| node_db_models
node_flask -.->|"loads model"| node_face_model
node_flask -.->|"predicts voice"| node_voice_model
node_flask -.->|"predicts survey"| node_survey_model

click node_web "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/index.html"
click node_face_screen "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/face.html"
click node_voice_screen "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/voice.html"
click node_survey_screen "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/survey.html"
click node_results "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/results.html"
click node_browser_state "https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/sessionStorage.js"
click node_desktop_face "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/emotion_predictor_gui.py"
click node_desktop_voice "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/voice_emotion_gui.py"
click node_flask "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/app.py"
click node_face_model "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/face.py"
click node_voice_model "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/voice.py"
click node_survey_model "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/survey.py"
click node_auth_routes "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/auth_routes.py"
click node_db_setup "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/__init__.py"
click node_db_models "https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/models.py"

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_web,node_face_screen,node_voice_screen,node_survey_screen,node_results,node_browser_state,node_desktop_face,node_desktop_voice,node_user toneBlue
class node_flask,node_database toneAmber
class node_face_model,node_voice_model,node_survey_model toneMint
class node_auth_routes,node_db_setup,node_db_models toneRose
```

## Components

### User interfaces

- [Web application](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/index.html): `frontend/index.html`
- [Face assessment](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/face.html): `frontend/assessment/face.html`
- [Voice assessment](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/voice.html): `frontend/assessment/voice.html`
- [Survey assessment](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/survey.html): `frontend/assessment/survey.html`
- [Results screen](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/assessment/results.html): `frontend/assessment/results.html`
- [Result state](https://github.com/pradeepkumarh-17/project_csm/blob/main/frontend/sessionStorage.js): `frontend/sessionStorage.js`
- [Desktop face predictor](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/emotion_predictor_gui.py): `model project/emotion_predictor_gui.py`
- [Desktop voice predictor](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/voice_emotion_gui.py): `model project/voice_emotion_gui.py`

### Flask service

- [Flask API](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/app.py): `model project/app.py`

### Prediction capabilities

- [Face emotion model](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/face.py): `model project/ml models/face.py`
- [Voice emotion model](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/voice.py): `model project/ml models/voice.py`
- [Stress survey model](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/ml%20models/survey.py): `model project/ml models/survey.py`

### Identity and records

- [Authentication routes](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/auth_routes.py): `model project/db/auth_routes.py`
- [Database extensions](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/__init__.py): `model project/db/__init__.py`
- [User and assessment records](https://github.com/pradeepkumarh-17/project_csm/blob/main/model%20project/db/models.py): `model project/db/models.py`

### Other components

- **User**
- **MySQL database**

## Connections

- User → Web application: uses
- Web application → Face assessment: opens
- Web application → Voice assessment: opens
- Web application → Survey assessment: opens
- Face assessment → Flask API: submits image
- Voice assessment → Flask API: submits audio
- Survey assessment → Flask API: submits answers
- Flask API → Results screen: returns results
- Results screen → Result state: stores results
- User → Desktop face predictor: uses (evidence: `README.md`)
- User → Desktop voice predictor: uses
- Flask API → Authentication routes: registers routes (evidence: `model project/app.py`)
- Authentication routes → User and assessment records: queries records (evidence: `model project/db/auth_routes.py`)
- Authentication routes → Database extensions: uses session (evidence: `model project/db/auth_routes.py`)
- User and assessment records → Database extensions: uses extensions (evidence: `model project/db/models.py`)
- Database extensions → MySQL database: configures connection (evidence: `model project/db/__init__.py`)
- Flask API → User and assessment records: saves assessments (evidence: `model project/app.py`)
- Flask API → Face emotion model: loads model
- Flask API → Voice emotion model: predicts voice
- Flask API → Stress survey model: predicts survey
